Różnice

Różnice między wybraną wersją a wersją aktualną.

Odnośnik do tego porównania

pl:prolog:pllib:lesseq_operator [2019/06/27 15:50]
pl:prolog:pllib:lesseq_operator [2019/06/27 15:50] (aktualna)
Linia 1: Linia 1:
 +====== Lesseq operator ======
 +{{tag>​math operators arithmetic}}
 +===== Description =====
 +The less than or equal relation.
 +
 +**Source**: ​ The Art of Prolog
 +===== Download =====
 +Program source code: {{lesseq_operator.pl}}
 +===== Listing =====
 +<code prolog>
 +/*
 + X lesseq Y :-  X and Y are natural numbers,
 +     such that X is less than or equal to Y.
 +
 +We use lesseq to represent the operator rather than cause problems
 +with an error message from Prolog about redefining an operator!
 +*/
 +
 + :- op(40,xfx, '​lesseq'​).
 + 0 lesseq X :- natural_number(X).
 + s(X) lesseq s(Y) :- X lesseq Y.
 +
 + natural_number(0).
 + natural_number(s(X)) :- natural_number(X).
 +
 +% Program 3.2: The less than or equal relation
 +</​code>​
 +===== Comments =====
  
pl/prolog/pllib/lesseq_operator.txt · ostatnio zmienione: 2019/06/27 15:50 (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