-


- - . 18


clauses
repeat. repeat :- repeat.
member(X,[X|_]). member(X,[_|L]) :- member(X,L).
tabl :- repeat, L=[1,2,3,4,5,6,7,8,9],
member(X,L), member(Y,L),Z=X*Y,
assert(prod(X,Y,Z)), counter(V),W=V+1, retract(counter(V)),
asserta(counter(W)),W=81.
run :- assert(counter(0)), tabl, retract(counter(_)), save("tabl.dba").
goal
run.
4. .
 
, 3,
consult("tabl.dba") tabl.dba .
domains
i=integer
database
prod(i,i,i)
Goal: consult("tabl.dba"),prod(X,Y,Z). /* */
/* */
5. .
 
reader(,__, __).
, 10-
"".
domains
i=integer
database
reader(symbol,i,i)
counter(i)
predicates
wr(i,i)
repeat
inbase
count(i,i)
clauses
repeat. repeat :- repeat.
count(X,Y) :- counter(X),Y=X+1, retract(counter(X)), assert(counter(Y)).
inbase :- /* */
repeat, /* */
write('&'),
readln(Name), /* */
readint(Ticket), /* . */
readint(Date), /* */
assert(reader(Name,Ticket,Date)),
count(_,Y),Y=5. /* = 5 */
wr(D,Y) :- /* */



- -  - -  - -