STRIPS in LISP:
Scott Douglas and Tristan O'Tierney
- What is STRIPS?
STRIPS is a planning algorithm. For a complete description of STRIPS, check a copy of the project page for this assignment that was written by Professor Van Wie.
- Code Breakdown:
strips.lisp - Implementation of the STRIPS algorithm.
debug/* - Test files that define goal states, start states, and operators for a particular problem.
debug/petfood.lisp - Doris wants to go on vacation, but she has to feed her pets first. She's out of pet food.
debug/beer.lisp - The most basic test program. You just want to go to the store and get some beer.
debug/getajob.lisp - Aloysus wants a job, but their are some things he needs to do first. This example forces backtracking.
debug/blocks.lisp - You want to stack blocks with A on top of B on top of C on top of the table.
unify.lisp - Unification code that was given to us.
unify-one-pc.lisp - Unifies one precondition with the knowledge base. This code was also given to us.
unify-all.lisp - Loops over the precondition list to try and unify all of them.
- Example Output:
bash-2.05$ clisp
Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2004
[1]> (load 'strips.lisp)
;; Loading file strips.lisp ...
;; Loading file unify.lisp ...
;; Loaded file unify.lisp
;; Loading file unify-one-pc.lisp ...
;; Loaded file unify-one-pc.lisp
;; Loading file unify-all.lisp ...
;; Loaded file unify-all.lisp
;; Loaded file strips.lisp
T
[2]> (load 'debug/petfood.lisp)
;; Loading file debug/petfood.lisp ...
;; Loaded file debug/petfood.lisp
T
[3]> (strips (list start-state goal-state operators))
((GOTO DORIS HOME STORE) (BUY DORIS TICKET) (BUY DORIS MAYONNAISE) (BUY DORIS TUNA)
(GOTO DORIS STORE HOME) (MAKE DORIS CATFOOD) (FEED DORIS MITTENS) (GOTO DORIS HOME STORE)
(BUY DORIS DOGFOOD) (GOTO DORIS STORE HOME) (FEED DORIS FIDO) (LEAVE-FOR-VACATION DORIS))
[4]> (load 'debug/beer.lisp)
;; Loading file debug/beer.lisp ...
;; Loaded file debug/beer.lisp
T
[5]> (strips (list start-state goal-state operators))
((GOTO STORE) (BUY BEER))
[6]> (load 'debug/blocks.lisp)
;; Loading file debug/blocks.lisp ...
;; Loaded file debug/blocks.lisp
T
[7]> (strips (list start-state goal-state operators))
((PICKUP BLOCKC BLOCKB) (PUTDOWN BLOCKC TABLE) (PICKUP BLOCKB TABLE)
(PUTDOWN BLOCKB BLOCKC) (PICKUP BLOCKA TABLE) (PUTDOWN BLOCKA BLOCKB))
[8]> (load 'debug/getajob.lisp)
;; Loading file debug/getajob.lisp ...
;; Loaded file debug/getajob.lisp
T
[9]> (strips (list start-state goal-state operators))
((GET ALOYSUS HAIRCUT) (WRITE ALOYSUS RESUME) (APPLY ALOYSUS NIMRODYNE)
(GOTO ALOYSUS HOME NIMRODYNE) (INTERVIEW ALOYSUS NIMRODYNE))
[10]>
Download strips.tar to view the LISP code. We tested it in clisp.