diff options
author | ajreynol <andrew.j.reynolds@gmail.com> | 2016-07-20 13:28:01 -0500 |
---|---|---|
committer | ajreynol <andrew.j.reynolds@gmail.com> | 2016-07-20 13:28:01 -0500 |
commit | f827fb06c949d421fb32f6629c2c353ca7bd026e (patch) | |
tree | 04b3563aa2467784517193dd22ef95f2ce1e612a /src/theory/theory_model.cpp | |
parent | daf2eca9a4bb32680cbf35945bb09cfd13be76a7 (diff) |
Infrastructure for storing and printing heap models for separation logic. Ensure value of sep.nil is correct in models. Print instantiations as sexprs.
Diffstat (limited to 'src/theory/theory_model.cpp')
-rw-r--r-- | src/theory/theory_model.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/theory/theory_model.cpp b/src/theory/theory_model.cpp index 062ae78ed..cccd5c350 100644 --- a/src/theory/theory_model.cpp +++ b/src/theory/theory_model.cpp @@ -56,6 +56,9 @@ TheoryModel::~TheoryModel() throw() { void TheoryModel::reset(){ d_modelCache.clear(); + d_comment_str.clear(); + d_sep_heap = Node::null(); + d_sep_nil_eq = Node::null(); d_reps.clear(); d_rep_set.clear(); d_uf_terms.clear(); @@ -69,6 +72,21 @@ void TheoryModel::getComments(std::ostream& out) const { out << d_comment_str.str(); } +void TheoryModel::setHeapModel( Node h, Node neq ) { + d_sep_heap = h; + d_sep_nil_eq = neq; +} + +bool TheoryModel::getHeapModel( Expr& h, Expr& neq ) const { + if( d_sep_heap.isNull() || d_sep_nil_eq.isNull() ){ + return false; + }else{ + h = d_sep_heap.toExpr(); + neq = d_sep_nil_eq.toExpr(); + return true; + } +} + Node TheoryModel::getValue(TNode n, bool useDontCares) const { //apply substitutions Node nn = d_substitutions.apply(n); @@ -945,7 +963,7 @@ void TheoryEngineModelBuilder::buildModel(Model* m, bool fullModel) // Collect model comments from the theories if( fullModel ){ Trace("model-builder") << "TheoryEngineModelBuilder: Collect model comments..." << std::endl; - d_te->collectModelComments(tm); + d_te->postProcessModel(tm); } #ifdef CVC4_ASSERTIONS |