Add examples/bags.cpp (#8463)
authormudathirmahgoub <mudathirmahgoub@gmail.com>
Thu, 31 Mar 2022 15:17:22 +0000 (10:17 -0500)
committerGitHub <noreply@github.com>
Thu, 31 Mar 2022 15:17:22 +0000 (15:17 +0000)
16 files changed:
docs/examples/bags.rst [new file with mode: 0644]
docs/examples/examples.rst
docs/theories/bags.rst
examples/api/cpp/CMakeLists.txt
examples/api/cpp/bags.cpp [new file with mode: 0644]
examples/api/java/Bags.java [new file with mode: 0644]
examples/api/java/BitVectors.java
examples/api/java/CMakeLists.txt
examples/api/java/Combination.java
examples/api/java/HelloWorld.java
examples/api/java/LinearArith.java
examples/api/java/Relations.java
examples/api/java/Sets.java
examples/api/java/Utils.java
examples/api/python/CMakeLists.txt
examples/api/python/bags.py [new file with mode: 0644]

diff --git a/docs/examples/bags.rst b/docs/examples/bags.rst
new file mode 100644 (file)
index 0000000..ae3b267
--- /dev/null
@@ -0,0 +1,9 @@
+Theory of Bags
+=================
+
+
+.. api-examples::
+    <examples>/api/cpp/bags.cpp
+    <examples>/api/java/Bags.java
+    <examples>/api/python/bags.py
+    <examples>/api/smtlib/bags.smt2
index b9303f1d9f1f29e8d6e044bd3ba8959d2f5d3b8d..9812027ed38f4fcb90fe5b0d0954b5eed797a1df 100644 (file)
@@ -11,6 +11,7 @@ input mechanisms.
 
     helloworld
     exceptions
+    bags
     bitvectors
     bitvectors_and_arrays
     extract
index d3e32fb28633628d4c1d4c1f8d69c2c2fe896742..d29d3905efd5a29f115fa44391ab071521b64ecc 100644 (file)
@@ -82,5 +82,8 @@ The semantics of supported bag operators is given in the table below.
 Below is a more extensive example on how to use finite bags:
 
 .. api-examples::
+    <examples>/api/cpp/bags.cpp
+    <examples>/api/cpp/Bags.java
+    <examples>/api/cpp/bags.py
     <examples>/api/smtlib/bags.smt2
 
index 6d462da5d177e0e2a7d0d19decabf8f76922eba7..02496fe8f9b1492afaedf0d93f6f335489118530 100644 (file)
@@ -14,6 +14,7 @@
 ##
 
 set(CVC5_EXAMPLES_API
+  bags
   bitvectors
   bitvectors_and_arrays
   combination
diff --git a/examples/api/cpp/bags.cpp b/examples/api/cpp/bags.cpp
new file mode 100644 (file)
index 0000000..6df2bc4
--- /dev/null
@@ -0,0 +1,105 @@
+/******************************************************************************
+ * Top contributors (to current version):
+ *   Mudathir Mohamed
+ *
+ * This file is part of the cvc5 project.
+ * Copyright (c) 2009-2022 by the authors listed in the file AUTHORS
+ * in the top-level source directory and their institutional affiliations.
+ * All rights reserved.  See the file COPYING in the top-level source
+ * directory for licensing information.
+ * ****************************************************************************
+ *
+ * A simple demonstration of reasoning about bags.
+ */
+
+#include <cvc5/cvc5.h>
+
+#include <iostream>
+
+using namespace std;
+using namespace cvc5;
+
+int main()
+{
+  Solver slv;
+  slv.setLogic("ALL");
+  // Produce models
+  slv.setOption("produce-models", "true");
+  slv.setOption("incremental", "true");
+
+  Sort bag = slv.mkBagSort(slv.getStringSort());
+  Term A = slv.mkConst(bag, "A");
+  Term B = slv.mkConst(bag, "B");
+  Term C = slv.mkConst(bag, "C");
+  Term x = slv.mkConst(slv.getStringSort(), "x");
+
+  Term intersectionAC = slv.mkTerm(BAG_INTER_MIN, {A, C});
+  Term intersectionBC = slv.mkTerm(BAG_INTER_MIN, {B, C});
+
+  // union disjoint does not distribute over intersection
+  {
+    Term unionDisjointAB = slv.mkTerm(BAG_UNION_DISJOINT, {A, B});
+    Term lhs = slv.mkTerm(BAG_INTER_MIN, {unionDisjointAB, C});
+    Term rhs = slv.mkTerm(BAG_UNION_DISJOINT, {intersectionAC, intersectionBC});
+    Term guess = slv.mkTerm(EQUAL, {lhs, rhs});
+    cout << "cvc5 reports: " << guess.notTerm() << " is "
+         << slv.checkSatAssuming(guess.notTerm()) << "." << endl;
+
+    cout << A << ": " << slv.getValue(A) << endl;
+    cout << B << ": " << slv.getValue(B) << endl;
+    cout << C << ": " << slv.getValue(C) << endl;
+    cout << lhs << ": " << slv.getValue(lhs) << endl;
+    cout << rhs << ": " << slv.getValue(rhs) << endl;
+  }
+
+  // union max distributes over intersection
+  {
+    Term unionMaxAB = slv.mkTerm(BAG_UNION_MAX, {A, B});
+    Term lhs = slv.mkTerm(BAG_INTER_MIN, {unionMaxAB, C});
+    Term rhs = slv.mkTerm(BAG_UNION_MAX, {intersectionAC, intersectionBC});
+    Term theorem = slv.mkTerm(EQUAL, {lhs, rhs});
+    cout << "cvc5 reports: " << theorem.notTerm() << " is "
+         << slv.checkSatAssuming(theorem.notTerm()) << "." << endl;
+  }
+
+  // Verify emptbag is a subbag of any bag
+  {
+    Term emptybag = slv.mkEmptyBag(bag);
+    Term theorem = slv.mkTerm(BAG_SUBBAG, {emptybag, A});
+
+    cout << "cvc5 reports: " << theorem.notTerm() << " is "
+         << slv.checkSatAssuming(theorem.notTerm()) << "." << endl;
+  }
+
+  // find an element with multiplicity 4 in the disjoint union of
+  // ; {|"a", "a", "b", "b", "b"|} and {|"b", "c", "c"|}
+
+  {
+    Term one = slv.mkInteger(1);
+    Term two = slv.mkInteger(2);
+    Term three = slv.mkInteger(3);
+    Term four = slv.mkInteger(4);
+    Term a = slv.mkString("a");
+    Term b = slv.mkString("b");
+    Term c = slv.mkString("c");
+
+    Term bag_a_2 = slv.mkTerm(BAG_MAKE, {a, two});
+    Term bag_b_3 = slv.mkTerm(BAG_MAKE, {b, three});
+    Term bag_b_1 = slv.mkTerm(BAG_MAKE, {b, one});
+    Term bag_c_2 = slv.mkTerm(BAG_MAKE, {c, two});
+    Term bag_a_2_b_3 = slv.mkTerm(BAG_UNION_DISJOINT, {bag_a_2, bag_b_3});
+    Term bag_b_1_c_2 = slv.mkTerm(BAG_UNION_DISJOINT, {bag_b_1, bag_c_2});
+    Term union_disjoint =
+        slv.mkTerm(BAG_UNION_DISJOINT, {bag_a_2_b_3, bag_b_1_c_2});
+
+    Term count_x = slv.mkTerm(BAG_COUNT, {x, union_disjoint});
+    Term e = slv.mkTerm(EQUAL, {four, count_x});
+    Result result = slv.checkSatAssuming(e);
+
+    cout << "cvc5 reports: " << e << " is " << result << "." << endl;
+    if (result.isSat())
+    {
+      cout << x << ": " << slv.getValue(x) << endl;
+    }
+  }
+}
diff --git a/examples/api/java/Bags.java b/examples/api/java/Bags.java
new file mode 100644 (file)
index 0000000..f1c74ca
--- /dev/null
@@ -0,0 +1,112 @@
+/******************************************************************************
+ * Top contributors (to current version):
+ *   Mudathir Mohamed
+ *
+ * This file is part of the cvc5 project.
+ *
+ * Copyright (c) 2009-2022 by the authors listed in the file AUTHORS
+ * in the top-level source directory and their institutional affiliations.
+ * All rights reserved.  See the file COPYING in the top-level source
+ * directory for licensing information.
+ * ****************************************************************************
+ *
+ * A simple demonstration of reasoning about bags with cvc5.
+ */
+
+import static io.github.cvc5.Kind.*;
+
+import io.github.cvc5.*;
+
+public class Bags
+{
+  public static void main(String args[]) throws CVC5ApiException
+
+  {
+    try (Solver slv = new Solver())
+    {
+      slv.setLogic("ALL");
+
+      // Produce models
+      slv.setOption("produce-models", "true");
+      slv.setOption("incremental", "true");
+
+      Sort bag = slv.mkBagSort(slv.getStringSort());
+      Term A = slv.mkConst(bag, "A");
+      Term B = slv.mkConst(bag, "B");
+      Term C = slv.mkConst(bag, "C");
+      Term x = slv.mkConst(slv.getStringSort(), "x");
+
+      Term intersectionAC = slv.mkTerm(BAG_INTER_MIN, new Term[] {A, C});
+      Term intersectionBC = slv.mkTerm(BAG_INTER_MIN, new Term[] {B, C});
+
+      // union disjoint does not distribute over intersection
+      {
+        Term unionDisjointAB = slv.mkTerm(BAG_UNION_DISJOINT, new Term[] {A, B});
+        Term lhs = slv.mkTerm(BAG_INTER_MIN, new Term[] {unionDisjointAB, C});
+        Term rhs = slv.mkTerm(BAG_UNION_DISJOINT, new Term[] {intersectionAC, intersectionBC});
+        Term guess = slv.mkTerm(EQUAL, new Term[] {lhs, rhs});
+
+        System.out.println("cvc5 reports: " + guess.notTerm() + " is "
+            + slv.checkSatAssuming(guess.notTerm()) + ".");
+
+        System.out.println(A + ": " + slv.getValue(A));
+        System.out.println(B + ": " + slv.getValue(B));
+        System.out.println(C + ": " + slv.getValue(C));
+        System.out.println(lhs + ": " + slv.getValue(lhs));
+        System.out.println(rhs + ": " + slv.getValue(rhs));
+      }
+
+      // union max distributes over intersection
+      {
+        Term unionMaxAB = slv.mkTerm(BAG_UNION_MAX, new Term[] {A, B});
+        Term lhs = slv.mkTerm(BAG_INTER_MIN, new Term[] {unionMaxAB, C});
+        Term rhs = slv.mkTerm(BAG_UNION_MAX, new Term[] {intersectionAC, intersectionBC});
+        Term theorem = slv.mkTerm(EQUAL, new Term[] {lhs, rhs});
+        System.out.println("cvc5 reports: " + theorem.notTerm() + " is "
+            + slv.checkSatAssuming(theorem.notTerm()) + ".");
+      }
+
+      // Verify emptbag is a subbag of any bag
+      {
+        Term emptybag = slv.mkEmptyBag(bag);
+        Term theorem = slv.mkTerm(BAG_SUBBAG, new Term[] {emptybag, A});
+
+        System.out.println("cvc5 reports: " + theorem.notTerm() + " is "
+            + slv.checkSatAssuming(theorem.notTerm()) + ".");
+      }
+
+      // find an element with multiplicity 4 in the disjoint union of
+      // ; {|"a", "a", "b", "b", "b"|} and {|"b", "c", "c"|}
+      {
+        Term one = slv.mkInteger(1);
+        Term two = slv.mkInteger(2);
+        Term three = slv.mkInteger(3);
+        Term four = slv.mkInteger(4);
+        Term a = slv.mkString("a");
+        Term b = slv.mkString("b");
+        Term c = slv.mkString("c");
+
+        Term bag_a_2 = slv.mkTerm(BAG_MAKE, new Term[] {a, two});
+        Term bag_b_3 = slv.mkTerm(BAG_MAKE, new Term[] {b, three});
+        Term bag_b_1 = slv.mkTerm(BAG_MAKE, new Term[] {b, one});
+        Term bag_c_2 = slv.mkTerm(BAG_MAKE, new Term[] {c, two});
+
+        Term bag_a_2_b_3 = slv.mkTerm(BAG_UNION_DISJOINT, new Term[] {bag_a_2, bag_b_3});
+
+        Term bag_b_1_c_2 = slv.mkTerm(BAG_UNION_DISJOINT, new Term[] {bag_b_1, bag_c_2});
+
+        Term union_disjoint = slv.mkTerm(BAG_UNION_DISJOINT, new Term[] {bag_a_2_b_3, bag_b_1_c_2});
+
+        Term count_x = slv.mkTerm(BAG_COUNT, new Term[] {x, union_disjoint});
+        Term e = slv.mkTerm(EQUAL, new Term[] {four, count_x});
+        Result result = slv.checkSatAssuming(e);
+
+        System.out.println("cvc5 reports: " + e + " is " + result + ".");
+        if (result.isSat())
+        {
+          System.out.println(x + ": " + slv.getValue(x));
+        }
+      }
+    }
+  }
+}
\ No newline at end of file
index 2abbc35fe28f10cc922af45f57fce2cb0f6875f8..72aaadc4b702b0254383549ea314c35cc25b5fbd 100644 (file)
@@ -88,8 +88,7 @@ public class BitVectors
 
       System.out.println(" Check sat assuming: " + new_x_eq_new_x_.notTerm());
       System.out.println(" Expect UNSAT. ");
-      System.out.println(
-          " cvc5: " + slv.checkSatAssuming(new_x_eq_new_x_.notTerm()));
+      System.out.println(" cvc5: " + slv.checkSatAssuming(new_x_eq_new_x_.notTerm()));
       System.out.println(" Popping context. ");
       slv.pop();
 
@@ -105,8 +104,7 @@ public class BitVectors
 
       System.out.println(" Check sat assuming: " + new_x_eq_new_x_.notTerm());
       System.out.println(" Expect UNSAT. ");
-      System.out.println(
-          " cvc5: " + slv.checkSatAssuming(new_x_eq_new_x_.notTerm()));
+      System.out.println(" cvc5: " + slv.checkSatAssuming(new_x_eq_new_x_.notTerm()));
 
       Term x_neq_x = slv.mkTerm(Kind.EQUAL, x, x).notTerm();
       Term[] v = new Term[] {new_x_eq_new_x_, x_neq_x};
index bd4eb179a605350682a621deca3c31134648fdba..159d0e92878530ec62b3c6f989a8ebbccc3cf6ed 100644 (file)
@@ -14,6 +14,7 @@
 ##
 
 set(EXAMPLES_API_JAVA
+   Bags
    BitVectors
    BitVectorsAndArrays
    Combination
index 60a9e803bd52c712f94addbcea2c84718e6e4294..0754fd707b9ec0d993e9ba18a3de29723d1876c1 100644 (file)
@@ -86,8 +86,7 @@ public class Combination
       System.out.println("Given the following assertions:\n" + assertions + "\n");
 
       System.out.println("Prove x /= y is entailed. \n"
-          + "cvc5: " + slv.checkSatAssuming(slv.mkTerm(Kind.EQUAL, x, y))
-          + ".\n");
+          + "cvc5: " + slv.checkSatAssuming(slv.mkTerm(Kind.EQUAL, x, y)) + ".\n");
 
       System.out.println("Call checkSat to show that the assertions are satisfiable. \n"
           + "cvc5: " + slv.checkSat() + ".\n");
index 7cef12966e4db7a3ae3322e8beadf1a6d824ce37..1b4499950455262f5803119107e211204fc62a6f 100644 (file)
@@ -23,8 +23,7 @@ public class HelloWorld
     {
       Term helloworld = slv.mkConst(slv.getBooleanSort(), "Hello World!");
 
-      System.out.println(
-          helloworld + " is " + slv.checkSatAssuming(helloworld));
+      System.out.println(helloworld + " is " + slv.checkSatAssuming(helloworld));
     }
   }
 }
