Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Sorry Ovid, but badguy CAN'T steal the gold. It's not possible with your rule set:
steals(PERP, STUFF) :- .... owns(VICTIM,STUFF), not(knows(PERP,VICTIM)). knows(badguy,merlyn). owns(merlyn,gold).
or in English:
* And the person doesn't know the person who owns the stuff they might steal.

On the other hand the badguy can steal your rubies:

?- steals(badguy,X). X = rubies Yes
and so can merlyn but only if we're allowed to add one more fact:
thief(merlyn). ?- steals(merlyn,X). Yes
I think you might want to meet merlyn really fast, and maybe get him to introduce you to badguy. :)


Update: Oops. Forgot that the PERP had to be a thief in order to be able to steal. Which would have meant that merlyn couldn't have stolen the rubies and I would have appeared to not have known what I was talking about. :) I've fixed this now of course.

In reply to Re: Who's a thief? by jarich
in thread Artificial Intelligence Programming in Perl by cjf

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (10)
    As of 2018-01-18 15:05 GMT
    Find Nodes?
      Voting Booth?
      How did you see in the new year?

      Results (212 votes). Check out past polls.