I trying to create compact code in prolog that sovles systems of equations.
For example, in this case, the assumptions must be
A+B-C-D=4, A+B+C+D=14, A-B+C-D=2.
I'm trying to have it where it solves all combinations possible for A, B, C, and D but satisfies all 3 equations. They can only be #'s 0-9 though but somehow show all possible solutions/combinations.
So after running the query, it would output something like
Crypto(A,B,C,D)
A = 8, B = 1, C = 0, D = 5.
^That would be one solution. But I need to show all possible.
I'm kind of lost as to how to satisfy all 3 in Prolog. Thank you.