equations_gauss.pl : Solves linear polynomial equations
Solves linear polynomial equations by Gaussian variable elimination.

How to use:
The handler solves a set of equations enclosed in curly brackets:
{PL1=PR1, PL2=PR2, .., PLn=PRn}. (PLi, PRi are linear polynomial terms)
If no solution exists the handler fails.
Variables can either be expressed by Prolog variables (X) or by atoms (x).
If Prolog variables are used, as soon as the handler has determined the value of a variable it is bound to this value, e.g.: X = 10.
For Prolog variables, the termination of the handler requires a stable variable order that is implemented by the imported module var_order.
If you don't want to use this module, you can also use atoms for this purpose, a variable binding is then represented as a normalized equation, e.g.: [1*x] eq 10.

Program: Change the code, then submit!

Console: Enter query or select example from below, then submit and wait for answer!

 Select example query: (Clear query) {x+y=10, x-y=6}. {X+Y=10, X-Y=6}. {X+Y=10, X+Y=6}. {3 * X + 2 * Y - 4 * (3 + Z) = 2 * (X - 3) + (Y + Z) * 7, 2 * (X + Y + Z) = 3 * (X - Y - Z), 5 * (X + Y) - 7 * X - Z = (2 + 1 + X) * 6}. {3 * X + 2 * Y - 4 * (3 + Z) = 2 * (X - 3) + (Y + Z) * 7, 2 * (X + Y + Z) = 3 * (X - Y - Z)}. {2+2*X+4*Y+2*Z=0, 4+2*X+4*Y+4*Z=0, 1+2*X+3*Z=0}. {-10+1*X+1*Y=0, 2+1*X+(-1)*Y=0}. {-10+1*X+1*Y=0, 2+1*X+(-1)*Y=0, -4+1*X=0}. {-10+1*X+1*Y=0, 2+1*X+(-1)*Y=0, -5+1*X=0}. {-1+1*X+1*Y=0, -2+2*X+2*Y=0}. {X=Y+Z, X+Z=10, Y=10}. {X+Y=10, X-Z=20, 2*Y+Z=30}. {-(X)+Y+Z+2*Y+X+3*X+2=12}.

WebCHR help - CHR Website - (c) Copyrights Martin Kaeser Uni Ulm 2007