Sample PRODIGY Control Rules

;;;
;;; Given two operators from which to choose, prefer the more specific one. An
;;; operator is more specific than another if its primary results are more
;;; specific than the primary results of the other. Finally, one resultunt
;;; state is more specific than another if the two share the same predicate,
;;; and all corresponding arguments are more specific via the domain's type
;;; hierarchy. For example (is-deployed division-ready-brigade saudi-arabia) is
;;; more specific than (is-deployed troops location); whereas, neither
;;; (is-deployed troops saudi-arabia) nor (is-deployed division-ready-brigade
;;; location) can be said to be more specific than the other.
;;;
(CONTROL-RULE Prefer-More-Specific-Op
(if
(and (candidate-operator &ltOP1&gt)
(candidate-operator &ltOP2&gt)
(is-ancestor-op-of-p &ltOP1&gt &ltOP2&gt)))
(then prefer operator &ltOP1&gt &ltOP2&gt)
)
;;;
;;; Given a choice between two goals, prefer one if making the other true
;;; solves one of the preconditions for an operator that results in the
;;; preferred one (or is likewise further removed). That is, G2 is a subgoal of
;;; G2. Note that ordinarily subgoals are not present in a top-level goal
;;; conjunction; however, humans often provide subgoal information in a mission
;;; statement. Therefore both goal and subgoal statements can be in the
;;; top-most set of goals received from ForMAT.
;;;
;;; This control-rule assures that the goal trees created during planning will
;;; be maximaly deep and fewest in number. For example if we have two goals,
;;; (is-secure airport4) and (exists ((&lts-p&gt security-police))(is-deployed
;;; &lts-p&gt Bosnia), then PRODIGY should prefer the first to the second.
;;; Solving for them in this order results in one goal tree, rather than two.
;;;
(CONTROL-RULE Prefer-Top-Most-Goal
(if
(and (candidate-goal &ltG1&gt)
(candidate-goal &ltG2&gt)
(solves-precondition-of-p &ltG1&gt &ltG2&gt)))
(then prefer goal &ltG1&gt &ltG2&gt)
)
;;;
;;; Given a current operator and candidate set of bindings, prefer those
;;; bindings that opportunistically solve some other top-level goal. For
;;; example, if the current operator is to secure an airport, then we want to
;;; prefer bindings for &ltinternal-security-force&gt that match a concurrent goal
;;; to deploy some security-police to the same location.
;;;
(control-rule Prefer-Bindings-Opportunistically
(if (and
(current-operator &ltOP&gt)
(candidate-bindings &ltCB&gt)
(match-constraining-goals &ltG&gt &ltOP&gt)
(generate-new-bindings &ltB&gt &ltG&gt &ltOP&gt)
(identify-worse-bindings &ltCB&gt &ltB&gt &ltWB&gt &ltOP&gt)
(identify-better-bindings &ltCB&gt &ltB&gt &ltBB&gt &ltOP&gt)))
(then prefer bindings &ltBB&gt &ltWB&gt))