Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

New to Common Lisp

Name: Anonymous 2012-08-23 8:00

Hi!

I'm new to Common Lisp, and starting to know the basics. Can you explain why this code yields NIL?

(define (domain shakeyworld)
(:action Go
:parameters (?x ?y ?r)
:precond (and (At Shakey ?x) (In ?x ?r) (In ?y ?r))
:effect (and (At Shakey ?y) (not (At Shakey ?x)))))

(define (problem test)
(:domain shakeyworld)
(:objects (Shakey) (A) (B) (Room))
(:init (At Shakey A) (In A Room) (In B Room))
(:goal (At Shakey B)))

Name: Anonymous 2012-08-23 8:06

Uh oh. I don't think that's Common Lisp.
; in: DEFINE (DOMAIN SHAKEYWORLD)
;     (?X ?Y ?R)
;
; caught WARNING:
;   undefined variable: ?R

;     (AT SHAKEY ?X)
;
; caught WARNING:
;   undefined variable: ?X

;     (?X ?Y ?R)
;
; caught STYLE-WARNING:
;   undefined function: ?X
;
; caught WARNING:
;   undefined variable: ?Y

;     (:ACTION GO :PARAMETERS (?X ?Y ?R) :PRECOND
;      (AND (AT SHAKEY ?X) (IN ?X ?R) (IN ?Y ?R)) :EFFECT
;      (AND (AT SHAKEY ?Y) (NOT (AT SHAKEY ?X))))
;
; caught STYLE-WARNING:
;   undefined function: :ACTION

;     (AT SHAKEY ?X)
;
; caught STYLE-WARNING:
;   undefined function: AT

;     (DEFINE (DOMAIN SHAKEYWORLD)
;      (:ACTION GO :PARAMETERS (?X ?Y ?R) :PRECOND
;       (AND (AT SHAKEY ?X) (IN ?X ?R) (IN ?Y ?R)) :EFFECT
;       (AND (AT SHAKEY ?Y) (NOT (AT SHAKEY ?X)))))
;
; caught STYLE-WARNING:
;   undefined function: DEFINE

;     (DOMAIN SHAKEYWORLD)
;
; caught STYLE-WARNING:
;   undefined function: DOMAIN

;     (:ACTION GO :PARAMETERS (?X ?Y ?R) :PRECOND
;      (AND (AT SHAKEY ?X) (IN ?X ?R) (IN ?Y ?R)) :EFFECT
;      (AND (AT SHAKEY ?Y) (NOT (AT SHAKEY ?X))))
;
; caught WARNING:
;   undefined variable: GO

;     (IN ?X ?R)
;
; caught STYLE-WARNING:
;   undefined function: IN

;     (AT SHAKEY ?X)
;
; caught WARNING:
;   undefined variable: SHAKEY

;     (DOMAIN SHAKEYWORLD)
;
; caught WARNING:
;   undefined variable: SHAKEYWORLD
;
; compilation unit finished
;   Undefined functions:
;     ?X :ACTION AT DEFINE DOMAIN IN
;   Undefined variables:
;     ?R ?X ?Y GO SHAKEY SHAKEYWORLD
;   caught 6 WARNING conditions
;   caught 6 STYLE-WARNING conditions

debugger invoked on a UNBOUND-VARIABLE in thread
#<THREAD "main thread" RUNNING {10029A8BC3}>:
  The variable SHAKEYWORLD is unbound.

Type HELP for debugger help, or (SB-EXT:QUIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(SB-KERNEL::UNBOUND-SYMBOL-ERROR-HANDLER
 #<unavailable argument>
 #.(SB-SYS:INT-SAP #X7FFFF6E2F6D0)
 #<SB-ALIEN-INTERNALS:ALIEN-VALUE :SAP #X7FFFF6E2F100 :TYPE (*
                                                             (STRUCT
                                                              SB-VM::OS-CONTEXT-T-STRUCT))>
 (21))
0]

Name: Anonymous 2012-08-23 8:21

I'm using some kind of planner with the code. The launch command looks like this from LispWorks:

(run-HSP 'test 'shakeyworld)

The code definitly compiles and executes for me. It is just that the planner doesn't find the obvious plan (Go Shakey B). It says that there is no possible solution.

Name: Anonymous 2012-08-23 8:23

I mean of course (Go A B Room).

Name: Anonymous 2012-08-23 8:33

Post your full session and the sauce of the run-HSP code. Your problem is really that the app is not working and w/o the sauce no can help.

Name: Anonymous 2012-08-23 8:48

The source of the surrounding projects are huge. I doubt both that it's the broken piece and that you would want to trouble shoot it. Does it help to mention that this is supposed to be in PDDL? Otherwise I thank you for your interest in my problem.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List