index 7ba565ff38a445afc4976f58ce258b98caa19796..fe9d6b4b7e400e0e5dc51822170d58b517c34425 100644 (file)
@@ -57,8 +57,8 @@ public class LinearArith
       Term diff_leq_two_thirds = slv.mkTerm(Kind.LEQ, diff, two_thirds);
       System.out.println("Prove that " + diff_leq_two_thirds + " with cvc5.");
       System.out.println("cvc5 should report UNSAT.");
-      System.out.println("Result from cvc5 is: "
-          + slv.checkSatAssuming(diff_leq_two_thirds.notTerm()));
+      System.out.println(
+          "Result from cvc5 is: " + slv.checkSatAssuming(diff_leq_two_thirds.notTerm()));
       slv.pop();
 
       System.out.println();
index a4b568ccd1917b32840f0387f739367714a1b736..f7fbf4bf37b1ca583f1d94798ba67c8dc4da0ed0 100644 (file)
@@ -113,7 +113,7 @@ public class Relations
 
       // (assert (forall ((x Person)) (not (set.member (tuple x x) ancestor))))
       Term x = solver.mkVar(personSort, "x");
-      Term xxTuple = solver.mkTuple(new Sort[]{personSort, personSort}, new Term[] {x, x});
+      Term xxTuple = solver.mkTuple(new Sort[] {personSort, personSort}, new Term[] {x, x});
       Term member = solver.mkTerm(SET_MEMBER, xxTuple, ancestor);
       Term notMember = solver.mkTerm(NOT, member);
 
