From: Andrew Reynolds Date: Wed, 11 Mar 2020 00:17:40 +0000 (-0500) Subject: Fix real to int for parameterized kinds (#4016) X-Git-Tag: cvc5-1.0.0~3520 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a2619c8c14e138b0ce4fdfe59e06dbcde2f61c7;p=cvc5.git Fix real to int for parameterized kinds (#4016) --- diff --git a/src/preprocessing/passes/real_to_int.cpp b/src/preprocessing/passes/real_to_int.cpp index cc98726c6..f50cecd1b 100644 --- a/src/preprocessing/passes/real_to_int.cpp +++ b/src/preprocessing/passes/real_to_int.cpp @@ -151,6 +151,10 @@ Node RealToInt::realToIntInternal(TNode n, NodeMap& cache, std::vector& va } if (childChanged) { + if (n.getMetaKind() == kind::metakind::PARAMETERIZED) + { + children.insert(children.begin(), n.getOperator()); + } ret = NodeManager::currentNM()->mkNode(n.getKind(), children); } } diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index 1ca43b2fe..62c9c87b1 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -579,6 +579,7 @@ set(regress_0_tests regress0/nl/issue3719.smt2 regress0/nl/issue3729-cm-solved-tf.smt2 regress0/nl/issue3959.smt2 + regress0/nl/issue4007-rint-uf.smt2 regress0/nl/magnitude-wrong-1020-m.smt2 regress0/nl/mult-po.smt2 regress0/nl/nia-wrong-tl.smt2 diff --git a/test/regress/regress0/nl/issue4007-rint-uf.smt2 b/test/regress/regress0/nl/issue4007-rint-uf.smt2 new file mode 100644 index 000000000..9d9a7525a --- /dev/null +++ b/test/regress/regress0/nl/issue4007-rint-uf.smt2 @@ -0,0 +1,8 @@ +; COMMAND-LINE: --solve-real-as-int +; EXPECT: sat +(set-logic QF_UFNIRA) +(set-info :status sat) +(declare-fun f (Real) Int) +(declare-fun a () Real) +(assert (= (f a) 0)) +(check-sat)