Package FAtiMA.Core.wellFormedNames
Class Unifier
java.lang.Object
FAtiMA.Core.wellFormedNames.Unifier
Static Class that implements the Unifying algorithm
- Author:
- Joao Dias
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayList<Substitution>static booleanUnify(Name n1, Name n2, ArrayList<Substitution> bindings)
-
Constructor Details
-
Unifier
public Unifier()
-
-
Method Details
-
Unify
- Parameters:
n1- - The first Namen2- - The second Namebindings- - Place an empty Substitution List here- Returns:
- True if the names are unifiable, in this case the bindings list will contain the found Substitutions, otherwise it will be empty
- See Also:
-
NameUnifying Method, receives two WellFormedNames and tries to find a list of Substitutions that will make both names syntatically equal. The algorithm does not perform Occur Check, since the unification of [X] and Luke(Strength) is allways assumed to 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
-
Unify
- Parameters:
n1- - The first Namen2- - The second Name- Returns:
- A list of substitutions if the names are unifyable, otherwise returns null
- See Also:
-
NameUnifying Method, receives two WellFormedNames and tries to find a list of Substitutions that will make both names syntatically equal. The algorithm does not perform Occur Check, since the unification of [X] and Luke(Strength) is allways assumed to 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
-