コード例 #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)));
            }
        }
コード例 #3
0
        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);