diff options
author | Morgan Deters <mdeters@gmail.com> | 2010-10-09 04:24:15 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2010-10-09 04:24:15 +0000 |
commit | 97668b64994c5749a5a75822136de49841d2c15d (patch) | |
tree | 23dd1852741a847f6228cc063b0a5ad7ec3c2af3 /src/theory/arrays | |
parent | e63abd23b45a078a42cafb277a4817abb4d044a1 (diff) |
Model generation for arith, boolean, and uf theories via
(get-value ...) SMT-LIBv2 command. As per SMT-LIBv2 spec,
you must pass --interactive --produce-models on the command
line (although they don't currently make us do any extra
work). Closes bug #213.
Diffstat (limited to 'src/theory/arrays')
-rw-r--r-- | src/theory/arrays/theory_arrays.cpp | 18 | ||||
-rw-r--r-- | src/theory/arrays/theory_arrays.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/theory/arrays/theory_arrays.cpp b/src/theory/arrays/theory_arrays.cpp index 8997138cb..55a539f44 100644 --- a/src/theory/arrays/theory_arrays.cpp +++ b/src/theory/arrays/theory_arrays.cpp @@ -18,6 +18,7 @@ #include "theory/arrays/theory_arrays.h" +#include "theory/theory_engine.h" #include "expr/kind.h" @@ -58,3 +59,20 @@ void TheoryArrays::check(Effort e) { } Debug("arrays") << "TheoryArrays::check(): done" << endl; } + +Node TheoryArrays::getValue(TNode n, TheoryEngine* engine) { + NodeManager* nodeManager = NodeManager::currentNM(); + + switch(n.getKind()) { + + case kind::VARIABLE: + Unhandled(kind::VARIABLE); + + case kind::EQUAL: // 2 args + return nodeManager-> + mkConst( engine->getValue(n[0]) == engine->getValue(n[1]) ); + + default: + Unhandled(n.getKind()); + } +} diff --git a/src/theory/arrays/theory_arrays.h b/src/theory/arrays/theory_arrays.h index cb738d085..89631d59f 100644 --- a/src/theory/arrays/theory_arrays.h +++ b/src/theory/arrays/theory_arrays.h @@ -53,6 +53,7 @@ public: void check(Effort e); void propagate(Effort e) { } void explain(TNode n, Effort e) { } + Node getValue(TNode n, TheoryEngine* engine); void shutdown() { } std::string identify() const { return std::string("TheoryArrays"); } };/* class TheoryArrays */ |