Лекции по информатике
Вопросы - Компьютеры, программирование
Другие вопросы по предмету Компьютеры, программирование
#241; , [ ] .
, , .
- , . domains - - .. (Sp=integer*).
domains .. , - . .
domains
k_fms = string, kol = integer,
Sp = kol*
predicates
fms ( k_fms, kd, ...)
( ) ( ). 1- - , .
- , .
.
MEMO ( .. Sp, , .
- .
I [ Head I Tail] [H I T]
H
T “
domains
list=char*
predicates
test (List)
clouses
test ( [A, B , C, D] ).
goal
test ([H/T]),
nl,
write (H)
APPEND ( [ - ],[ - ], )
2- , , III .
REVERS ( [ - . ], )
-
FINDALL ()
domains
post = string
Kol, Cena, Sum = integer
Sp = integer* ( Sp = Kol*)
Kod = string
predicates
tmc ( P, Kol, Cena)
sum ( Sp, Sum)
goal
write ( “ ”),
readln ( Kod),
nl,
findall ( Kol, tmc ( Pos1, Kod, Kol, Cena), Sp),
sum (Sp, Sum),
write ( “ =” , Sum)
clauses
tmc ( “ 001”, “001”, 45, 80)
…
sum ( [ ], 0).
sum ( [ H/T ], Sum) if
sum ( T, Sum1).
Sum = H + Sum1.
, . , -.
- . . . , . -, .
DATABASE
, predicates.
database predicates , .