summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorajreynol <andrew.j.reynolds@gmail.com>2017-04-28 15:48:13 -0500
committerajreynol <andrew.j.reynolds@gmail.com>2017-04-28 15:48:13 -0500
commit4a4b05fa4bc52a53a33b8eaa542c3a5e1d603b94 (patch)
treef83d2c423dbd3e72f195ae23bf958c12ddd34c0a
parent24385c4c5f9c17610f10ed2f8d44c10a16c1567f (diff)
Fix bug for real division.
-rw-r--r--src/theory/arith/theory_arith_private.cpp8
-rw-r--r--test/regress/regress0/nl/Makefile.am3
-rw-r--r--test/regress/regress0/nl/real-div-ufnra.smt213
3 files changed, 19 insertions, 5 deletions
diff --git a/src/theory/arith/theory_arith_private.cpp b/src/theory/arith/theory_arith_private.cpp
index 4f62f4451..f40e7204a 100644
--- a/src/theory/arith/theory_arith_private.cpp
+++ b/src/theory/arith/theory_arith_private.cpp
@@ -238,8 +238,8 @@ static Node getSkolemConstrainedToDivisionTotal(
if(total_div_node.getAttribute(LinearIntDivAttr(), total_div_skolem)) {
return total_div_skolem;
}
- total_div_skolem = nm->mkSkolem("DivisionTotalSkolem", nm->integerType(),
- "the result of an intdiv-by-k term");
+ total_div_skolem = nm->mkSkolem("DivisionTotalSkolem", nm->realType(),
+ "the result of a div term");
total_div_node.setAttribute(LinearIntDivAttr(), total_div_skolem);
Node zero = mkRationalNode(0);
Node lemma = den.eqNode(zero).iteNode(
@@ -258,8 +258,8 @@ static Node getSkolemConstrainedToDivision(
if(div_node.getAttribute(LinearIntDivAttr(), div_skolem)) {
return div_skolem;
}
- div_skolem = nm->mkSkolem("DivisionSkolem", nm->integerType(),
- "the result of an intdiv-by-k term");
+ div_skolem = nm->mkSkolem("DivisionSkolem", nm->realType(),
+ "the result of a div term");
div_node.setAttribute(LinearIntDivAttr(), div_skolem);
Node div0 = nm->mkNode(APPLY_UF, div0Func, num);
Node total_div = getSkolemConstrainedToDivisionTotal(num, den, out);
diff --git a/test/regress/regress0/nl/Makefile.am b/test/regress/regress0/nl/Makefile.am
index 13f561130..4e350c9c8 100644
--- a/test/regress/regress0/nl/Makefile.am
+++ b/test/regress/regress0/nl/Makefile.am
@@ -46,7 +46,8 @@ TESTS = \
metitarski-3-4.smt2 \
rewriting-sums.smt2 \
disj-eval.smt2 \
- bug698.smt2
+ bug698.smt2 \
+ real-div-ufnra.smt2
# unsolved : garbage_collect.cvc
diff --git a/test/regress/regress0/nl/real-div-ufnra.smt2 b/test/regress/regress0/nl/real-div-ufnra.smt2
new file mode 100644
index 000000000..5e3b32c40
--- /dev/null
+++ b/test/regress/regress0/nl/real-div-ufnra.smt2
@@ -0,0 +1,13 @@
+; COMMAND-LINE: --nl-ext --simplification=none
+; EXPECT: sat
+(set-logic QF_UFNRA)
+(set-info :status unsat)
+(declare-fun x () Real)
+(declare-fun y () Real)
+(declare-fun f (Real) Real)
+
+(assert (= (f x) 0.2))
+(assert (= (f y) 0.4))
+(assert (= (/ (f x) (f y)) 0.5))
+
+(check-sat)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback