Natural numbers

Description

Defining the natural numbers.

Source: The Art of Prolog

Download

Program source code: natural_numbers.pl

Listing

/* 
	natural_number(X) :- X is a natural number.
*/
 
	natural_number(0).
	natural_number(s(X)) :- natural_number(X).
 
%	Program 3.1:  Defining the natural numbers

Comments

pl/prolog/pllib/natural_numbers.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