#| ******************************************************************************* PRODIGY Version 2.01 Copyright 1989 by Steven Minton, Craig Knoblock, Dan Kuokka and Jaime Carbonell The PRODIGY System was designed and built by Steven Minton, Craig Knoblock, Dan Kuokka and Jaime Carbonell. Additional contributors include Henrik Nordin, Yolanda Gil, Manuela Veloso, Robert Joseph, Santiago Rementeria, Alicia Perez, Ellen Riloff, Michael Miller, and Dan Kahn. The PRODIGY system is experimental software for research purposes only. This software is made available under the following conditions: 1) PRODIGY will only be used for internal, noncommercial research purposes. 2) The code will not be distributed to other sites without the explicit permission of the designers. PRODIGY is available by request. 3) Any bugs, bug fixes, or extensions will be forwarded to the designers. Send comments or requests to: prodigy@cs.cmu.edu or The PRODIGY PROJECT, School of Computer Science, Carnegie Mellon University, Pittsburgh, PA 15213. *******************************************************************************|# (setq *OPERATORS* '( (GET-ORDERED-OBJECT ;; ;; for an object on the requisition (order), decrement the ;; quantity remaining, and generate one instance of it. ;; (params ()) (preconds (and (class ) (order ) (decrement 1 ) (is-name ))) (effects ((del (order )) (if (plusp ) (add (order ))) (add (instance ))))) (ADD-NEW-OBJECT-TO-ORDER ;; ;; for an object which is not on the requisition, ;; instantiate it, and declare that it was added. ;; (params ()) (preconds (and (can-add-items-to-order ) (equal-p yes) (class ) (~ (order )) (~ (added )) (is-name ))) (effects ((add (added 1 )) (add (instance ))))) (ADD-ANOTHER-OBJECT-TO-ORDER ;; ;; for a class of objects which have been previously ;; added to the requisition, add another one. ;; (params ()) (preconds (and (can-add-items-to-order ) (equal-p yes) (class ) (~ (order )) (added ) (increment 1 ) (is-name ))) (effects ((del (added )) (add (added )) (add (instance ))))) (PLACE-BOARD-INSIDE-BP ;; ;; if the unibus load of the board's module is less than the available ;; unibus configuration load, and there is a bp with enough power to ;; support an unconfigured board, and there is a slot within the bp ;; having the same width and pinning type as the board, then place the ;; board into the slot. ;; (params ( )) (preconds (and (instance board) (class board) (pin-type board ) (width board ) (pos-5 board ) (pos-15 board ) (neg-15 board ) (has-board ) (instance mod) (class mod) (equal-p ) (unibus-load mod ) (instance unibus config) (ub-load ) (greater-or-equal ) (instance bp) (class bp) (slot ) (slot-number ) (~ (occupied-slot )) (pin-type ) (width ) (equal-p ) (equal-p ) (inside-box section ) (section ) (instance box) (class box) (cabled ) (p5a ) (p15a ) (n15a ) (greater-or-equal ) (greater-or-equal ) (greater-or-equal ) (decrement ) (decrement ) (decrement ) (decrement ))) (effects ((del (p5a )) (del (p15a )) (del (n15a )) (del (ub-load )) (add (inside-bp slot )) (add (occupied-slot )) (add (p5a )) (add (p15a )) (add (n15a )) (add (ub-load ))))) (PLACE-BP-INSIDE-BOX ;; ;; if there a unibus configuration with enough length to support ;; a bp, and there is a box section with sufficient space for this ;; backplane, place the box inside that section. ;; (params ( )) (preconds (and (instance unibus config) (instance bp) (class bp) (ub-length ) (unibus-length bp ) (greater-or-equal ) (instance box) (class box) (section ) (sua ) (system-units bp ) (greater-or-equal ) (decrement ) (decrement ))) (effects ((del (sua )) (del (ub-length )) (add (inside-box section )) (add (ub-length )) (add (sua ))))) (CABLE-FIRST-BP-TO-POWER-SUPPLY ;; ;; if there are no bp's connected to other bps, ;; then cable the first backplane to the power supply. ;; (params ()) (preconds (and (instance bp) (class bp) (instance box) (class box) (section ) (inside-box section ) (forall (<-bp->) (instance <-bp-> <-bpt-> bp) (and (class <-bpt-> bp) (~ (cabled <-bp->)))) (instance jumper cable) (~ (connects )))) (effects ((add (cabled )) (add (connects power-supply)) (add (previously-cabled-bp ))))) (CABLE-BPS-WITH-CROSS-BOX-CABLE ;; ;; if two bps are in different boxes, ;; then use a cross-box cable to connect them. ;; (params ( )) (preconds (and (previously-cabled-bp ) (instance bp) (class bp) (inside-box section ) (instance box) (class box) (section ) (instance bp) (class bp) (not-equal-p ) (~ (cabled )) (inside-box section ) (instance box) (class box) (section ) (not-equal-p ) (instance cross-box cable) (~ (connects )))) (effects ((del (previously-cabled-bp )) (add (previously-cabled-bp )) (add (connects )) (add (cabled ))))) (CABLE-BPS-WITH-JUMPER-CABLE ;; ;; if two bps are in the same box, ;; then use a jumper cable to connect them. ;; (params ( )) (preconds (and (previously-cabled-bp ) (instance bp) (class bp) (inside-box section ) (instance box) (class box) (section ) (inside-box section ) (instance bp) (class bp) (not-equal-p ) (~ (cabled )) (instance box) (class box) (section ) (equal-p ) (instance jumper cable) (~ (connects )))) (effects ((del (previously-cabled-bp )) (add (previously-cabled-bp )) (add (connects )) (add (cabled ))))) ;; *************************************************************************** (ELABORATE-UNIBUS-CONFIG-INSTANCE ;; ;; a unibus configuration. ;; (params ()) (preconds (instance unibus config)) (effects ((add (elaborated unibus config)) (add (ub-length 600)) (add (ub-load 19))))) ;; *************************************************************************** (ELABORATE-STANDARD-BOX-INSTANCE ;; ;; a full instance of a standard box. ;; (params ()) (preconds (instance standard box)) (effects ((add (elaborated standard box)) (add (section 1)) (add (section 2)) (add (p5a 1 10)) (add (p15a 1 10)) (add (n15a 1 10)) (add (sua 1 2)) (add (p5a 2 10)) (add (p15a 2 10)) (add (n15a 2 10)) (add (sua 2 3))))) ;; *************************************************************************** (ELABORATE-REPEATER-BP-INSTANCE ;; ;; a repeater backplane/mod configuration ;; (to increase unibus length/load). ;; (params ()) (preconds (and (instance repeater bp) (is-name repeater mod ))) (effects ((add (elaborated repeater bp)) (add (instance repeater mod)) (add (slot 1))))) (ELABORATE-FOUR-SLOT-BP-INSTANCE ;; ;; a full instance of a four-slot bp. ;; (params ()) (preconds (instance four-slot bp)) (effects ((add (elaborated four-slot bp)) (add (slot 1)) (add (slot 2)) (add (slot 3)) (add (slot 4))))) (ELABORATE-NINE-SLOT-BP-INSTANCE ;; ;; a full instance of a nine-slot bp. ;; (params ()) (preconds (instance nine-slot bp)) (effects ((add (elaborated nine-slot bp)) (add (slot 1)) (add (slot 2)) (add (slot 3)) (add (slot 4)) (add (slot 5)) (add (slot 6)) (add (slot 7)) (add (slot 8)) (add (slot 9))))) (ELABORATE-RK611-BP-INSTANCE ;; ;; a full instance of an rk611 bp. ;; (params ()) (preconds (instance rk611 bp)) (effects ((add (elaborated rk611 bp)) (add (slot 1)) (add (slot 2)) (add (slot 3)) (add (slot 4)) (add (slot 5)) (add (slot 6)) (add (slot 7)) (add (slot 8)) (add (slot 9))))) ;; *************************************************************************** (ELABORATE-REPEATER-MOD-INSTANCE ;; ;; a repeater module. ;; (params ()) (preconds (and (instance repeater mod) (is-name repeater board ))) (effects ((add (elaborated repeater mod)) (add (instance repeater board)) (add (has-board ))))) (ELABORATE-KMC11-MOD-INSTANCE ;; ;; a kmc11 mod. ;; (params ()) (preconds (and (instance kmc11 mod) (is-name kmc11 board ))) (effects ((add (elaborated kmc11 mod)) (add (instance kmc11 board)) (add (has-board ))))) (ELABORATE-RK611-MOD-INSTANCE ;; ;; an rk611 mod. ;; (params ()) (preconds (and (instance rk611 mod) (is-name rk611 board ) (is-name rk611 board ) (is-name rk611 board ) (is-name rk611 board ) (is-name rk611 board ))) (effects ((add (elaborated rk611 mod)) (add (instance rk611 board)) (add (instance rk611 board)) (add (instance rk611 board)) (add (instance rk611 board)) (add (instance rk611 board)) (add (has-board )) (add (has-board )) (add (has-board )) (add (has-board )) (add (has-board ))))) (ELABORATE-DEUNA-AA-MOD-INSTANCE (params ()) (preconds (and (instance deuna-aa mod) (is-name deuna-aa board ) (is-name deuna-aa board ))) (effects ((add (elaborated deuna-aa mod)) (add (instance deuna-aa board)) (add (instance deuna-aa board)) (add (has-board )) (add (has-board ))))) (ELABORATE-DR11-W-MOD-INSTANCE ;; ;; a dr11-w mod. ;; (params ()) (preconds (and (instance dr11-w mod) (is-name dr11-w board ) (is-name dr11-w board ))) (effects ((add (elaborated dr11-w mod)) (add (instance dr11-w board)) (add (instance dr11-w board)) (add (has-board )) (add (has-board ))))) (ELABORATE-DZ11-B-MOD-INSTANCE ;; ;; a dz11-b mod. ;; (params ()) (preconds (and (instance dz11-b mod) (is-name dz11-b board ))) (effects ((add (elaborated dz11-b mod)) (add (instance dz11-b board)) (add (has-board ))))) (ELABORATE-LP11-MOD-INSTANCE ;; ;; an lp11 mod. ;; (params ()) (preconds (and (instance lp11 mod) (is-name lp11 board ))) (effects ((add (elaborated lp11 mod)) (add (instance lp11 board)) (add (has-board ))))) (ELABORATE-UDA50-A-MOD-INSTANCE ;; ;; a uda50-a mod. ;; (params ()) (preconds (and (instance uda50-a mod) (is-name uda50-a board ))) (effects ((add (elaborated uda50-a mod)) (add (instance uda50-a board)) (add (has-board ))))) )) (setq *INFERENCE-RULES* '( (INFER-CONFIGURATION-COMPLETE ;; ;; configuration is completed when there are no requisitioned ;; objects and all instances of objects have been elaborated ;; and configured. (The elaboration is needed for efficiency). ;; (params ()) (preconds (and (forall ( ) (class ) (~ (order ))) (forall ( ) (instance config) (elaborated config)) (forall ( ) (instance box) (elaborated box)) (forall ( ) (instance bp) (elaborated bp)) (forall ( ) (instance mod) (elaborated mod)) (forall ( ) (instance mod) (configured mod )))) (effects ((add (configuration-complete))))) (INFER-UNIBUS-CONFIGURED ;; ;; a unibus must have all modules objects configured. ;; (params ()) (preconds (forall () (object physical ) (forall ( ) (instance mod) (configured )))) (effects ((add (configured config ))))) (INFER-BOX-CONFIGURED ;; ;; a box is configured when all bps inside it are configured. ;; (params ()) (preconds (and (instance box) (class box) (forall () (inside-box section ) (and (instance bp) (class bp) (section ) (cabled ))))) (effects ((add (configured box ))))) (INFER-BP-CONFIGURED ;; ;; a bp is configured when it is inside a box and cabled. ;; (params ( )) (preconds (and (instance bp) (class bp) (cabled ) (inside-box section ) (instance box) (class box) (section ))) (effects ((add (configured bp ))))) (INFER-CABLE-CONFIGURED ;; ;; a cable is configured when it connects at least one bp. ;; (params ( )) (preconds (and (instance cable) (class cable) (instance bp) (connects ))) (effects ((add (configured cable ))))) (INFER-MOD-CONFIGURED ;; ;; a mod is configured when all boards are configured. ;; (params ()) (preconds (and (instance mod) (class mod) (elaborated mod) (forall () (has-board ) (configured board )))) (effects ((add (configured mod ))))) (INFER-BOARD-CONFIGURED ;; ;; a board is configured when it is inside a slot. ;; (params ( )) (preconds (and (instance board) (class board) (inside-bp slot ) (instance bp) (class bp) (slot ))) (effects ((add (configured board ))))) ))