public override void AddMapping(TermVariable from, Term to) { if (to is TermObject == false) throw new Exception("TermObjectSubstitution is optimised for TermObjects"); int delta = from.GetHashCode() ^ to.GetHashCode(); _hashcode += delta; Substitutions[from] = to.Clone(); }
public override Term GetMapping(TermVariable var) { Term result; Substitutions.TryGetValue(var, out result); return result; }
private TermVariable GetUnusedVariable() { TermVariable curVar; do curVar = new TermVariable(GameContainer.SymbolTable["?a" + _count++]); while (_originalVarsFromRule.Contains(curVar)); return curVar; }