return ret.toExpr();
}
+/** get cardinality for sort */
+Cardinality TheoryModel::getCardinality( const Type& t ){
+ TypeNode tn = TypeNode::fromType( t );
+ //for now, we only handle cardinalities for uninterpreted sorts
+ if( tn.isSort() ){
+ if( d_rep_set.hasType( tn ) ){
+ return Cardinality( d_rep_set.d_type_reps[tn].size() );
+ }else{
+ return Cardinality( CardinalityUnknown() );
+ }
+ }else{
+ return Cardinality( CardinalityUnknown() );
+ }
+}
+
void TheoryModel::toStream( std::ostream& out ){
/*//for debugging
eq::EqClassesIterator eqcs_i = eq::EqClassesIterator( &d_equalityEngine );
++eqcs_i;
}
*/
- //need this function?
+ out << this;
}
Node TheoryModel::getModelValue( TNode n ){
public:
/** get value function for Exprs. */
Expr getValue( const Expr& expr );
-
-
+ /** get cardinality for sort */
+ Cardinality getCardinality( const Type& t );
/** to stream function */
void toStream( std::ostream& out );
public:
#include <vector>
#include "expr/expr.h"
+#include "util/cardinality.h"
namespace CVC4 {
/** get type of command */
int getCommandType( int i ) { return d_command_types[i]; }
public:
- /** get value */
+ /** get value for expression */
virtual Expr getValue( const Expr& expr ) = 0;
+ /** get cardinality for sort */
+ virtual Cardinality getCardinality( const Type& t ) = 0;
/** to stream function */
virtual void toStream(std::ostream& out) = 0;
};/* class Model */