index 6002c0e69e24c871e060eef7227a28523786fbed..1a2cff03140fec2f4302293cb1f68af9c2087df8 100644 (file)
@@ -50,8 +50,8 @@ public class Sets
 
         Term theorem = slv.mkTerm(EQUAL, lhs, rhs);
 
-        System.out.println("cvc5 reports: " + theorem + " is "
-            + slv.checkSatAssuming(theorem.notTerm()) + ".");
+        System.out.println(
+            "cvc5 reports: " + theorem + " is " + slv.checkSatAssuming(theorem.notTerm()) + ".");
       }
 
       // Verify set.empty is a subset of any set
@@ -61,8 +61,8 @@ public class Sets
 
         Term theorem = slv.mkTerm(SET_SUBSET, emptyset, A);
 
-        System.out.println("cvc5 reports: " + theorem + " is "
-            + slv.checkSatAssuming(theorem.notTerm()) + ".");
+        System.out.println(
+            "cvc5 reports: " + theorem + " is " + slv.checkSatAssuming(theorem.notTerm()) + ".");
       }
 
       // Find me an element in {1, 2} intersection {2, 3}, if there is one.
index 9a2054d86ee964a8052702614e672d54df9430fa..3ea56c55fd4cf82bc0b823b90aed25bc241c0fcd 100644 (file)
  * Utility methods.
  */
 
-import java.util.ArrayList;
-import java.util.List;
-
 import io.github.cvc5.CVC5ApiException;
 import io.github.cvc5.Kind;
 import io.github.cvc5.Sort;
 import io.github.cvc5.Term;
+import java.util.ArrayList;
+import java.util.List;
 
 public class Utils
 {
@@ -46,8 +45,7 @@ public class Utils
       {
         ss.append(' ');
       }
-      ss.append('(').append(params[i]).append(' ').append(params[i].getSort())
-          .append(')');
+      ss.append('(').append(params[i]).append(' ').append(params[i].getSort()).append(')');
     }
     ss.append(") ").append(sort).append(' ').append(body).append(')');
     return ss.toString();
@@ -59,8 +57,7 @@ public class Utils
    * @param terms the terms for which the synthesis solutions were retrieved
    * @param sols the synthesis solutions of the given terms
    */
-  public static void printSynthSolutions(Term[] terms, Term[] sols)
-      throws CVC5ApiException
+  public static void printSynthSolutions(Term[] terms, Term[] sols) throws CVC5ApiException
   {
     System.out.println('(');
     for (int i = 0; i < terms.length; ++i)
@@ -75,8 +72,7 @@ public class Utils
         }
         body = sols[i].getChild(1);
       }
-      System.out.println("  "
-          + defineFunToString(terms[i], params.toArray(new Term[0]), body));
+      System.out.println("  " + defineFunToString(terms[i], params.toArray(new Term[0]), body));
     }
     System.out.println(')');
   }
