I am trying to solve an arithmetic expression in prolog (implementation - eclipse prolog). The arithmetic expression to be solved is like this:
A * (C + B * X) + D * X = E
X is the value to be computed, and all others (A,B,C,D,E) are all numbers.
For example: 5 * (3 + 2*X) + 2*X = 39, on computing should assign X with the value 2.
The query(goal) that would be entered into Prolog would take the form:
?- compute( 5*(3+2*X)+2*X = 39, Result).
The 'Result' and value of 'X' should be tied (assigned) together. How do I write the prolog program to do this..?
Thank You.