Information Technology Reference
In-Depth Information
Figure 6.11.
Interpreting the edges in figure 6.7
polyinterp.pl
solution(AB,BC,CD,DE,EF,FG,GH,HA,HI,IB,IJ,JC,JK,KD,KF) :-
lvertex(AH,AB), arrow(BA,BI,BC), fork(CB,CD,CJ),
arrow(DC,DK,DE), lvertex(ED,EF), arrow(FE,FK,FG),
lvertex(GF,GH), arrow(HG,HI,HA), fork(IH,IB,IJ),
arrow(JK,JC,JI), fork(KD,KF,KJ),
reverse(AB,BA), reverse(BC,CB), reverse(CD,DC),
reverse(DE,ED), reverse(EF,FE), reverse(FG,GF),
reverse(GH,HG), reverse(HA,AH), reverse(HI,IH),
reverse(IB,BI), reverse(IJ,JI), reverse(JC,CJ),
reverse(JK,KJ), reverse(KD,DK), reverse(KF,FK).
print_lshape_interpretation :-
solution(AB,BC,CD,DE,EF,FG,GH,HA,HI,IB,IJ,JC,JK,KD,KF), nl,
write(AB), write(BC), write(CD), write(DE), write(EF),
write(FG), write(GH), write(HA), write(HI), write(IB),
write(IJ), write(JC), write(JK), write(KD), write(KF).
that in each case the edge leaving the vertex is used. For vertex A, for example,
lvertex(AH,AB) is used, and not lvertex(HA,AB) or lvertex(AH,BA) . (Since an edge
connects two vertices, each direction of the edge will be used exactly once in the
eleven atoms.) Loading this program together with the one in figure 6.10 produces
the following behavior:
?- print_lshape_interpretation.
>>>>>>>>+++-+++
;
>>>>-->>+++-+++
;
---->>>>+++-+++
;
>>>>>>--+++-+++
;
No
So four visual interpretations are found. These are shown graphically in figure 6.12.
They all agree on the internal edges HI, IB, IJ, JC, JK, KD, and KF. The first interpreta-
tion (top left of figure 6.12) is the one depicted in figure 6.7, where all the remaining
edges are boundaries. In the next interpretation (top right of figure 6.12), the object
is seen as up against a wall (or another object) behind it, with EF and FG as concave
edges between two surfaces. In the third interpretation (bottom right), the object is
seen as against a wall on the left, with AB, BC, CD, and DE as concave. Finally, in the
last interpretation (bottom left), the object is seen as resting on another, with GH and
HA as concave. Note that if the edge BC is concave (as in figure 6.12, bottom right),
the edges AB, CD, and DE cannot be boundaries; they, too, must be concave. Note
Search WWH ::




Custom Search