/* public EqualityFormula substituteEq(Substitution s) * { * return new EqualityFormula(t1.substitute(s), t2.substitute(s)); * }*/ public EqualityFormula substituteEq(Substitution s) { var newArgs = new List <ITerm>(); if (TermTuple.substitute(s, args, newArgs)) { return(new EqualityFormula(newArgs[0], newArgs[1])); } else { return(this); } // foreach (var a in args) // newArgs.Add(a.substitute(s)); }
public PredicateApplication substitutePA(Substitution s) { var newArgs = new List <ITerm>(); if (TermTuple.substitute(s, args, newArgs)) { return(new PredicateApplication(predicate, newArgs)); } else { return(this); } // foreach (var a in args) // newArgs.Add(a.substitute(s)); }
internal void composeWith(Substitution s) { var kk = new List <LVar>(termMap.Keys); foreach (var k in kk) { termMap[k] = termMap[k].substitute(s); } var nk = new List <LVar>(s.termMap.Keys.Except(termMap.Keys)); foreach (var k in nk) { termMap[k] = s.termMap[k]; } }
public ITerm substitute(Substitution s) { if (!freeVariables.Intersect(s.domain).Any()) { return(this); } var nts = new List <ITerm>(); if (TermTuple.substitute(s, args, nts)) { return(new FunctionApplicationFormula(function, nts)); } else { return(this); } }
public static bool substitute(Substitution s, IEnumerable <ITerm> ts, IList <ITerm> nts) { var v = false; // if (ts.Any(t => t.freeVariables.Intersect(s.domain).Any())) { foreach (var t in ts) { var nt = t.substitute(s); nts.Add(nt); if (!ReferenceEquals(t, nt)) { v = true; } } } return(v); }
public override IFormula substitute(Substitution s) { return(substituteA(s)); }
public override IAtomicFormula substituteA(Substitution s) { return(substituteEq(s)); }
public override IFormula substitute(Substitution s) { var ms = s.without(var); return(new ExistentialFormula(var, f.substitute(ms), attributes, from ts in triggers select from t in ts select t.substitute(ms))); }
public ITermTuple substitute(Substitution s) { return(new TermTuple(from t in ts select t.substitute(s))); }
public abstract IFormula substitute(Substitution s);
// public override ISet<Function> functions { get { return new HashSet<Function>(); } } public IFormula substitute(Substitution s) { return(this); }
public ITerm substitute(Substitution s) { var t = s.map(variable); return((t == null) ? this : t); }
public IFormula substitute(Substitution s) { return(new Not(f.substitute(s))); }
public abstract IAtomicFormula substituteA(Substitution s);