I worked the last 5 days to understand how unification algorithm works in Prolog . Now ,I want to implement such algorithm in Java ..
I thought maybe best way is to manipulate the string and decompose its parts using some datastructure such as Stacks ..
to make it clear :
suppose user inputs is: a(X,c(d,X)) = a(2,c(d,Y)).
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 ?)