Loading ...
Sorry, an error occurred while loading the content.

FOL

Expand Messages
  • Rahul Kotamaraju
    hello, im new here. im not sure if the question im going to pose here has already been answered. in the logic section of AIMA code, how does ask-each
    Message 1 of 2 , Mar 29, 2004
    • 0 Attachment
      hello,

      im new here. im not sure if the question im going to pose here has
      already been answered.

      in the "logic" section of AIMA code, how does ask-each function (w.r.t
      FOL.lisp) work?
      Lets say ive created an fol-kb.
      (setq kb (make-fol-kb))
      (tell kb "Classroom(C1)")
      (tell kb "Classroom(C2)")
      (tell kb "IsBigger(C1,C2)")

      1.if i want to query the kb to ask/ask-each if Classroom C1 is bigger
      than C2 then how do I do it?
      2.the clauses that i have added above to the kb - are they in the
      right form?

      regards
      rahul
    • E etech058
      Hello rahul, Maybe my reply is too late, you have already solved it. In the file aima-lisp-code logic test-logic.lisp , it contains some how to use kb?
      Message 2 of 2 , Apr 20, 2004
      • 0 Attachment
        Hello rahul,
        Maybe my reply is too late, you have already solved it.

        In the file "aima-lisp-code\logic\test-logic.lisp", it contains some "how to use kb?" code. I think this code may be useful to you.
        Please attention to "ask-pattern".


        ===========quotation=======================
        "A family relationships knowledge base and problem."
        ((tell kb2 '(Mother Gerda Peter)))
        ((tell kb2 '(Father Torsten Peter)))
        ((tell kb2 '(Father Peter Isabella)))
        ((tell kb2 '(Father Peter Juliet)))
        ((tell kb2 '(=> (mother $x $y) (parent $x $y))))
        ((tell kb2 '(=> (father $x $y) (parent $x $y))))
        ((tell kb2 '(=> (and (parent $g $p) (parent $p $c)) (grand-parent $g $c))))
        ((ask-patterns kb2 '(grand-parent $x $y))
        '((Grand-parent Gerda Isabella) (Grand-parent Gerda Juliet)
        (Grand-parent Torsten Isabella) (Grand-parent Torsten Juliet)))

        "Now the 'Criminal' problem from [p 271-272]."
        ((setf kb3 (make-horn-kb)))
        ((tell kb3 "American(x) ^ Weapon(y) ^ Nation(z) ^ Hostile(z) ^ Sells(x,z,y)
        => Criminal(x)"))
        ((tell kb3 "Owns(Nono,M1)"))
        ((tell kb3 "Missle(M1)"))
        ((tell kb3 "Owns(Nono,x) ^ Missle(x) => Sells(West,Nono,x)"))
        ((tell kb3 "Missle(x) => Weapon(x)"))
        ((tell kb3 "Enemy(x,America) => Hostile(x)"))
        ((tell kb3 "American(West)"))
        ((tell kb3 "Nation(Nono)"))
        ((tell kb3 "Enemy(Nono,America)"))
        ((tell kb3 "Nation(America)"))
        ((ask kb3 "Criminal(West)") 't)
        ((ask-pattern kb3 "Criminal(x)" "x") 'West)

        )
        =============quotation end=====================



        kind regards
        chenyu (shanghai, china).



        -----Original Message-----
        From: Rahul Kotamaraju [mailto:rahul061278@...]
        Sent: 2004年3月30日 5:04
        To: aima-talk@yahoogroups.com
        Subject: [aima-talk] FOL

        hello,

        im new here. im not sure if the question im going to pose here has
        already been answered.

        in the "logic" section of AIMA code, how does ask-each function (w.r.t
        FOL.lisp) work?
        Lets say ive created an fol-kb.
        (setq kb (make-fol-kb))
        (tell kb "Classroom(C1)")
        (tell kb "Classroom(C2)")
        (tell kb "IsBigger(C1,C2)")

        1.if i want to query the kb to ask/ask-each if Classroom C1 is bigger
        than C2 then how do I do it?
        2.the clauses that i have added above to the kb - are they in the
        right form?

        regards
        rahul




        Yahoo! Groups Links
      Your message has been successfully submitted and would be delivered to recipients shortly.