:
.2.
, .
:
1) , .
2) , .
3) , , . , , .
4) , , .
4.8. : fail
: fail .
1. fail - , . fail .
1. 4- .
DOMAINS
name=string
kurs=integer
PREDICATES
Student(name, kurs)
spisok
CLAUSES
Student("",2).
Student("",4).
Student("",1).
Student("",4).
Student("",4).
spisok:-Write(" 4 "), nl, Student(X,4),
Write(X), nl, fail.
GOAL
spisok.
: nl (new line)
(= ) fail , . , .
:
4
2. - , (!), , , .. -. , .
:
R:-A, B,!, C.
.
, 1 4- , spisok
spisok:- Student(X,4),!, Student(Y,_), X<>Y,
Write(X," - ",Y), nl, fail.
:
-
-
-