Пример #1
0
        public override IL substitute(GroundSubstitutionEC s)
        {
            var result = s.universe.makeIL(faf.substitute(s), polarity, s.isGoal);

#if DEBUG
            if (result is GL)
            {
                var ga = result as GL;
                Debug.Assert(s.universe.getGTTGAF(ga.gtt, ga.predicate).gLiteral(result.polarity) == result);
            }
#endif
            return(result);
        }
Пример #2
0
        public override IAF substitute(GroundSubstitutionEC s)
        {
            var itT = (from it in ftt select it.substitute(s)).ToArray();

            if (itT.All(it => it.isGround))
            {
                return(s.universe.makeGAF(predicate, from it in itT select it as GT));
            }
            else
            {
                return(s.universe.makeFAF(predicate, s.universe.makeFTT(itT)));
            }
        }
        internal GroundSubstitutionEC tryCombine(GroundSubstitutionEC c)
        {
            Debug.Assert(universe == c.universe);
            var t = new Dictionary <LVar, GT>(map);

            foreach (var p in c.map)
            {
                if (t.ContainsKey(p.Key) && !t[p.Key].Equals(p.Value))
                {
                    return(null);
                }
                else
                {
                    t[p.Key] = p.Value;
                }
            }
            return(new GroundSubstitutionEC(universe, isGoal, t));
        }
Пример #4
0
 public GL gSubstitute(GroundSubstitutionEC s)
 {
     return(this);
 }
Пример #5
0
 public override IL substitute(GroundSubstitutionEC s)
 {
     Debug.Assert(s.universe.getGTTGAF(gaf.gtt, gaf.predicate).gLiteral(polarity) == this);
     return(this);
 }
Пример #6
0
 public override IAF substitute(GroundSubstitutionEC s)
 {
     return(this);
 }
Пример #7
0
 public override IT substitute(GroundSubstitutionEC s)
 {
     return(s.variables.Contains(variable) ? s[variable] : this as IT);
 }
Пример #8
0
 public override IT substitute(GroundSubstitutionEC s)
 {
     return(substitute(s.universe, from it in ftt select it.substitute(s), s.isGoal));
 }
Пример #9
0
 public abstract IL substitute(GroundSubstitutionEC s);