Source:
public boolean implies(SymbolicConstraint constraint, Set<Variable> rightOnlyVariables) { LinkedList<Implication> implications = new LinkedList<>(); implications.add(new Implication(this, constraint)); while (!implications.isEmpty()) { Implication implication = implications.remove(); SymbolicConstraint left = implication.left; SymbolicConstraint right = implication.right; if (left.isFalse()) continue; if (context.definition().context().globalOptions.verbose) { System.out.println("Attempting to prove: \n\t" + left + "\n implies \n\t" + right); } right = left.simplifyConstraint(right); right.orientSubstitution(rightOnlyVariables); if (right.isTrue() || (right.equalities().isEmpty() && rightOnlyVariables.containsAll(right.substitution().keySet()))) { if (context.definition().context().globalOptions.verbose) { System.out.println("Implication proved by simplification"); } continue; } IfThenElseFinder ifThenElseFinder = new IfThenElseFinder(context); right.accept(ifThenElseFinder); if (!ifThenElseFinder.result.isEmpty()) { KItem ite = ifThenElseFinder.result.get(0); Term condition = ((KList) ite.kList()).get(0); if (context.definition().context().globalOptions.verbose) { System.out.println("Split on " + condition); } SymbolicConstraint left1 = new SymbolicConstraint(left, context); left1.add(condition, BoolToken.TRUE); implications.add(new Implication(left1, new SymbolicConstraint(right,context))); SymbolicConstraint left2 = new SymbolicConstraint(left, context); left2.add(condition, BoolToken.FALSE); implications.add(new Implication(left2, new SymbolicConstraint(right,context))); continue; } if (!impliesSMT(left,right)) { if (context.definition().context().globalOptions.verbose) { System.out.println("Failure!"); } return false; } else { if (context.definition().context().globalOptions.verbose) { System.out.println("Proved!"); } } } return true; }

Target:
public boolean implies(SymbolicConstraint constraint, Set<Variable> rightOnlyVariables) { LinkedList<Implication> implications = new LinkedList<>(); implications.add(new Implication(this, constraint)); while (!implications.isEmpty()) { Implication implication = implications.remove(); SymbolicConstraint left = implication.left; SymbolicConstraint right = implication.right; if (left.isFalse()) continue; if (context.definition().context().globalOptions.debug) { System.out.println("Attempting to prove: \n\t" + left + "\n implies \n\t" + right); } right = left.simplifyConstraint(right); right.orientSubstitution(rightOnlyVariables); if (right.isTrue() || (right.equalities().isEmpty() && rightOnlyVariables.containsAll(right.substitution().keySet()))) { if (context.definition().context().globalOptions.debug) { System.out.println("Implication proved by simplification"); } continue; } IfThenElseFinder ifThenElseFinder = new IfThenElseFinder(context); right.accept(ifThenElseFinder); if (!ifThenElseFinder.result.isEmpty()) { KItem ite = ifThenElseFinder.result.get(0); Term condition = ((KList) ite.kList()).get(0); if (context.definition().context().globalOptions.debug) { System.out.println("Split on " + condition); } SymbolicConstraint left1 = new SymbolicConstraint(left, context); left1.add(condition, BoolToken.TRUE); implications.add(new Implication(left1, new SymbolicConstraint(right,context))); SymbolicConstraint left2 = new SymbolicConstraint(left, context); left2.add(condition, BoolToken.FALSE); implications.add(new Implication(left2, new SymbolicConstraint(right,context))); continue; } if (!impliesSMT(left,right)) { if (context.definition().context().globalOptions.debug) { System.out.println("Failure!"); } return false; } else { if (context.definition().context().globalOptions.debug) { System.out.println("Proved!"); } } } return true; }