[rules-users] Logic Problems & drools
MarkA
mail at cluttered.co.uk
Sat Aug 18 03:50:08 EDT 2007
I am a big fan of the logic problem puzzles (the ones with the grids) and
would like to play with drools to solve a few - just for a laugh and to see
if it can be done.
I found a pretty simple one:
----------------------------
Mrs. Robinson's 4th grade class took a field trip to the local zoo. The day
was sunny and warm - a perfect day to spend at the zoo. The kids had a great
time and the monkeys were voted the class favorite animal. The zoo had four
monkeys - two males and two females. It was lunchtime for the monkeys and as
the kids watched, each one ate a different fruit in their favorite resting
place. Can you determine the name of each monkey, what kind of fruit each
monkey ate, and where their favorite resting place was?
1. Sam, who doesn't like bananas, likes sitting on the grass.
2. The monkey who sat on the rock ate the apple. The monkey who ate the
pear didn't sit on the tree branch.
3. Anna sat by the stream but she didn't eat the pear.
4. Harriet didn't sit on the tree branch. Mike doesn't like oranges.
---------------------
But I can't get the logic working, has anyone done any other examples for
drools (or maybe converted the monkey & banana or cannibal ones from CLIPS)?
I have looked at the golf one in the examples but it's a bit simple. In that
one it uses variables for each bit $bobsColour etc. and then uses those in
later rules. I tried it with the one above but I kept needing to refer to a
variable that I hadn't yet defined and I couldn't define it as it needed to
refer to another one and so on...
Many thanks,
Mark.
--
View this message in context: http://www.nabble.com/Logic-Problems---drools-tf4278900.html#a12179098
Sent from the drools - user mailing list archive at Nabble.com.
More information about the rules-users
mailing list