[net.lang.prolog] The Proposed Solution For `is-all'

v.Bijan%UCLA-LOCUS@sri-unix.UUCP (10/16/83)

From:  Bijan Arbab <v.Bijan@UCLA-LOCUS>

Thank you for sending me the solution, However I believe there
are two important points that need to pointed out about your
solution and in general about all solutions that are along the
same path.

1.  What if there are two assertions in the world of the same
    type ?! I.e.

      p(a)
      p(b)
      p(c)
      p(a)

The correct answer would have to be the list `a.b.c.a.nil',
your solution will return the list `a.b.c.nil'.

2.  If you are thinking about solving the problem, please note
    the following:

in the goal  is-all(A,Y,Q)   Q can be a complex goal consisting
of conjunction of other goals and we are interested in the Y
terms that accrue in Q only. E.g. if the goal is

               is-all(A,F,p(A)&p(A,B,C)&p(A,C,F))

Then list A is collection of all F's such that

               p(A)&p(A,B,C)&p(A,C,F) is true.

In general I believe the pure and efficient solution to this problem
would involve functions that are not currently available in prolog,
namely Data Abstraction. Hideyuki Nakashima and Norihisa Suzuki have
written a paper on the subject that appeared in New Generation
Computing which is An International Journal on Fifth Generation
Computers.

In short, for our problem, we need a way of naming a goal and then
asking for the next solution to the goal whenever we need one. The
NPO function proposed in that paper would do the job. But
unfortunately it is not available in any implementation of Prolog.
I do not see an easy way of building one either ! 

-- Bijan