[net.lang.prolog] Breadth First Searching and Databases

Faustus%UCBernie%Berkeley@sri-unix.UUCP (11/13/83)

From:  Wayne A. Christopher <Faustus%UCBernie@Berkeley>

Is there a simple way to do breadth-first searching in Prolog ?
As a concrete example, say I want to write a predicate
equiv(Expr1, Expr2) where Expr2 is to be a mathematical expression
equivalent to Expr1. (E.g., Expr1 = x + y, Expr2 = 1 * (x + y)) If
you try to implement this as a set of rewriting rules, you seem to
always get stuck in infinite loops. Is this problem fundamental to
the theoretical basis of Prolog, or is there some easy and/or
natural way to, in the example above for instance, get all
possible expressions enumerated with the shorter expressions
first ?

As for the modular database question, I must confess that I did
not consider very carefully what sort of "extra control" it
would provide. From the responses to this, I gather that among
the Prologs that currently support this, the major adventages
consist of differing contexts and subcontexts for evaluation. In
the same area, are there any implementations that support
multiple stacks and substacks ?

-- Wayne Christopher