C# Class WellFormedNames.Unifier

Static Class that implements the Unifying algorithm @author: João Dias @author: Pedro Gonçalves (C# version)
Mostra file Open project: GAIPS-INESC-ID/FAtiMA-Toolkit

Public Methods

Method Description
GetTerms ( Name n1, Name n2, bool allowPartial ) : Name>>.IEnumerable
PartialUnify ( Name name1, Name name2, IEnumerable &bindings ) : bool

Unifying Method similar to Unify but with an important difference. If one of the unifying names is smaller or bigger than the other, this method considers that the names can still be partially unifiable. The regular Unify method will always return false in such situations.

Unify ( Name name1, Name name2 ) : IEnumerable
Unify ( Name name1, Name name2, IEnumerable &bindings ) : bool

Unifying Method, receives two WellFormedNames and tries to find a list of Substitutions that will make both names syntatically equal. The algorithm performs Occur Check, as such the unification of [X] and Luke([X]) will allways fail. The method goes on each symbol (for both names) at a time, and tries to find a substitution between them. Take into account that the Unification between [X](John,Paul) and Friend(John,[X]) fails because the algorithm considers [X] to be the same variable

Private Methods

Method Description
FindSubst ( Name n1, Name n2, bool allowPartial ) : IEnumerable
FindSubst ( Name n1, Name n2, bool allowPartialTerms, SubstitutionSet bindings ) : bool

Method Details

GetTerms() public static method

public static GetTerms ( Name n1, Name n2, bool allowPartial ) : Name>>.IEnumerable
n1 Name
n2 Name
allowPartial bool
return Name>>.IEnumerable

PartialUnify() public static method

Unifying Method similar to Unify but with an important difference. If one of the unifying names is smaller or bigger than the other, this method considers that the names can still be partially unifiable. The regular Unify method will always return false in such situations.
public static PartialUnify ( Name name1, Name name2, IEnumerable &bindings ) : bool
name1 Name The first Name
name2 Name The second Name
bindings IEnumerable The out paramenter for the founded substitutions
return bool

Unify() public static method

public static Unify ( Name name1, Name name2 ) : IEnumerable
name1 Name
name2 Name
return IEnumerable

Unify() public static method

Unifying Method, receives two WellFormedNames and tries to find a list of Substitutions that will make both names syntatically equal. The algorithm performs Occur Check, as such the unification of [X] and Luke([X]) will allways fail. The method goes on each symbol (for both names) at a time, and tries to find a substitution between them. Take into account that the Unification between [X](John,Paul) and Friend(John,[X]) fails because the algorithm considers [X] to be the same variable
public static Unify ( Name name1, Name name2, IEnumerable &bindings ) : bool
name1 Name The first Name
name2 Name The second Name
bindings IEnumerable The out paramenter for the founded substitutions
return bool