From: Andrew Reynolds Date: Mon, 1 Nov 2021 23:04:16 +0000 (-0500) Subject: Weaken assertion in CEGQI (#7548) X-Git-Tag: cvc5-1.0.0~913 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b57e39bab5e27b883f01818a401404736c6ce02e;p=cvc5.git Weaken assertion in CEGQI (#7548) The assertion can be violated in mixed Int/Real arithmetic. The instantiator utility nevertheless safe guards Int vs Real subtyping. Fixes #7537. --- diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp index 28314c730..9dc11955b 100644 --- a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp @@ -1076,7 +1076,7 @@ bool CegInstantiator::doAddInstantiation(std::vector& vars, Node n = it->second; Trace("cegqi-inst-debug") << " " << d_input_vars[i] << " -> " << n << std::endl; - Assert(n.getType().isSubtypeOf(d_input_vars[i].getType())); + Assert(n.getType().isComparableTo(d_input_vars[i].getType())); subs.push_back( n ); } } @@ -1088,7 +1088,7 @@ bool CegInstantiator::doAddInstantiation(std::vector& vars, Node v = d_input_vars[i]; Trace("cegqi-inst") << i << " (" << d_curr_iphase[v] << ") : " << v << " -> " << subs[i] << std::endl; - Assert(subs[i].getType().isSubtypeOf(v.getType())); + Assert(subs[i].getType().isComparableTo(v.getType())); } } Trace("cegqi-inst-debug") << "Do the instantiation...." << std::endl; diff --git a/test/regress/CMakeLists.txt b/test/regress/CMakeLists.txt index 67c31240f..7c53e27af 100644 --- a/test/regress/CMakeLists.txt +++ b/test/regress/CMakeLists.txt @@ -1983,6 +1983,7 @@ set(regress_1_tests regress1/quantifiers/issue6775-vts-int.smt2 regress1/quantifiers/issue6845-nl-lemma-tc.smt2 regress1/quantifiers/issue7385-sygus-inst-i.smt2 + regress1/quantifiers/issue7537-cegqi-comp-types.smt2 regress1/quantifiers/issue993.smt2 regress1/quantifiers/javafe.ast.StmtVec.009.smt2 regress1/quantifiers/lia-witness-div-pp.smt2 diff --git a/test/regress/regress1/quantifiers/issue7537-cegqi-comp-types.smt2 b/test/regress/regress1/quantifiers/issue7537-cegqi-comp-types.smt2 new file mode 100644 index 000000000..bc9691ece --- /dev/null +++ b/test/regress/regress1/quantifiers/issue7537-cegqi-comp-types.smt2 @@ -0,0 +1,6 @@ +(set-logic ALL) +(set-info :status sat) +(declare-fun r1 () Real) +(declare-fun r5 () Real) +(assert (forall ((q102 Int)) (or (= q102 (/ r1 r5)) (= (= 0.0 q102) (< 1.0 (/ r1 r5)))))) +(check-sat)