From: Nathan A. Ferch
Subject: A CLOS question
Date: 
Message-ID: <repost.35326438.57AFE5D5@csd.uwm.edu>
Hello,

Can someone help me out here?
I'm working on this CLOS program in which I have a
monkey at Position1 with a height1, some hanging bananas
at Position2 at a height2, and one or more boxes at
Position2 and/or Position3 each with a height3.
The goal of this program is for the monkey to grasp
the bananas. In order to do this, he must stack the
boxes, climb them, and then grasp the bananas. (For a
more detailed description, please see:
www.cs.uwm.edu/~mcroy/422/Assignments/project5.html,
although, all the functions listed there are just
suggestions). Can someone tell me what I'm doing wrong
in the following code? And what do I do to correct it?

Please e-mail responses to: ········@hotmail.com

Thanks in advance!

Jen

;; here's the code

(defclass monkey ()
 (
  (position :initform Pos1
     :accessor goto-monkey-position)
  (height   :initform h1)
  (hands    :initform empty
     :accessor goto-boxes)))

(defclass boxes ()
 (
  (position :initform pos
     :accessor goto-box-position)))

(defmethod goto (monkey position)
 (if (equal monkey Pos1) Pos2 (prin1 "monkey is going to position 2")
  (if (equal monkey Pos2) Pos3 (prin1 "monkey is going to position 3")
   (climb monkey) (prin1 "monkey is climbing the boxes")))

(defmethod grasp (monkey bananas)
 (setf box-height h3)
  (if (equal h1 box-height) (prin1 "monkey is grasping bananas. monkey
wins!")))

(defmethod climb (monkey boxes)
 (if (equal monkey-Pos3 box-Pos3)
  (if (equal h1 total-box-height)
   (prin1 "monkey is climbing the boxes."))))

(defmethod stack (monkey box1 box2)
 (if (equal hand-contents box1) (prin1 "monkey is stacking box1 onto
box2")
  (setf box-height h3))))

(defmethod pickup (monkey box)
 (if (equal hand-contents empty) (prin1 "monkey is picking up box1")))
From: Steve Gonedes
Subject: Re: A CLOS question
Date: 
Message-ID: <6gunii$5ug@bgtnsc02.worldnet.att.net>
"Nathan A. Ferch" <··@csd.uwm.edu> writes:

 
< Hello,
< 
< www.cs.uwm.edu/~mcroy/422/Assignments/project5.html,
< although, all the functions listed there are just
< suggestions). Can someone tell me what I'm doing wrong


-------------------------

FORBIDDEN

You don't have permission to access /~mcroy/422/logicTutorial.ascii on this
server.

-------------------------

Where might this prolog interpreter be?
/users/classes/cs422/instructor.mcroy/Project3 is a little bit vague;
I am assuming it must be on the server that kept insisting for a
password.

Just wanted to see how the math was implemented. What book is your
class using? The interpreter doesn't use eval/apply/funcall to
implement the math does it? Or does it somehow use the pseudo-prolog
to define the operations? I don't see how it could be done without
some kind of number primitive that was built into the interpreter (but
I'm not very good with logic - which led to my asking).

Which makes me wonder (for no apparent reason) if a mathematical
predicate is used to precede the actual clause. If I had the courage
to mention efficiency (perhaps I have seen one too many messages about
FP benchmarks lately) and ask for an _estimate_ (don't feel obligated
to go and declare everything to be type symbol now :) of the
LIPS you get?