public TypeEqualityInstance(Clause clause, int atomIndex) { Debug.Assert(atomIndex >= 0 && atomIndex < clause.literals.Count); this.clause = clause; this.atomIndex = atomIndex; equality = clause.literals[atomIndex].f as EqualityFormula; }
public CNF2State(EqualityFormula eq, bool p) { if (!eq.isTrue) { var nc = new Clause(eq, p); pClauses[nc.ToString()] = nc; } }
public IFormula visit(EqualityFormula f) { if (f.t1.Equals(f.t2)) { return(new True()); } return(f); }
public Clause(EqualityFormula f, bool p) : this( new PredicateApplication[0], new PredicateApplication[0], p ? new[] { f } : new EqualityFormula[0], !p ? new[] { f } : new EqualityFormula[0] ) { }
////////////////////////////////////////////////////////////////////////////////////////// private static bool tryUnify(EqualityFormula eq1, EqualityFormula eq2, Substitution s) { Debug.Assert(eq1.t1.type.isEquivalent(eq2.t1.type)); //record substitution as has to check both ways s.push(); if (tryUnify(eq1.t1, eq2.t1, s) && tryUnify(eq1.t2, eq2.t2, s)) { return(true); } s.pop(); return(tryUnify(eq1.t1, eq2.t2, s) && tryUnify(eq1.t2, eq2.t1, s)); }
public IFormula visit(EqualityFormula f) { return(f); }
public IFormula visit(EqualityFormula f) { return(new Not(f)); }
internal static string polish(EqualityFormula f, IDictionary <string, string> vm) { return("(= " + polish(f.t1, vm) + " " + polish(f.t2, vm) + ")"); }