diff --git a/polimani.pl b/polimani.pl index cce9b39..bca9745 100644 --- a/polimani.pl +++ b/polimani.pl @@ -38,12 +38,10 @@ polynomial_variable(X) :- % Returns true if X is a power term, false otherwise. % Fully reversible. % -power(P) :- - %% Makes this more reversible - P = X ^ N, +power(P^N) :- %% CPL(FD) library predicate to perform integer comparassions in a reversible way %% If 0 > N succeds, fail, otherwise check if X is a valid variable - (zcompare((>), 0, N); polynomial_variable(X)), fail. + (zcompare((<), 0, N), polynomial_variable(P)); fail. %% if(zcompare((>), 0, N), %% fail, %% polynomial_variable(X)