implementing unification algorithm
<p>I worked the last 5 days to understand how unification algorithm works in Prolog .
Now ,I want to implement such algorithm in Java ..</p>

<p>I thought maybe best way is to manipulate the string and decompose its parts using some datastructure such as Stacks ..</p>

<p>to make it clear :</p>

<p>suppose user inputs is:
 a(X,c(d,X)) = a(2,c(d,Y)).</p>

<p>I already take it as one string and split it into two strings (Expression1 and 2 ).
now, how can I know if the next char(s) is Variable or constants or etc.. ,
I can do it by nested if but it seems to me not good solution ..
I tried to use inheritance but the problem still ( how can I know the type of chars being read ?) </p>
