This is an old revision of the document!
Table of Contents
How to register and achieve a new goal
A plan for a new goal
Let's assume we wanna write a plan to achieve a new goal, e.g. to flip a pancake. Best practice is to put this plan into one of the source-files of a plan library, e.g. cram_plan_library:
(def-goal (achieve (flip-pancake ...)) (with-designators ((action-desig (action `((to flip)))) ...) ... (perform action)))
If you want other packages to also use this plan, export the goal-symbol in the package.lisp of the your plan library. Make sure to also export all designator properties used in your plan:
(desig-props:def-desig-package cram-plan-library ... (:export #:... #:flip-pancake ...) (:desig-properties #:to #:flip ...))
Now comes the catch: You also need to export the goal-symbol from the package cram_plan_knowledge. cram_plan_knowledge provides the functionality (holds …) which checks whether a goal has already been achieved. Thus, it needs to also needs to know about the correct symbol of :flip-pancake. Unfortunately, our plan library depends on