[net.lang.prolog] Readers and Writers in Logic?

Beckerle%MIT-XX@sri-unix.UUCP (08/07/84)

From:  Michael J. Beckerle <Beckerle@MIT-XX>

A puzzle/philosophical problem.

The idea of Logic Programming as an executable specifications is very
appealing, and I am interested in finding out the limits to this. So
here is the classic Readers and Writers problem:

"Two kinds of concurrent processes, called readers and writers, share
a single resource. The readers can use the resource simultaneously,
but each writer must have exclusive access to it. When a writer is
ready to use the resource, it should be enabled to do so as soon as
possible. Readers and writers cannot use the resource at the same
time. The resource can only be granted to an active writer when there
are no running readers. To give priority to writers, wemake the
slightly stronger condition that the resource can only be granted to
an active reader when there are no active writers."

What I'd like to pose as a problem : write a logic program in any
logic language you wish (even if you have to make one up) which solves
the readers and writers program, and is an "executable specification"
of the solution. My specific intent is to rule out solutions based on
logic languages where "sequential AND" or other implicit devices are
used to get a working solution. The solution should be an EXPLICIT
specification.

The problem here of course is modeling time in the specification,
and my interest in the problem is simply to answer the question:
"can we talk about time in logic programs?". As a place to start,
all my attempts have been roughly like an AI program which has an
internal model of the state of the world, and given the state of
the inputs it deduces the new state of the world, and the appropriate
output responce.  However, I have not yet come up with a clean enough
"specification" of a solution.

-- Mike Beckerle