diff options
Diffstat (limited to 'src/theory')
-rw-r--r-- | src/theory/model.cpp | 16 | ||||
-rw-r--r-- | src/theory/model.h | 12 | ||||
-rw-r--r-- | src/theory/quantifiers/first_order_model.cpp | 2 |
3 files changed, 15 insertions, 15 deletions
diff --git a/src/theory/model.cpp b/src/theory/model.cpp index 51d5a77b5..67640c309 100644 --- a/src/theory/model.cpp +++ b/src/theory/model.cpp @@ -46,6 +46,15 @@ void TheoryModel::reset(){ 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 ); @@ -114,13 +123,6 @@ Node TheoryModel::getModelValue( TNode n ){ } } -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 diff --git a/src/theory/model.h b/src/theory/model.h index 086e39f3e..06618e07c 100644 --- a/src/theory/model.h +++ b/src/theory/model.h @@ -70,11 +70,6 @@ protected: */ 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 */ @@ -113,12 +108,15 @@ public: 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 diff --git a/src/theory/quantifiers/first_order_model.cpp b/src/theory/quantifiers/first_order_model.cpp index c3be1cdaf..b03261195 100644 --- a/src/theory/quantifiers/first_order_model.cpp +++ b/src/theory/quantifiers/first_order_model.cpp @@ -274,7 +274,7 @@ Node FirstOrderModel::evaluateTerm( Node n, int& depIndex, RepSetIterator* ri ){ 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; |