.


:




:

































 

 

 

 


I. Prolog





 


grandparent; X, Z):-parent (X, Y), parent (Y, Z).

sister (. 1.4) :

X Y

X Y,

1) X Y

2) X - .

parent / \ parent

female f X J { Y)

sister

, 1.4. sister

, . 1.4, Prolog : sister(X, Y):~parent (Z, X), parent* Z, 1), female<X>.

, "X Y ". : Z X, & Z Y. , : 21 X, Z2 Y Z1 Z2.

:?- sister< arm, pat).

"yes", (. . 1.1). , sister , , . , , :?- sister {X, pat).

Prolog , .

X ■- arm; X - pat

, ?! -, sister. , , Prolog . , X Y , X Y. , Prolog ( ) , X Y , , , , .

, , X Y . , , , Prolog different different (X, Y)


1. Prolog



, X Y . sister : sister) X, Y):-

parent (Z, x':

female! X), different (X Y). .

Prolog , .

Prolog : , .

, .

, ,

, , .

Prolog . , . .

, . . () .

. .

, , " ". , . ,

hasachildi X):- parent (X, Y).

. ) Y,

X Y, X . ) X,

X ,

Y, , X Y.

1.3. Prolog.

) , , ( happy
).

) X, X , , X
( hastwochildren).

1.4. grandchild parent. : grandparent (. . 1.8).

1.5. aunt (X, Y) parent sister. , aunt (), . 1.3.

34 I. Prolog






:


: 2015-10-01; !; : 585 |


:

:

- , .
==> ...

1739 - | 1552 -


© 2015-2024 lektsii.org - -

: 0.012 .