[mercury-users] Rewriting if-then-else as (CondGoal, ThenGoal; not(CondGoal), ElseGoal)

Richard O'Keefe ok at cs.otago.ac.nz
Tue Sep 6 07:39:49 AEST 2011


If memory serves me correctly, XSB Prolog detects that
	( X >= Y, ...
	; X < Y,  ...
	)
is an if-then-else, and even that
	p(X, Y, ...) :- X >= Y, ...
	p(X, Y, ...) :- X < Y, ...
is an if-then-else.

I would certainly regard
	( N =< 0, ...
	; N >  0, ...
	)
as prettier than the version using not.

--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list