]> Repositorios git - scryer-prolog.git/commitdiff
Special case for `(^)/2`
authornotoria <[email protected]>
Mon, 8 Jan 2024 20:50:02 +0000 (21:50 +0100)
committernotoria <[email protected]>
Mon, 8 Jan 2024 20:50:02 +0000 (21:50 +0100)
The only solutions for `Z #= X^Z` are `X = Z, X in -1\/1`. Also helps
avoid big numbers.

src/lib/clpz.pl

index 8c21a6e92155d63e4866f9833e30f67f560ff53a..5730947041b132989914dd12e3eb5dd9e269a510 100644 (file)
@@ -5454,6 +5454,7 @@ run_propagator(pexp(X,Y,Z,Morph), MState) -->
             morph_into_propagator(MState, [Y,Z], reified_eq(1,Y,1,0,[],Z), Morph)
         ;   Y == 0 -> kill(MState), Z = 1
         ;   Y == 1 -> kill(MState), Z = X
+        ;   Y == Z -> kill(MState), X = Y, queue_goal(X in -1\/1)
         ;   nonvar(X) ->
             (   nonvar(Y) ->
                 (   Y >= 0 -> true ; X =:= -1 ),