anchor.diff:  ;;; Expert System Shell (Jess). This is a pretty good test of LISA's MP
   ;;; support.
   
  -;;; $Id: pumps.lisp,v 1.2 2001/05/07 15:49:23 youngde Exp $
  +;;; $Id: pumps.lisp,v 1.3 2001/05/07 15:53:31 youngde Exp $
   
   (in-package "LISA-USER")
   
  
positive.code: (defrule warn-if-high ()
    (tank (name ?name) (:object ?tank))
    (test (and (high-p ?tank) (intact-p ?tank)))
    (not (high-level-warning (tank ?tank)))
    =>
    (assert (high-level-warning (tank ?tank)))
    (format t "Warning: Tank ~S is high!~%" ?name))
  
  (defrule lower-rate-if-high ()
    (?warning (high-level-warning (tank ?tank)))
    (pump (name ?name) (flow-rate ?flow-rate (plusp ?flow-rate))
          (:object ?pump))
    =>
  
negative.code: (defimport pump (lisa-user::pump) ())
  (defimport tank (lisa-user::tank) ())
  
  (deftemplate tank-level-warning
    (slot tank)
    (slot type))
  
  (defrule warn-if-low ()
    (tank (name ?name) (:object ?tank))
    (test (and (low-p ?tank) (intact-p ?tank)))
    (not (tank-level-warning (tank ?tank) (type low)))
    =>
    (assert (tank-level-warning (tank ?tank) (type low)))
    (format t "Warning: Tank ~S is low!~%" ?name))
  
  (defrule raise-rate-if-low ()
    (?warning (tank-level-warning (tank ?tank)))
    (pump (name ?name) (tank ?tank) (flow-rate ?flow-rate (< ?flow-rate 25))
          (:object ?pump))
    =>
  