index d6233f0c5bca9ac7909ceb8c6194e169259d688c..f03db7c548db59711361042b4d1731ace130e56d 100644 (file)
@@ -14,6 +14,7 @@
 ##
 
 set(EXAMPLES_API_PYTHON
+  bags
   bitvectors_and_arrays
   bitvectors
   combination
diff --git a/examples/api/python/bags.py b/examples/api/python/bags.py
new file mode 100644 (file)
index 0000000..9172a97
--- /dev/null
@@ -0,0 +1,86 @@
+#!/usr/bin/env python
+###############################################################################
+# Top contributors (to current version):
+#   Mudathir Mohamed
+#
+# This file is part of the cvc5 project.
+#
+# Copyright (c) 2009-2021 by the authors listed in the file AUTHORS
+# in the top-level source directory and their institutional affiliations.
+# All rights reserved.  See the file COPYING in the top-level source
+# directory for licensing information.
+# #############################################################################
+#
+# A simple demonstration of reasoning about bags.
+##
+
+import cvc5
+from cvc5 import Kind
+
+if __name__ == "__main__":
+    slv = cvc5.Solver()
+    slv.setLogic("ALL")
+
+    # Produce models
+    slv.setOption("produce-models", "true")
+    slv.setOption("incremental", "true")
+
+    bag = slv.mkBagSort(slv.getStringSort())
+    A = slv.mkConst(bag, "A")
+    B = slv.mkConst(bag, "B")
+    C = slv.mkConst(bag, "C")
+    x = slv.mkConst(slv.getStringSort(), "x")
+
+    intersectionAC = slv.mkTerm(Kind.BagInterMin, A, C)
+    intersectionBC = slv.mkTerm(Kind.BagInterMin, B, C)
+
+    # union disjoint does not distribute over intersection
+    unionDisjointAB = slv.mkTerm(Kind.BagUnionDisjoint, A, B)
+    lhs = slv.mkTerm(Kind.BagInterMin, unionDisjointAB, C)
+    rhs = slv.mkTerm(Kind.BagUnionDisjoint, intersectionAC, intersectionBC)
+    guess = slv.mkTerm(Kind.Equal, lhs, rhs)
+    print("cvc5 reports: {} is {}".format(guess.notTerm(), slv.checkSatAssuming(guess.notTerm())))
+
+    print("{}: {}".format(A, slv.getValue(A)))
+    print("{}: {}".format(B, slv.getValue(B)))
+    print("{}: {}".format(C, slv.getValue(C)))
+    print("{}: {}".format(lhs, slv.getValue(lhs)))
+    print("{}: {}".format(rhs, slv.getValue(rhs)))
+
+    # union max distributes over intersection
+    unionMaxAB = slv.mkTerm(Kind.BagUnionMax, A, B)
+    lhs = slv.mkTerm(Kind.BagInterMin, unionMaxAB, C)
+    rhs = slv.mkTerm(Kind.BagUnionMax, intersectionAC, intersectionBC)
+    theorem = slv.mkTerm(Kind.Equal, lhs, rhs)
+    print("cvc5 reports: {} is {}.".format(theorem.notTerm(), slv.checkSatAssuming(theorem.notTerm())))
+
+    # Verify emptbag is a subbag of any bag
+    emptybag = slv.mkEmptyBag(bag)
+    theorem = slv.mkTerm(Kind.BagSubbag, emptybag, A)
+    print("cvc5 reports: {} is {}.".format(theorem.notTerm(), slv.checkSatAssuming(theorem.notTerm())))
+
+    # find an element with multiplicity 4 in the disjoint union of
+    #  {|"a", "a", "b", "b", "b"|} and {|"b", "c", "c"|}
+    one = slv.mkInteger(1)
+    two = slv.mkInteger(2)
+    three = slv.mkInteger(3)
+    four = slv.mkInteger(4)
+    a = slv.mkString("a")
+    b = slv.mkString("b")
+    c = slv.mkString("c")
+
+    bag_a_2 = slv.mkTerm(Kind.BagMake, a, two)
+    bag_b_3 = slv.mkTerm(Kind.BagMake, b, three)
+    bag_b_1 = slv.mkTerm(Kind.BagMake, b, one)
+    bag_c_2 = slv.mkTerm(Kind.BagMake, c, two)
+    bag_a_2_b_3 = slv.mkTerm(Kind.BagUnionDisjoint, bag_a_2, bag_b_3)
+    bag_b_1_c_2 = slv.mkTerm(Kind.BagUnionDisjoint, bag_b_1, bag_c_2)
+    UnionDisjoint = slv.mkTerm(Kind.BagUnionDisjoint, bag_a_2_b_3, bag_b_1_c_2)
+
+    count_x = slv.mkTerm(Kind.BagCount, x, UnionDisjoint)
+    e = slv.mkTerm(Kind.Equal, four, count_x)
+    result = slv.checkSatAssuming(e)
+
+    print("cvc5 reports: {} is {}.".format(e, result))
+    if result.isSat():
+        print("{}: {} ".format(x, slv.getValue(x)))