Exemplo n.º 1
0
        public Substitution WorldUnify(AccessibilityRelation relation, WorldIndex i, WorldIndex j)
        {
            //2b -> one is ground and the other world variable
            if (i.EndSymbol.IsGround || j.EndSymbol.IsGround)
            {
                //Need to verify if n is accessible from the parent of w
                var n = i.EndSymbol.IsGround ? i.EndSymbol : j.EndSymbol;
                var w = !i.EndSymbol.IsGround ? i.EndSymbol : j.EndSymbol;

                if (relation.Contains(w.ParentSymbol, n))
                {
                    var sub = new Substitution();
                    sub.Add(n, w);
                    return(sub);
                }

                return(null);
            }
            //2c -> both are world variables
            else
            {
                //(i)
                if (relation.Contains(i.EndSymbol.ParentSymbol, j.EndSymbol) || relation.Contains(j.EndSymbol.ParentSymbol, i.EndSymbol))
                {
                    return(new Substitution(i.EndSymbol, j.EndSymbol));
                }
                //(ii)
                else
                {
                    var parentUnification = relation.WorldUnify(i.ParentIndex, j.ParentIndex);
                    if (parentUnification == null)
                    {
                        return(null);
                    }
                    else
                    {
                        new Substitution(i.EndSymbol, j.EndSymbol).Compose(parentUnification);
                        return(parentUnification);
                    }
                }
            }
        }
Exemplo n.º 2
0
 public override void ApplySubstitution(Substitution substitution)
 {
     Formula.ApplySubstitution(substitution);
 }
Exemplo n.º 3
0
 public abstract void ApplySubstitution(Substitution substitution);