%
backliteraK isa[X,Y), (X:object], []):-
member Y, [polygon,convex_poly,stable_poly,unstable_poly,triangle,
rectangle, trapezium, unstable_triangle, hexagon]). % Y -
%
backliteraK support (X, Y), [X:object, Y:object], []). backliteraK touch(X,Y), [X:object, Y:object], []). backliteral (not C -, [X: object, Y: object], [)):-G = touch(X,Y); G = support(X,Y),
prolog_predicate(isa [X,Y)). prolog^predicate(support(xrY)). prolog_predicate(touch(X,Y)).
prolog__predicate(not G).
ako(polygon, convex_poly>. %
ako(convex poly, stable_poly). I
% ako< convex_poly, unstablejpoly!. *
% aicof stable poly, triangle), %
% ako(stable_poly, rectanple). *
% ako(Stable poly, trapezium). ■
% akot unstable_poly, unstable_triangle). % ako{ unstable poly, hexagon). I
akoi rectangle, X):-
member! X, [alr aZ, , 4,5,,2,,, 5, cl,c2, I ).
akoC triangle, 4).
ako(unstable_triangle, c5).
isa zFigurel, FigureZ):- I Figure2, Figure!).
% % , %
4 Figure 1 Figure2
isa(FigO, Fig):-ako{ Figl, FigO), isa(Figl, Fig).
support(al,cl). support Ca3,c3). support (a.4, c4). support(45,c5).
support lbl,cl). support (b3,c3). support(b4, c4). support(b5,c5)■
touch (a3,b3)
st.art_clause[ [arch (X, Y, Z) ] / [X: object, Y: object, Z: object) I-
19.
ex<arch(al,bl,cl)).
. (arcri<a4,b4,c4)).
next arch [2,2,2)). nex(arch(a3,b3, c3) ). next arch (a5, bS,c5) >. (arch{al,b2,cl)). next arch(a2,bl,cl))
■ (ILP) .
■ ILP , . , ILP .
■ ILP : -, , , -, , , -, .
|
|
■ , .
■ ( Prolog), - .
() ().
■ : -, , , -, , , -, .
■ - , .
■ HYPER, , Prolog , .
■ :
;
;
;
;
-;
.
476 II. Prolog