, . , , , , , . , , , , , ', , .
, , , . , , , . ( ) .
, . , , :
;
;
( ).
, , :
( ), , ' , ;
, , , , .
, , :
;
, , ;
, , .
. , :
, ;
, .
, , . . :
1. ³ . , .
Goal: =
=
2. , .
|
|
Goal: X=Y
=_1
Y=_1
3. .
_ =
4. , .
Goal: =
True
5. , , .
father (X) =father ()
X=
, ' , 2.1 .
/* 2.1 */
domains
title, author=symbol
pages=integer
publication=book (title, pages)
predicates
written_by (author, publication)
long_novel (publication)
clauses
written_by (".pa", book (" ", 560)).
written_by (".",book (" ", 608)).
long_novel (book (Title, Lngth)) :- written_by (_, book (Title, Length)), Length>600.
: written_by (X, Y). , Y , .
Y - , written_by (. 2.1,), ., Y book ( , 560). :
=. Y=book ( , 560)
2.1
, , , , , . ϳ =. Y=bk ( , 608) .
written_by (, book ( , Y)), , . 2.1,.
, ., . ᒺ ' , , , . , . book , , , (. 2.1,).
³ .. book, , . , , 608 Y. , :
= . Y = 608
, : long_novel (X). , (. 2.2).
|
|
2.2 long_novel (X)
ϳ . Title , . (. 2.2,).
- ᒺ book , . Title , Length 560.
ϳ , : Length>600. Length 560. : 560 > 600 , . written_by (_, book (Title, Length)), (. 2.2,), ' Title Length 608. : Length>600, . , , :
=
, .
ᒺ , , data ('''', 2, 1981) X X date (, 2, 1981), ', : data ('' April '', 2, 1981) date (Mo, Da, Yr).
. , , . (=). ᒺ, . ᒺ. , 䳿. , .
/* 2.2 */
domains
person = person (name,address)
name = name (first,last)
address = addr (street,city)
street = street (number,street_name)
city, street_name = string
first,last = string
number = integer
goal
P1 = person (name (,), addr (street (5,""), -)),
P1 = person (name (_, ) ,Address),
P2 = person (name (, ), Address), write (P2).