Fix cvc5-projects issue 475 (#8278)
authormudathirmahgoub <mudathirmahgoub@gmail.com>
Thu, 10 Mar 2022 18:49:31 +0000 (12:49 -0600)
committerGitHub <noreply@github.com>
Thu, 10 Mar 2022 18:49:31 +0000 (18:49 +0000)
Fixes cvc5/cvc5-projects#475.

src/theory/bags/inference_generator.cpp
test/regress/CMakeLists.txt
test/regress/regress1/bags/murxla4.smt2 [new file with mode: 0644]

index b87296f32fdf5a3f4b2a9700bedbd8d1c732f22a..2aab8473dc6ab17ec3640c733b4a9ad4a1c794dd 100644 (file)
@@ -175,7 +175,7 @@ Node InferenceGenerator::getSkolem(Node& n, InferInfo& inferInfo)
 InferInfo InferenceGenerator::empty(Node n, Node e)
 {
   Assert(n.getKind() == BAG_EMPTY);
-  Assert(e.getType() == n.getType().getBagElementType());
+  Assert(e.getType().isSubtypeOf(n.getType().getBagElementType()));
 
   InferInfo inferInfo(d_im, InferenceId::BAGS_EMPTY);
   Node skolem = getSkolem(n, inferInfo);
index fdbe1ed55c5f2bfff9938c64cb3f02bc0032e5cb..30311558dd0f1312c68183b39924ed8911022a93 100644 (file)
@@ -1752,6 +1752,7 @@ set(regress_1_tests
   regress1/bags/murxla1.smt2
   regress1/bags/murxla2.smt2
   regress1/bags/murxla3.smt2
+  regress1/bags/murxla4.smt2
   regress1/bags/product1.smt2
   regress1/bags/product2.smt2
   regress1/bags/product3.smt2
diff --git a/test/regress/regress1/bags/murxla4.smt2 b/test/regress/regress1/bags/murxla4.smt2
new file mode 100644 (file)
index 0000000..9f2d1b2
--- /dev/null
@@ -0,0 +1,5 @@
+(set-logic ALL)
+(set-info :status sat)
+(declare-const x Int)
+(assert ((_ divisible 2) (bag.count 0.0 (bag 0.0 x))))
+(check-sat)