Equation solving

Description

Solving equalization with constraints, which can only be above zero

Source: PROLOG str. 194 Wydawnictwo PLJ Warszawa 1991 ISBN 83-85190-63-5

Download

Program source code: equation_solving.pl

Listing

liczba(0).
liczba(I) :- liczba(L), I is L + 1.
 
plus(X, Y, Z) :- Z is X + Y.
minus(X, Y, Z) :- Z is X - Y.
 
rownanie(X, Y) :- liczba(X), plus(X, 3 ,8), liczba(Y), minus(X, Y, 3), !.
 
test :- rownanie(X, Y).

Comments

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