
Chapter 12: Performance Evaluation of Logic Programs 497
ment of length 2 in up, and so on. In this way we generate all such paths with
a segment of length i in up where i = 1 to min((h
up
—(h'
up
-
h
,
up
down))down)- To
see we note
^at
we
begin with answers that are at a
distance h
r
down
from "John," and "John" is h'
up
levels from the the lowest
level of up. Thus we can extend the answers by up to \
P
~Q^'
up
~^'
up
.^
ww
) arcs
in up, and by up to h'
down
levels in down. Since the segments in up and down
must be equal in any valid extension, the lower of these two values denotes the
length of the longest possible extension.
Each such extension represent ...