trealla icon indicating copy to clipboard operation
trealla copied to clipboard

Problem with soft-if-then-else

Open infradig opened this issue 11 months ago • 1 comments

I don't know if you like it but here is another discrepancy: (*->/2)

$ cat ite_3.pl
main :-
     member(X,[true,\+true]),
     ( member(X,[\+true,true,\+true]) *->
         write(here1)
     ; member(X,[true,\+true,true]) *->
         write(here2)
     ),
     write({X}), fail.

$ SWI, EcLiPsE
here1{true}here1{\+true}here1{\+true}

$ tpl ite3_pl # v2.63.25
?- main.
here1{true}here2{true}here2{true}here1{\+true}here1{\+true}

Originally posted by @flexoron in #651

infradig avatar Jan 22 '25 04:01 infradig

Simplify slightly...

main :-
     member(X,[true,false]),
     ( member(X,[false,true,false]) *->
         write(here1)
     ; write(here2)
     ),
     write({X}), fail.

infradig avatar Jan 23 '25 05:01 infradig