Hi for all...
i have to implement unifiction algorithm (in first order logic) using c++ language so can any help me with basic ideas??
The language known as 'Prolog' relies heavily on this idea, however, all you need to do is consider using this...
Here are a few examples to clarify whether you really understand what unification is...
Here are some examples of terms that will unify:
X = b
X = plus(4,5)
Y = g(5)
Y = plus(4,5)
X = 7
However, here are some examples where unification will fail:
And now for the algorithm...
Using the first case for its brevity I shall outline a procedure for C++
X = b
First create some strings.
string one = "f(a,b)"
string two = "f(a,X)"
Using step one check that the tail head is the same in both string one and two. They are.
Next find the first disagreement pair, which would be
b and X
Substitue the X with X=b and then check if both expressions are the same (the substitution could be done using recursion) Repeat until finished.