summaryrefslogtreecommitdiff
path: root/src/theory/quantifiers
diff options
context:
space:
mode:
authorajreynol <andrew.j.reynolds@gmail.com>2017-04-21 09:26:04 -0500
committerajreynol <andrew.j.reynolds@gmail.com>2017-04-21 09:26:19 -0500
commita33dac29d9cc8520f62b6e4f4f9138ea4e3fbcd4 (patch)
treeb92bc3f34aca16a4b4ed6d42b2c2ae909dff17d4 /src/theory/quantifiers
parent8a0d2b0577e174d2078026129dd01ea46f7f984a (diff)
Handle subtypes in sets. Bug fixes for tuples with subtypes.
Diffstat (limited to 'src/theory/quantifiers')
-rw-r--r--src/theory/quantifiers/macros.cpp5
-rw-r--r--src/theory/quantifiers/term_database.cpp14
-rw-r--r--src/theory/quantifiers/term_database.h2
3 files changed, 4 insertions, 17 deletions
diff --git a/src/theory/quantifiers/macros.cpp b/src/theory/quantifiers/macros.cpp
index 96d682a77..636bfdb59 100644
--- a/src/theory/quantifiers/macros.cpp
+++ b/src/theory/quantifiers/macros.cpp
@@ -419,13 +419,16 @@ Node QuantifierMacros::simplify( Node n ){
std::vector< Node > cond;
TypeNode tno = op.getType();
for( unsigned i=0; i<children.size(); i++ ){
- if( !TermDb::getEnsureTypeCondition( children[i], tno[i], cond ) ){
+ Node etc = TypeNode::getEnsureTypeCondition( children[i], tno[i] );
+ if( etc.isNull() ){
//if this does fail, we are incomplete, since we are eliminating quantified formula corresponding to op,
// and not ensuring it applies to n when its types are correct.
//however, this should never fail: we never process types for which we cannot constuct conditions that ensure correct types, e.g. (is-int t).
Assert( false );
success = false;
break;
+ }else if( !etc.isConst() ){
+ cond.push_back( etc );
}
}
if( success ){
diff --git a/src/theory/quantifiers/term_database.cpp b/src/theory/quantifiers/term_database.cpp
index 4f58f7a2e..5ac5ae0cc 100644
--- a/src/theory/quantifiers/term_database.cpp
+++ b/src/theory/quantifiers/term_database.cpp
@@ -1839,20 +1839,6 @@ Node TermDb::ensureType( Node n, TypeNode tn ) {
}
}
-bool TermDb::getEnsureTypeCondition( Node n, TypeNode tn, std::vector< Node >& cond ) {
- TypeNode ntn = n.getType();
- Assert( ntn.isComparableTo( tn ) );
- if( !ntn.isSubtypeOf( tn ) ){
- if( tn.isInteger() ){
- cond.push_back( NodeManager::currentNM()->mkNode( IS_INTEGER, n ) );
- return true;
- }
- return false;
- }else{
- return true;
- }
-}
-
void TermDb::getRelevancyCondition( Node n, std::vector< Node >& cond ) {
if( n.getKind()==APPLY_SELECTOR_TOTAL ){
unsigned scindex = Datatype::cindexOf(n.getOperator().toExpr());
diff --git a/src/theory/quantifiers/term_database.h b/src/theory/quantifiers/term_database.h
index 5b29a72ce..c018172b5 100644
--- a/src/theory/quantifiers/term_database.h
+++ b/src/theory/quantifiers/term_database.h
@@ -473,8 +473,6 @@ public:
bool containsVtsInfinity( Node n, bool isFree = false );
/** ensure type */
static Node ensureType( Node n, TypeNode tn );
- /** get ensure type condition */
- static bool getEnsureTypeCondition( Node n, TypeNode tn, std::vector< Node >& cond );
/** get relevancy condition */
static void getRelevancyCondition( Node n, std::vector< Node >& cond );
private:
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback