Update Relations.java (#7796)
authormudathirmahgoub <mudathirmahgoub@gmail.com>
Mon, 13 Dec 2021 17:47:40 +0000 (11:47 -0600)
committerGitHub <noreply@github.com>
Mon, 13 Dec 2021 17:47:40 +0000 (17:47 +0000)
examples/api/java/Relations.java

index a3e2b2a7e49678f97f720feaeeeac968863ce984..95aede59155cb8203cf60adf8ad253bce31f8563 100644 (file)
@@ -152,10 +152,9 @@ public class Relations
       Term transpose = solver.mkTerm(RELATION_TRANSPOSE, descendant);
       Term ancestorFormula = solver.mkTerm(EQUAL, ancestor, transpose);
 
-      // (assert (forall ((x Person)) (not (set.member (mkTuple x x) ancestor))))
+      // (assert (forall ((x Person)) (not (set.member (tuple x x) ancestor))))
       Term x = solver.mkVar(personSort, "x");
-      DatatypeConstructor constructor = tupleArity2.getDatatype().getConstructor(0);
-      Term xxTuple = solver.mkTerm(APPLY_CONSTRUCTOR, constructor.getConstructorTerm(), 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);