.


:




:

































 

 

 

 


Clauses. , , :




f(X,10):- X < 10.

f(X,20):- X >= 10, X < 20.

f(X,30):- X >= 20.

, , :

goal: f(5,Y), Y > 20.

f(5,Y), Y 10, 10 > 20. . , , , .

f . , , , . , , , -, . cut(!). :

 

Predicates

F(integer,integer).

Clauses

f(X,10):- X < 10,!.

f(X,20):- X >= 10, X < 20,!.

f(X,30):- X >= 20.

cut , . , :

goal: f(22,Y),

- , ' 30. . , :

Predicates

F(integer,integer).

Clauses

f(X,10):- X < 10,!.

f(X,20):- X < 20,!.

F(X,30).

.

cut 䳺 . , :

goal: a(X),b(Y),!,c(X,Y,Z)

- cut , (X) i b(Y) . ϳ , cut , " " " b ", " " .

cut:

 

Predicates

Buy_car(symbol, symbol)

Car(symbol, symbol,integer)

Colors(symbol, symbol)

Clauses

buy_car(Model, Color):- car(Model, Color, Price),

colors(Color, sexy),!,

Price < 25000.

Car(maserati, green, 25000).

Car(corvette, black, 24000).

Car(corvette, red, 26000).

Car(porsche, red, 24000).

Colors(red, sexy).

Colors(black, mean).

Colors(green,preppy).

cut , , .

䳿 cut . .

: - a,b.





:


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


:

:

- , .
==> ...

1731 - | 1542 -


© 2015-2024 lektsii.org - -

: 0.011 .