}
out << "): ";
}
- out << tm->getValue( n );
+ out << Node::fromExpr( tm->getValue( n.toExpr() ) );
out << ";" << std::endl;
/*
out << ") " << tn;
}
out << " ";
- out << tm->getValue( n );
+ out << Node::fromExpr( tm->getValue( n.toExpr() ) );
out << ")" << std::endl;
/*
theory::TheoryModel* m = d_theoryEngine->getModel();
Node resultNode;
if( m ){
- resultNode = m->getValue( n );
+ resultNode = Node::fromExpr( m->getValue( n.toExpr() ) );
}
Trace("smt") << "--- got value " << n << " = " << resultNode << endl;
// type-check the result we got
theory::TheoryModel* m = d_theoryEngine->getModel();
Node resultNode;
if( m ){
- resultNode = m->getValue( n );
+ resultNode = Node::fromExpr( m->getValue( n.toExpr() ) );
}
// type-check the result we got
d_rep_set.clear();
}
+Expr TheoryModel::getValue( const Expr& expr ){
+ Node n = Node::fromExpr( expr );
+ //apply substitutions
+ Node nn = d_substitutions.apply( n );
+ //get value in model
+ Node ret = getModelValue( nn );
+ return ret.toExpr();
+}
+
void TheoryModel::toStream( std::ostream& out ){
/*//for debugging
eq::EqClassesIterator eqcs_i = eq::EqClassesIterator( &d_equalityEngine );
}
}
-Node TheoryModel::getValue( TNode n ){
- //apply substitutions
- Node nn = d_substitutions.apply( n );
- //get value in model
- return getModelValue( nn );
-}
-
Node TheoryModel::getDomainValue( TypeNode tn, std::vector< Node >& exclude ){
if( d_rep_set.d_type_reps.find( tn )!=d_rep_set.d_type_reps.end() ){
//try to find a pre-existing arbitrary element
*/
Node getModelValue( TNode n );
public:
- /**
- * Get value function. This should be called only after a ModelBuilder has called buildModel(...)
- * on this model.
- */
- Node getValue( TNode n );
/** get existing domain value, with possible exclusions
* This function returns a term in d_rep_set.d_type_reps[tn] but not in exclude
*/
Node getRepresentative( Node a );
bool areEqual( Node a, Node b );
bool areDisequal( Node a, Node b );
+public:
+ /** get value function */
+ Expr getValue( const Expr& expr );
+ /** to stream function */
+ void toStream( std::ostream& out );
public:
/** print representative debug function */
void printRepresentativeDebug( const char* c, Node r );
/** print representative function */
void printRepresentative( std::ostream& out, Node r );
- /** to stream function */
- void toStream( std::ostream& out );
};
/** Default model class
if( !n.hasAttribute(InstConstantAttribute()) ){
//if evaluating a ground term, just consult the standard getValue functionality
depIndex = -1;
- return getValue( n );
+ return getModelValue( n );
}else{
Node val;
depIndex = ri->getNumTerms()-1;
#include <iostream>
#include <vector>
+#include "expr/expr.h"
+
namespace CVC4 {
class Command;
/** get type of command */
int getCommandType( int i ) { return d_command_types[i]; }
public:
+ /** get value */
+ virtual Expr getValue( const Expr& expr ) = 0;
+ /** to stream function */
virtual void toStream(std::ostream& out) = 0;
};/* class Model */