summaryrefslogtreecommitdiff
path: root/src/theory/theory.cpp
diff options
context:
space:
mode:
authorajreynol <andrew.j.reynolds@gmail.com>2017-03-02 14:45:21 -0600
committerajreynol <andrew.j.reynolds@gmail.com>2017-03-02 14:45:21 -0600
commit1f4b954a2cc7667a56a3007fa75c125fba93ed23 (patch)
treeea8734e89aa5fba170781c7148d3fd886c597d4e /src/theory/theory.cpp
parent21b0cedd7dadd96e5d256885e3b65a926a7e4a81 (diff)
Eliminate Boolean term conversion. Generalizes removeITE pass to remove Boolean terms, treats distinguished BOOLEAN_TERM_VARIABLE kind as theory literal. Fixes bugs 597, 604, 651, 652, 691, 694. Add regressions.
Diffstat (limited to 'src/theory/theory.cpp')
-rw-r--r--src/theory/theory.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/theory/theory.cpp b/src/theory/theory.cpp
index 2d8ea9fa8..340ab2373 100644
--- a/src/theory/theory.cpp
+++ b/src/theory/theory.cpp
@@ -88,7 +88,13 @@ TheoryId Theory::theoryOf(TheoryOfMode mode, TNode node) {
switch(mode) {
case THEORY_OF_TYPE_BASED:
// Constants, variables, 0-ary constructors
- if (node.isVar() || node.isConst()) {
+ if (node.isVar()) {
+ if( node.getKind() == kind::BOOLEAN_TERM_VARIABLE ){
+ tid = THEORY_UF;
+ }else{
+ tid = Theory::theoryOf(node.getType());
+ }
+ }else if (node.isConst()) {
tid = Theory::theoryOf(node.getType());
} else if (node.getKind() == kind::EQUAL) {
// Equality is owned by the theory that owns the domain
@@ -105,8 +111,13 @@ TheoryId Theory::theoryOf(TheoryOfMode mode, TNode node) {
// We treat the variables as uninterpreted
tid = s_uninterpretedSortOwner;
} else {
- // Except for the Boolean ones, which we just ignore anyhow
- tid = theory::THEORY_BOOL;
+ if( node.getKind() == kind::BOOLEAN_TERM_VARIABLE ){
+ //Boolean vars go to UF
+ tid = THEORY_UF;
+ }else{
+ // Except for the Boolean ones
+ tid = THEORY_BOOL;
+ }
}
} else if (node.isConst()) {
// Constants go to the theory of the type
@@ -408,7 +419,7 @@ bool ExtTheory::doInferencesInternal( int effort, std::vector< Node >& terms, st
nred.push_back( n );
}else{
if( !nr.isNull() && n!=nr ){
- Node lem = NodeManager::currentNM()->mkNode( n.getType().isBoolean() ? kind::IFF : kind::EQUAL, n, nr );
+ Node lem = NodeManager::currentNM()->mkNode( kind::EQUAL, n, nr );
if( sendLemma( lem, true ) ){
Trace("extt-lemma") << "ExtTheory : Reduction lemma : " << lem << std::endl;
addedLemma = true;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback