Spis treści

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