.


:




:

































 

 

 

 


. 1. :




1. :

(, ).

(, ).

(, ).

(, ).

().

().

_().

_().

) , ;

) ;

) .

 

2. :

(, ).

(, ).

(, ).

(, ).

().

().

_().

_().

) , ;

) ;

) .


:

1) ;

2) ;

3) ;

4) ;

5) .

1.5 : fail .

fail - , . . fail .

- , (!), , , .. -. , .

, p:- p1, p2,!, p3.

p1 p2, .

 

1

: student(, ). , 1- .

:

PREDICATES

student(symbol,integer)

spisok

CLAUSES

student(vova,3).

student(lena,1).

student(dima,1).

student(ira,2).

student(marina,1).

spisok:-student(X,1),write(X),nl,fail.

GOAL

write(" 1-"),nl,spisok.

:

1-

lena

dima

marina


2

father(name, name). , .

:

DOMAINS

name=symbol

PREDICATES

father (name, name)

everybody

CLAUSES

father ("", "").

father ("", "").

father ("", "").

everybody:- father (X, Y),

write(X," - ",Y,""),nl,

fail.

GOAL

everybody.

:

-

-

-

3

, . : , .

) .

:

DOMAINS

nom=integer

p, t=string

PREDICATES

poezd(nom,p,t)

CLAUSES

poezd(233,moskva,"12-30").

poezd(257,moskva,"22-40").

poezd(133,armavir,"10-20").

poezd(353,armavir,"20-40").

poezd(353,adler,"02-30").

poezd(413,adler,"11-10").

poezd(256,piter,"21-30").

GOAL

write(" "), nl,

write(" "),

nl, poezd(N,P,T), write(N," ",P," ",T),nl,fail.






:


: 2015-09-20; !; : 938 |


:

:

, .
==> ...

1558 - | 1355 -


© 2015-2024 lektsii.org - -

: 0.008 .