[comp.lang.prolog] Ignorant question about Logic and prolog

franklin@convex.com (Rick Franklin) (06/12/91)

Is prolog an appropriate language to solve "logic" problems commonly found
in crossword puzzle books?  You know, the type that give clues like:

1).	Fran bought her pet before Mrs. Snodgrass.

2)	The cat was the last animal purchased.

3)	John's pet was not a dog.

4)	etc. etc, until just enough info is given to deterimine which pet
	goes with which human, how first and last names are related, or
	whatever other relations are to be solved.

I am interested in feeding the data into some program to determine the answers,
and also to determine the path of reasoning for the answers.  Should
I look into prolog?  If so, how difficult would it be to write a program that
could do this?


Rick Franklin
Convex Computer Corp
franklin@convex.com

Jens.Rettig@arbi.informatik.uni-oldenburg.de (Jens Rettig) (06/13/91)

Generally , Prolog is capable of solving those kind of probelms
quite easily. You just have to think of a way of representing the
facts you have and the rules that have to be obeid. But it is a little
to complicated to explain if you know nothing about prolog.
However, Prolog is easy to learn and should provide you with the Skills
to do such things quite early !

greetings,

Jens Rettig
University of Oldenburg

als@bohra.cpg.oz.au (Anthony Shipman) (06/14/91)

In article <5828@uniol.UUCP>, Jens.Rettig@arbi.informatik.uni-oldenburg.de (Jens Rettig) writes:
> Generally , Prolog is capable of solving those kind of probelms
> quite easily. You just have to think of a way of representing the
> facts you have and the rules that have to be obeid. But it is a little
> to complicated to explain if you know nothing about prolog.
> However, Prolog is easy to learn and should provide you with the Skills
> to do such things quite early !

I suspect that formulating such problems in Prolog is the lion's share of the
problem.  The rest is just mechanical and can usually be done with pencil and
paper quite easily.
-- 
Anthony Shipman                 "You've got to be taught before it's too late,
Computer Power Group             Before you are six or seven or eight,
19 Cato St., East Hawthorn,      To hate all the people your relatives hate,
Melbourne, Australia             You've got to be carefully taught."  R&H

hawley@icot31.icot.or.jp (David John Hawley) (06/17/91)

In article <1991Jun14.130850.13707@bohra.cpg.oz.au> als@bohra.cpg.oz.au (Anthony Shipman) writes:
>In article <5828@uniol.UUCP>, Jens.Rettig@arbi.informatik.uni-oldenburg.de (Jens Rettig) writes:
>> Generally , Prolog is capable of solving those kind of probelms
>> quite easily. You just have to think of a way of representing the
>> facts you have and the rules that have to be obeid. But it is a little
>I suspect that formulating such problems in Prolog is the lion's share of the
>problem.  The rest is just mechanical and can usually be done with pencil and
>paper quite easily.

Formulating the problems so they can be solved efficiently can be a little
tricky. In any case, there are a set of standard techniques.  Some extensions
of LP languages, e.g. constraint logic programming langs, do almost all of the
work for you. 

I'm sure both of the above posters would agree that the big win is that LP
and CLP languages can solve problems with search spaces bigger than feasible
for humans, i.e. problems found outside of puzzle books.

David Hawley
-- 
Location: 4th-lab, ICOT, 1-4-28 Mita, Minato-ku Tokyo 108 JAPAN.
EMail: hawley@icot.or.jp, hawley@icot.jp@relay.cs.net,
       uucp:{enea,inria,kddlab,mit-eddie,ukc}!icot!hawley