/*        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));
        }
示例#2
0
        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));
        }
示例#3
0
        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];
            }
        }
示例#4
0
        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);
            }
        }
示例#5
0
        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));
 }
示例#8
0
        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)));
        }
示例#9
0
 public ITermTuple substitute(Substitution s)
 {
     return(new TermTuple(from t in ts select t.substitute(s)));
 }
示例#10
0
 public abstract IFormula substitute(Substitution s);
 //            public override ISet<Function> functions { get { return new HashSet<Function>(); } }
 public IFormula substitute(Substitution s)
 {
     return(this);
 }
示例#12
0
        public ITerm substitute(Substitution s)
        {
            var t = s.map(variable);

            return((t == null) ? this : t);
        }
示例#13
0
 public IFormula substitute(Substitution s)
 {
     return(new Not(f.substitute(s)));
 }
示例#14
0
 public abstract IAtomicFormula substituteA(Substitution s);