: - 4


goal

consult(data),

vvod,

save(data).

4.

domaines

Post, Kod = string

Kol, Cena = integer

Sum, Sum1 = integer

Sp = kol*

database

tmc (Post, Kod, Kol, Cena)

predicates

sum( Sp, Sum)

clouses

sum ( [ ], 0).

sum ( [ H/t ], Sum) if

sum(T,Sum1),

Sum= H + Sum1.

goal

consult (data),

write ( ֔),

nl,

readln (Kod),

sum(Sp, Sum),

write (Sum).

5.

domains

Post, Kod = string

Kol, Cena = integer

database

tmc (Post, Kod, Kol, Cena)

predicates

udal

clouses

udal if

write ( ),

nl,

readln (Post),

write ( ֔),

nl,

readln (Kod),

retract (tmc (Post, Kod, Kol, Cena)),

goal

consult (data),

udal,

save(data).

6.

dauses

udal if

write ( ),

nl,

readln (post),

retract(tmc (Post, Kod, Kol, Cena)),

 

retract . .

.

2- :

1-- retract .

2-- assertz .

 

3. .

- , . - . .

- . - . . - , - . .

- - , - .