Add unit test involving seq concat term (#8257)
authorAndrew Reynolds <andrew.j.reynolds@gmail.com>
Tue, 15 Mar 2022 21:42:39 +0000 (16:42 -0500)
committerGitHub <noreply@github.com>
Tue, 15 Mar 2022 21:42:39 +0000 (21:42 +0000)
On closer inspection, the initial version of the unit test has a type error, where an incorrect concatentation term is constructed.

Adds the updated test. Fixes cvc5/cvc5-projects#423.

test/unit/api/cpp/solver_black.cpp

index b07b3eaa745913cdc6a9d417920ae4dfbe37b2f8..9545c4fb08960911448a0848ef689c99986ec697 100644 (file)
@@ -3146,6 +3146,25 @@ TEST_F(TestApiBlackSolver, proj_issue422)
   slv.push(4);
 }
 
+TEST_F(TestApiBlackSolver, proj_issue423)
+{
+  Solver slv;
+  slv.setOption("produce-models", "true");
+  slv.setOption("produce-difficulty", "true");
+  Sort s2 = slv.getRealSort();
+  Sort s3 = slv.mkSequenceSort(s2);
+  Term t2;
+  {
+    t2 = slv.mkEmptySequence(s3.getSequenceElementSort());
+  }
+  Term t22 = slv.mkReal("119605652059157009");
+  Term t32 = slv.mkTerm(Kind::SEQ_UNIT, {t22});
+  Term t43 = slv.mkTerm(Kind::SEQ_CONCAT, {t2, t32});
+  Term t51 = slv.mkTerm(Kind::DISTINCT, {t32, t32});
+  slv.checkSat();
+  slv.blockModelValues({t51, t43});
+}
+
 TEST_F(TestApiBlackSolver, projIssue431)
 {
   Solver slv;