/// <summary> /// Extends the lfp with a symbolic element equivalent to t. /// </summary> private SymElement ExtendLFP(Term t) { SymElement e; if (lfp.TryFindValue(t, out e)) { return(e); } Term normalized; var enc = Encoder.GetTerm(t, out normalized); if (lfp.TryFindValue(normalized, out e)) { return(e); } //// Neither t nor a normalized version of t has been seen. e = new SymElement(normalized, enc, Solver.Context); lfp.Add(normalized, e); if (normalized != t) { lfp.Add(t, e); } return(e); }
private Entry GetEntry(SymElement t) { Entry e; if (!entryMap.TryFindValue(t, out e)) { e = new Entry(t); entryMap.Add(t, e); } return(e); }
public static int Compare(Activation a1, Activation a2) { var cmp = SymElement.Compare(a1.Binding1, a2.Binding1); if (cmp != 0) { return(cmp); } cmp = SymElement.Compare(a1.Binding2, a2.Binding2); if (cmp != 0) { return(cmp); } return(a1.Rule.RuleId - a2.Rule.RuleId); }
/// <summary> /// "null" is the smallest symbolic element. /// </summary> public static int Compare(SymElement e1, SymElement e2) { if (e1 == null && e2 == null) { return(0); } else if (e1 == null && e2 != null) { return(-1); } else if (e1 != null && e2 == null) { return(1); } else { return(Term.Compare(e1.Term, e2.Term)); } }
public Activation(CoreRule rule, SymElement binding1, SymElement binding2) { Rule = rule; Binding1 = binding1; Binding2 = binding2; }
public Activation(CoreRule rule, SymElement binding) { Rule = rule; Binding1 = binding; Binding2 = null; }
public Activation(CoreRule rule) { Rule = rule; Binding1 = Binding2 = null; }
public static int Compare(Entry e1, Entry e2) { return(SymElement.Compare(e1.Element, e2.Element)); }
public Entry(SymElement t) { Contract.Requires(t != null); Element = t; }