/////////////////////////////////////////////////////////////////////////////
-void TheoryArrays::collectTerms(TNode n, set<Node>& termSet)
-{
- if (termSet.find(n) != termSet.end()) {
- return;
- }
- termSet.insert(n);
- if (n.getType().isBoolean() || !isLeaf(n)) {
- for(TNode::iterator child_it = n.begin(); child_it != n.end(); ++child_it) {
- collectTerms(*child_it, termSet);
- }
- }
-}
-
-
void TheoryArrays::collectModelInfo( TheoryModel* m, bool fullModel )
{
set<Node> termSet;
- set<Node> cache;
- // Collect all terms appearing in assertions
- context::CDList<Assertion>::const_iterator assert_it = facts_begin(), assert_it_end = facts_end();
- for (; assert_it != assert_it_end; ++assert_it) {
- collectTerms(*assert_it, termSet);
- }
-
- // Add terms that are shared terms
- context::CDList<TNode>::const_iterator shared_it = shared_terms_begin(), shared_it_end = shared_terms_end();
- for (; shared_it != shared_it_end; ++shared_it) {
- collectTerms(*shared_it, termSet);
- }
+ computeRelevantTerms(termSet);
// Add selects that were generated internally
context::CDHashSet<TNode, TNodeHashFunction>::iterator internal_it = d_readsInternal.begin(), internal_it_end = d_readsInternal.end();
/////////////////////////////////////////////////////////////////////////////
private:
- /** Helper function for collectModelInfo */
- void collectTerms(TNode n, std::set<Node>& termSet);
public:
<< *it << ")\n";
}
}
- m->assertEqualityEngine(&d_equalityEngine);
+ set<Node> termSet;
+ d_bv->computeRelevantTerms(termSet);
+ m->assertEqualityEngine(&d_equalityEngine, &termSet);
}
return currentlyShared;
}
+
+void Theory::collectTerms(TNode n, set<Node>& termSet)
+{
+ if (termSet.find(n) != termSet.end()) {
+ return;
+ }
+ termSet.insert(n);
+ if (n.getKind() == kind::NOT || n.getKind() == kind::EQUAL || !isLeaf(n)) {
+ for(TNode::iterator child_it = n.begin(); child_it != n.end(); ++child_it) {
+ collectTerms(*child_it, termSet);
+ }
+ }
+}
+
+
+void Theory::computeRelevantTerms(set<Node>& termSet)
+{
+ // Collect all terms appearing in assertions
+ context::CDList<Assertion>::const_iterator assert_it = facts_begin(), assert_it_end = facts_end();
+ for (; assert_it != assert_it_end; ++assert_it) {
+ collectTerms(*assert_it, termSet);
+ }
+
+ // Add terms that are shared terms
+ context::CDList<TNode>::const_iterator shared_it = shared_terms_begin(), shared_it_end = shared_terms_end();
+ for (; shared_it != shared_it_end; ++shared_it) {
+ collectTerms(*shared_it, termSet);
+ }
+}
+
+
}/* CVC4::theory namespace */
}/* CVC4 namespace */
*/
context::CDList<TNode> d_sharedTerms;
+ /**
+ * Helper function for computeRelevantTerms
+ */
+ void collectTerms(TNode n, std::set<Node>& termSet);
+ /**
+ * Scans the current set of assertions and shared terms top-down until a theory-leaf is reached, and adds all terms found to termSet.
+ * This is used by collectModelInfo to delimit the set of terms that should be used when constructing a model
+ */
+ void computeRelevantTerms(std::set<Node>& termSet);
+
/**
* Construct a Theory.
*/
void TheoryEngine::collectModelInfo( theory::TheoryModel* m, bool fullModel ){
//have shared term engine collectModelInfo
- d_sharedTerms.collectModelInfo( m, fullModel );
+ // d_sharedTerms.collectModelInfo( m, fullModel );
// Consult each active theory to get all relevant information
// concerning the model.
for(TheoryId theoryId = theory::THEORY_FIRST; theoryId < theory::THEORY_LAST; ++theoryId) {
fuzz11.smt \
fuzz12.smt \
fuzz13.smt \
+ fuzz14.smt \
fifo32bc06k08.delta01.smt \
rewrite_bug.smt \
array_rewrite_bug.smt
--- /dev/null
+(benchmark fuzzsmt
+:logic QF_AUFBV
+:status sat
+:extrafuns ((v0 BitVec[6]))
+:extrafuns ((v1 BitVec[2]))
+:extrafuns ((v2 BitVec[13]))
+:extrafuns ((v3 BitVec[9]))
+:extrafuns ((a4 Array[5:15]))
+:formula
+(let (?e5 bv2[3])
+(let (?e6 (bvand v3 v3))
+(let (?e7 (bvxor (sign_extend[7] v1) ?e6))
+(let (?e8 (bvashr (zero_extend[7] v0) v2))
+(let (?e9 (sign_extend[2] ?e5))
+(let (?e10 (store a4 (extract[4:0] ?e8) (sign_extend[12] ?e5)))
+(let (?e11 (store ?e10 (zero_extend[3] v1) (sign_extend[6] ?e6)))
+(let (?e12 (store a4 (extract[4:0] ?e7) (sign_extend[6] ?e6)))
+(let (?e13 (select ?e10 (zero_extend[2] ?e5)))
+(let (?e14 (store ?e10 (sign_extend[3] v1) (zero_extend[10] ?e9)))
+(let (?e15 (store ?e11 (sign_extend[3] v1) (sign_extend[6] v3)))
+(let (?e16 (ite (bvsge (zero_extend[7] v1) ?e6) bv1[1] bv0[1]))
+(let (?e17 (bvcomp ?e8 (sign_extend[4] ?e7)))
+(let (?e18 (ite (= bv1[1] (extract[4:4] ?e6)) (zero_extend[2] v2) ?e13))
+(let (?e19 (ite (bvuge ?e8 ?e8) bv1[1] bv0[1]))
+(let (?e20 (repeat[1] ?e9))
+(let (?e21 (bvor (zero_extend[6] ?e5) ?e6))
+(let (?e22 (bvnot v3))
+(let (?e23 (bvnand v0 (sign_extend[1] ?e20)))
+(flet ($e24 (bvsge v2 (sign_extend[7] ?e23)))
+(flet ($e25 (bvsgt (sign_extend[6] v3) ?e13))
+(flet ($e26 (distinct (zero_extend[2] ?e16) ?e5))
+(flet ($e27 (= v1 (sign_extend[1] ?e17)))
+(flet ($e28 (bvule ?e8 (zero_extend[4] ?e6)))
+(flet ($e29 (bvule (sign_extend[4] ?e7) ?e8))
+(flet ($e30 (bvslt (sign_extend[12] ?e16) ?e8))
+(flet ($e31 (bvsgt ?e6 ?e6))
+(flet ($e32 (bvsgt ?e18 (zero_extend[14] ?e19)))
+(flet ($e33 (bvult (zero_extend[3] v1) ?e20))
+(flet ($e34 (distinct v3 (sign_extend[4] ?e9)))
+(flet ($e35 (bvule ?e22 (sign_extend[8] ?e17)))
+(flet ($e36 (bvule (zero_extend[2] v2) ?e13))
+(flet ($e37 (bvuge ?e18 (sign_extend[9] ?e23)))
+(flet ($e38 (= (sign_extend[10] ?e5) v2))
+(flet ($e39 (= ?e13 (zero_extend[2] v2)))
+(flet ($e40 (bvslt (sign_extend[8] ?e19) ?e21))
+(flet ($e41 (bvule (sign_extend[5] ?e19) v0))
+(flet ($e42 (if_then_else $e31 $e25 $e27))
+(flet ($e43 (implies $e26 $e41))
+(flet ($e44 (or $e29 $e38))
+(flet ($e45 (or $e42 $e28))
+(flet ($e46 (xor $e30 $e35))
+(flet ($e47 (not $e46))
+(flet ($e48 (if_then_else $e37 $e39 $e33))
+(flet ($e49 (or $e32 $e47))
+(flet ($e50 (xor $e43 $e34))
+(flet ($e51 (not $e44))
+(flet ($e52 (xor $e51 $e48))
+(flet ($e53 (and $e24 $e36))
+(flet ($e54 (or $e53 $e49))
+(flet ($e55 (if_then_else $e45 $e45 $e54))
+(flet ($e56 (if_then_else $e52 $e40 $e50))
+(flet ($e57 (not $e56))
+(flet ($e58 (and $e55 $e55))
+(flet ($e59 (or $e58 $e57))
+$e59
+))))))))))))))))))))))))))))))))))))))))))))))))))))))))
+