Actually I'm not sure how complicated your clauses can become, I'm a bit too busy to dive in now.

But the example given in the OP should be solvable by filling 3 zeros for each clause and applying simple deduction rules on the 3x3 cuts.

I think the strength of prolog comes to play if you apply more complicated rules.

Please don't take this as a critic of your work, just theoretical observations. :)

update

Applying the rules given on a 3x3x3 matrix displayed by 3 cuts by name:

FRUITS PROFESSIONS NAMES W B F pineapples apples 0 0 John pears 0 0 0 pineapples 0 apples 0 0 0 Patrick pears 0 pineapples 0 0 0 apples 0 0 0 James pears 0

Deductions:

FRUITS PROFESSIONS NAMES W B F pineapples 0 0 0 apples 1 0 0 John pears 0 0 0 pineapples 0 apples 0 0 0 Patrick pears 0 pineapples 0 0 0 apples 0 0 0 James pears 0 0

Deductions:

FRUITS PROFESSIONS NAMES W B F pineapples 0 0 0 apples 1 0 0 John pears 0 0 0 pineapples 0 0 apples 0 0 0 Patrick pears 0 0 0 pineapples 0 0 0 apples 0 0 0 James pears 0 1 0

I did it manually, hope everything is right and I made the technique of a solver clearer.

I think you need more complicated rules to challenge people and take advantage of the power of prolog. :)

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Wikisyntax for the Monastery


In reply to Re^4: My first cpan module - App::ForKids::LogicalPuzzleGenerator (updated) by LanX
in thread My first cpan module - App::ForKids::LogicalPuzzleGenerator by pawel.biernacki

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.