Fix spurious assertion involving subtypes (#8611)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Thu, 14 Apr 2022 13:16:49 +0000 (08:16 -0500)
committerGitHub <noreply@github.com>
Thu, 14 Apr 2022 13:16:49 +0000 (13:16 +0000)
Fixes #8609.

src/theory/quantifiers/cegqi/ceg_instantiator.cpp
test/regress/cli/CMakeLists.txt
test/regress/cli/regress0/quantifiers/issue8609-subtype-assert.smt2 [new file with mode: 0644]

index f09faf22fd93d18431bceb8e51a65733a66b6ce8..dbb6c6acc850d2f92aeecd6a0a020817c45044ef 100644 (file)
@@ -1234,7 +1234,7 @@ Node CegInstantiator::applySubstitution( TypeNode tn, Node n, std::vector< Node
             Node v = msum_term[it->first];
             if (!v.isNull())
             {
-              Assert(v.getType() == type);
+              Assert(v.getType().isComparableTo(type));
               c = nm->mkNode(MULT, c, v);
             }
             children.push_back( c );
index 99ca3b969c759e36fe9db6a96835e894132e37d5..dbdd97c83f7bcd1c9458213e02a867e0b30aa4f0 100644 (file)
@@ -1061,6 +1061,7 @@ set(regress_0_tests
   regress0/quantifiers/issue8159-3-qext-nterm.smt2
   regress0/quantifiers/issue8227-subs-shadow.smt2
   regress0/quantifiers/issue8466-syqi-bool.smt2
+  regress0/quantifiers/issue8609-subtype-assert.smt2
   regress0/quantifiers/lra-triv-gn.smt2
   regress0/quantifiers/macro-back-subs-sat.smt2
   regress0/quantifiers/macros-int-real.smt2
diff --git a/test/regress/cli/regress0/quantifiers/issue8609-subtype-assert.smt2 b/test/regress/cli/regress0/quantifiers/issue8609-subtype-assert.smt2
new file mode 100644 (file)
index 0000000..a85afb0
--- /dev/null
@@ -0,0 +1,4 @@
+(set-logic ALL)
+(set-info :status unsat)
+(assert (forall ((r Int) (r9 Int)) (= 1.0 (/ (to_real r) (+ 0.5 (to_real r9))))))
+(check-sat)