: , .
:
1. . , .
2. p(X,Y), X, Y 1 8.
) step_hourse(P1,P2), P1 P2. , P1 , P2 . ,
? step_hourse(p(1,1),P).
P=p(3,2);
P=p(2,3)
no
) path_horse(Path,N), Path N , . Path . path_horse, , p(2,1), (Y=8). P(5,4).
: 1 , .
ϳ path_horse , .
:
1. Turbo-Prolog.
2. ?
7 (4 )
: Prolog .
: .
:
1. , 䒺:
class(Number, positive):Number>0.
class(Number, zero):Number=0.
class(Number, negative):Number<0.
.
2. devide(Numbers,Positive,Negative), : , 䒺 , 䒺 . ,
devide([3,-1,0,5,-2],[3,0,5],[-1,-2])
: , .
3. , :
difference(Set1, Set2, Diff)
. ,
difference([a,b,c,d], [b,d,e,f], [a,c])
4. un(L1,L2,L) L1 L2 L. ,
?- un([2,5,6,6,8],[1,3,5,9],L)
L=[1,2,3,5,5,6,6,8,9]
:
1. , ?
2. ?
3. ?
8 (2 )