summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>2020-03-11 10:13:24 -0500
committerGitHub <noreply@github.com>2020-03-11 10:13:24 -0500
commit10507bb67177a1e52bdd89535c3c6d77cc62507a (patch)
tree2905771aa934b5c647569286024f8eb4e9c6b4cd
parent2b355305ef635ddfaad7fe75c29221cb2f744a62 (diff)
Fix duplicate variable issue in sygus-qe-preproc (#4013)
-rw-r--r--src/theory/quantifiers/single_inv_partition.cpp2
-rw-r--r--src/theory/quantifiers/single_inv_partition.h2
-rw-r--r--test/regress/CMakeLists.txt1
-rw-r--r--test/regress/regress1/sygus/issue4009-qep.smt27
4 files changed, 10 insertions, 2 deletions
diff --git a/src/theory/quantifiers/single_inv_partition.cpp b/src/theory/quantifiers/single_inv_partition.cpp
index a0e25b756..50831fdac 100644
--- a/src/theory/quantifiers/single_inv_partition.cpp
+++ b/src/theory/quantifiers/single_inv_partition.cpp
@@ -346,7 +346,7 @@ bool SingleInvocationPartition::init(std::vector<Node>& funcs,
d_conjuncts[2].push_back(cr);
std::unordered_set<Node, NodeHashFunction> fvs;
expr::getFreeVariables(cr, fvs);
- d_all_vars.insert(d_all_vars.end(), fvs.begin(), fvs.end());
+ d_all_vars.insert(fvs.begin(), fvs.end());
if (singleInvocation)
{
// replace with single invocation formulation
diff --git a/src/theory/quantifiers/single_inv_partition.h b/src/theory/quantifiers/single_inv_partition.h
index 0a4af3185..cdc56d1f0 100644
--- a/src/theory/quantifiers/single_inv_partition.h
+++ b/src/theory/quantifiers/single_inv_partition.h
@@ -201,7 +201,7 @@ class SingleInvocationPartition
std::vector<Node> d_si_vars;
/** every free variable of conjuncts[2] */
- std::vector<Node> d_all_vars;
+ std::unordered_set<Node, NodeHashFunction> d_all_vars;
/** map from functions to first-order variables that anti-skolemized them */
std::map<Node, Node> d_func_fo_var;
/** map from first-order variables to the function it anti-skolemized */
diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt
index 15728ec1d..83d9ac48c 100644
--- a/test/regress/CMakeLists.txt
+++ b/test/regress/CMakeLists.txt
@@ -1855,6 +1855,7 @@ set(regress_1_tests
regress1/sygus/issue3839-cond-rewrite.smt2
regress1/sygus/issue3944-div-rewrite.smt2
regress1/sygus/issue3947-agg-miniscope.smt2
+ regress1/sygus/issue4009-qep.smt2
regress1/sygus/large-const-simp.sy
regress1/sygus/let-bug-simp.sy
regress1/sygus/list-head-x.sy
diff --git a/test/regress/regress1/sygus/issue4009-qep.smt2 b/test/regress/regress1/sygus/issue4009-qep.smt2
new file mode 100644
index 000000000..6f17a0c04
--- /dev/null
+++ b/test/regress/regress1/sygus/issue4009-qep.smt2
@@ -0,0 +1,7 @@
+; EXPECT: unsat
+; COMMAND-LINE: --sygus-inference --sygus-qe-preproc
+(set-logic ALL)
+(declare-fun a () Real)
+(declare-fun b () Real)
+(assert (forall ((c Real)) (and (xor (> c a) (= b 0)) (distinct (+ a b) 0))))
+(check-sat)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback