summaryrefslogtreecommitdiff
path: root/src/theory
diff options
context:
space:
mode:
authorTim King <taking@cs.nyu.edu>2012-09-11 00:20:51 +0000
committerTim King <taking@cs.nyu.edu>2012-09-11 00:20:51 +0000
commitd8883776ce80199096f99d1088910d478fd0cd6e (patch)
tree1425084ba75c36b00656c74d59dd8ebf5bf88a1a /src/theory
parent680af6f4dc9e5d6616918e8fde18cd64774d0df5 (diff)
Partially reverting the changes made in 4308. There is now both an Expr and Node version of getValue() in TheoryModel.
Diffstat (limited to 'src/theory')
-rw-r--r--src/theory/model.cpp12
-rw-r--r--src/theory/model.h10
2 files changed, 17 insertions, 5 deletions
diff --git a/src/theory/model.cpp b/src/theory/model.cpp
index 67640c309..dc0ae7877 100644
--- a/src/theory/model.cpp
+++ b/src/theory/model.cpp
@@ -46,12 +46,16 @@ void TheoryModel::reset(){
d_rep_set.clear();
}
-Expr TheoryModel::getValue( const Expr& expr ){
- Node n = Node::fromExpr( expr );
+Node TheoryModel::getValue( TNode n ){
//apply substitutions
Node nn = d_substitutions.apply( n );
//get value in model
- Node ret = getModelValue( nn );
+ return getModelValue( nn );
+}
+
+Expr TheoryModel::getValue( const Expr& expr ){
+ Node n = Node::fromExpr( expr );
+ Node ret = getValue( n );
return ret.toExpr();
}
@@ -553,4 +557,4 @@ Node TheoryEngineModelBuilder::normalizeNode( TheoryModel* m, Node r, std::map<
}else{
return r;
}
-} \ No newline at end of file
+}
diff --git a/src/theory/model.h b/src/theory/model.h
index 06618e07c..ea1fa0fed 100644
--- a/src/theory/model.h
+++ b/src/theory/model.h
@@ -70,6 +70,12 @@ 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
*/
@@ -108,8 +114,10 @@ public:
bool areEqual( Node a, Node b );
bool areDisequal( Node a, Node b );
public:
- /** get value function */
+ /** get value function for Exprs. */
Expr getValue( const Expr& expr );
+
+
/** to stream function */
void toStream( std::ostream& out );
public:
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback