Ejemplo n.º 1
0
 /** Checks if {@code left => right}, or {@code left /\ !right} is unsat. */
 public boolean impliesSMT(
     ConjunctiveFormula left, ConjunctiveFormula right, Set<Variable> rightOnlyVariables) {
   if (smtOptions.smt == SMTSolver.Z3) {
     try {
       return z3.isUnsat(
           KILtoSMTLib.translateImplication(left, right, rightOnlyVariables),
           smtOptions.z3ImplTimeout);
     } catch (UnsupportedOperationException e) {
       e.printStackTrace();
     } catch (SMTTranslationFailure e) {
       e.printStackTrace();
     }
   }
   return false;
 }
Ejemplo n.º 2
0
  public boolean checkUnsat(ConjunctiveFormula constraint) {
    if (smtOptions.smt != SMTSolver.Z3) {
      return false;
    }

    if (constraint.isSubstitution()) {
      return false;
    }

    boolean result = false;
    try {
      String query = KILtoSMTLib.translateConstraint(constraint);
      result = z3.isUnsat(query, smtOptions.z3CnstrTimeout);
      if (result && RuleAuditing.isAuditBegun()) {
        System.err.println("SMT query returned unsat: " + query);
      }
    } catch (UnsupportedOperationException e) {
      e.printStackTrace();
    }
    return result;
  }