Min

Description

Minimum with cuts

Source: The Art of Prolog

Download

Program source code: min.pl

Listing

/*
   minimum(X,Y,Min) :- Min is the minimum of the numbers X and Y.
*/
   minimum(X,Y,X) :- X =< Y, !.
   minimum(X,Y,Y) :- X > Y, !.
 
%  Program 11.3    Minimum with cuts

Comments

pl/prolog/pllib/min.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0