Exemplo n.º 1
0
/*        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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
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);
            }
        }