-


- - . 17



solve(Problem,Solution).
,
,
:
solve(Problem,Solution), asserta(solve(Problem,Solution)).
, (Solution)
, , , . "" , , , , , , . , , , , .
4.3.
repeat .
repeat.
repeat :- repeat.
2. .
 
counter(i) i=0 i=100.
database
counter(integer)
predicates
repeat
count
goal
count.
clauses
repeat. repeat :- repeat.
count :- assert(counter(0)),fail.
count :- repeat, counter(X), Y=X+1, retract(counter(X)), asserta(counter(Y)),
write(Y,"\n"),
Y=100.
3.
 
prod(X,Y,Z), X Y - , Z -
. tabl.dba
save("tabl.dba").
domains
i=integer
list=i*
predicates
repeat
member(i,list)
tabl
run
database
prod(i,i,i)
counter(i)



- -  - -  - -