Skip to content

Commit

Permalink
Special case for (^)/2
Browse files Browse the repository at this point in the history
The only solutions for `Z #= X^Z` are `X = Z, X in -1\/1`. Also helps
avoid big numbers.
  • Loading branch information
notoria committed Jan 8, 2024
1 parent f9eadc8 commit 902cd5c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib/clpz.pl
Original file line number Diff line number Diff line change
Expand Up @@ -5454,6 +5454,7 @@
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 ),
Expand Down

0 comments on commit 902cd5c

Please sign in to comment.