
Chapter
12:
Performance Evaluation
of
Logic Programs
451
The initial state is <{query(X)},{}}, evaluate(query(X)).
It is important to note that this version of QSQ is very similar to Prolog. It
solves goals in a top-down fashion using recursion, and it considers the literals
ordered in the rule (the order is defined by the selection function). The impor-
tant differences with Prolog are: (i) The method is set-at-a-time instead of
tuple-at-a-time, through the generalized query concept, and (ii) as pointed out
in Dietrich and Warren [1985], the method uses a dynamic programming ap-
proach of storing the intermediate results and re-using them whe ...