## -*- Mode: sde -*- ## $Id: default.soar,v 1.4 1994/11/22 21:35:46 rempel Exp $ ## ############################# -*- Mode: Soar -*- ############################# ## ## File : default.soar ## Author : John Laird ## Created on : Mon Feb 27 16:15:34 1989 ## Last Modified By: Allan Rempel (for Scott Huffman and Mark Portelli) ## Last Modified On: Mon Sep 19 11:00:40 1994 ## ## Contents: Default productions for Soar 6.2.4 NNPSCM ## ############################################################################### ### ### i. Table of Contents ### ### i. Table of Contents ### ii. Change Log ### iv. Possible Problems ### 7.1 Default knowledge for the top context ### A. default*top-goal*elaborate*state*name*top-goal*top-state ### B. default*top-goal*elaborate*state*io-state ### C. default*top-goal*elaborate*state*problem-space*desired ### D. default*top-ps*propose*wait ### E. default*terminate*wait ### F. default*top-goal*halt*operator*failure ### ### 7.2 Default knowledge for impasses ### 7.2.1 Multi-choice impasses ### A. default*select*indifferent-and-worst*tied ### B. default*select*reject-and-reconsider*conflict ### ### 7.2.2 Operator no-change impasses ### ### 7.2.3 Other no-change impasses ### A. default*elaborate*operator*failed*no-change ### B. default*select*reject-and-reconsider*failed*operator ### ### 7.2.4 Constraint-failure impasses ### A. default*elaborate*operator*failed*constraint-failure ### ### 7.3 The selection space for multi-choice impasses ### A. default*selection*propose*space*selection ### B. default*selection*elaborate*state*found-value-true ### C. default*selection*elaborate*state*wait-true-not-all-objects-evaluated ### ### 7.3.1 The evaluate-object operator ### A. default*selection*propose*evaluate-object ### B. default*selection*select*evaluate-object*indifferent ### C. default*selection*elaborate*operator*evaluate-object*type-evaluation ### D. default*selection*elaborate*state*evaluation ### E. default*selection*elaborate*evaluate-object*desired ### F. default*selection*elaborate*evaluate-object*superproblem-space ### G. default*selection*elaborate*evaluate-object*superstate ### H. default*selection*elaborate*evaluate-object*all-objects-novalue ### ### 7.3.1.1 Evaluation Objects ### A. default*selection*elaborate*evaluation*value ### B. default*selection*elaborate*evaluation*desired ### C. default*selection*elaborate*evaluation*object ### D. default*selection*elaborate*evaluation*type ### ### 7.3.1.2 Applying the evaluate-object operator ### A. default*terminate*evaluate-object ### ### 7.3.2 The evaluation subgoal ### A. default*evaluate-object*elaborate*state*desired ### B. default*evaluate-object*elaborate*state*name ### C. default*evaluate-object*elaborate*state*problem-space ### D. default*evaluate-object*elaborate*state*duplicate-of ### E. default*evaluate-object*elaborate*state*look-ahead-operator*copy ### F. default*evaluate-object*elaborate*state*look-ahead-operator*no-copy ### G. default*evaluate-object*propose*look-ahead ### H. default*evaluate-object*elaborate*state*tried-tied-operator*copy ### I. default*evaluate-object*elaborate*state*tried-tied-operator*no-copy ### J. default*evaluate-object*elaborate*evaluation*failure*no-operators ### K. default*evaluate-object*elaborate*evaluation*failure*constraint-failure ### L. default*evaluate-object*elaborate*evaluation*from-subgoal ### M. default*evaluate-object*elaborate*evaluation*from-subgoal*duplicate-desired ### ### 7.3.2.1 State copying ### A. default*evaluate-object*elaborate*operator*type-evaluation*default-for-default-state-copy-is-yes ### B. default*evaluate-object*elaborate*operator*type-evaluation*default-state-copy-from-problem-space ### C. default*evaluate-object*elaborate*state*default-state-copy-from-type-evaluation-operator ### D. default*evaluate-object*elaborate*state*default-copy-is-all-attributes-at-level-one ### E. default*evaluate-object*elaborate*state*copy-all-attributes-at-level-one-from-problem-space ### F. default*evaluate-object*elaborate*state*initial*require-duplicate-state ### G. default*evaluate-object*elaborate*state*create-duplicates-table ### H. default*evaluate-object*elaborate*state*add-one-level-attributes ### I. default*evaluate-object*elaborate*state*add-all-attributes-at-level-one ### J. default*evaluate-object*elaborate*state*change-one-level-attribute-to-duplicate ### K. default*evaluate-object*elaborate*state*change-all-attributes-at-level-one-to-duplicate ### L. default*evaluate-object*elaborate*state*duplicate-id-for-attribute ### M. default*evaluate-object*elaborate*state*duplicate-id-for-all-attributes ### N. default*evaluate-object*elaborate*add-attribute-to-duplicate ### O. default*evaluate-object*elaborate*add-duplicated-attribute-to-duplicate ### P. default*evaluate-object*elaborate*state*add-duplicate-to-state ### Q. default*evaluate-object*elaborate*state*add-duplicates-for-all-attributes ### R. default*evaluate-object*elaborate*state*eval*desired ### S. default*duplicate-desired*copy-old-value ### T. default*duplicate-desired*replace-old-value ### ### 7.3.2.3 Operator copying ### B. default*evaluate-object*elaborate*operator*default-operator-copy-is-yes ### C. default*evaluate-object*elaborate*operator*copy-default-operator-copy-from-problem-space ### D. default*evaluate-object*elaborate*state*copy-default-operator-copy-from-type-evaluation-operator ### A. default*evaluate-object*elaborate*state*create-duplicates-table-for-operator-only ### E. default*evaluate-object*elaborate*operator*add-attribute-to-duplicate-operator ### F. default*evaluate-object*elaborate*operator*add-duplicated-attribute-to-duplicate-operator ### ### 7.3.3 Computing evaluations ### 7.3.3.1 Computing numeric evaluations ### 7.3.3.2 Comparing numeric Evaluations ### A. default*selection*compare*equal-evaluation-indifferent ### B. default*selection*compare*higher-evaluation-better ### C. default*selection*compare*prefer-lower-evaluation ### ### 7.3.3.3 Computing symbolic evaluations ### A. default*selection*compare*same-symbolic-evaluations-are-indifferent ### B. default*selection*compare*success-evaluation-better-than-partial-success ### C. default*selection*compare*partial-failure-evaluation-better-than-failure ### D. default*selection*select*required-success-evaluation-becomes-required-preference ### E. default*selection*select*success-evaluation-becomes-best-preference ### F. default*selection*select*indifferent-evaluation-becomes-indifferent-preference ### G. default*selection*select*partial-failure-evaluation-becomes-worst-preference ### H. default*selection*select*failure-evaluation-becomes-reject-preference ### I. default*selection*select*prohibit-failure-evaluation-becomes-prohibit-preference ### ### 7.3.3.4 Default evaluations ### A. default*pass-back-success ### ### 7.3.3.5 Novalue evaluations ### A. default*selection*compare*novalue-evaluation-always-worse ### ### 7.3.4 Halting Soar with success or failure ### A. default*top-goal*halt*success ### B. default*top-goal*halt*failure ### ### 7.4 Operator subgoaling ### A. default*generic*opsub*propose*space*generic ### B. default*generic*opsub*elaborate*state*name*operator-subgoal ### C. default*generic*opsub*elaborate*state*desired ### D. default*generic*opsub*copy*superstate ### E. default*generic*opsub*goal*elaborate*all-desireds ### F. default*generic*select*reject-desired ### G. default*generic*opsub*detect*state*success ### H. default*opsub*select-operator*subgoaling ### I. default*generic*opsub*failure*no-operator ### J. default*generic*evaluation*failure*no-operator ### K. default*generic*opsub*avoid*duplicate-operator ### L. default*generic*opsub*operator-subgoals ### M. default*generic*opsub*subgoal-on-all-desired-super-desireds ### N. default*generic*opsub*subgoal-on-all-super-desireds ### O. default*apply*evaluate*augment*evaluation-operator-super-desired ### P. default*elaborate*state*eval*super-desired ### ### 7.5 Execution monitoring ### A. default*monitor*goal*success ### B. default*monitor*goal*failure ### C. default*monitor*operator*evaluation ### D. default*monitor*attribute-impasses ### ### 16. Stop-default ### ### ii. Change Log ### ## Change log for 6.2.1 NNPSCM: Significant number of changes. Not itemized here. ## Change log for 6.2.3 NNPSCM: Significant number of changes. Not itemized here. ## 1. Renamed productions: ## A. Eliminated the word implement ## B. Rename those that propose problem space or state to be ## elaborate state ## C. Rename those that elaborate goal to be elaborate state ## D. Propose*operator --> propose ## E. terminate*operator --> terminate ## F. *generic* --> evaluate-object ## 2. Changed variable names: ## A. --> or as appropriate ## B. --> ## C. --> ############################################################################### ### ### iv. Possible Problems ### ### The default knowledge has a mind set that all evaluate-object operators ### will either be directly implemented, or will be implemented in a subspace ### that is performing look ahead style evaluation. This should be checked to ### see if it causes errors. ### ### There is still one opp-app declaration, due to a bug in support classification. ### ### Evaluate-rejected and evaluate-primary are still in this knowledge as ### operator names, but are not proposed by this knowledge. ### ### Operator subgoaling has known outstanding problems. ### ### ### ### 7.1 Default knowledge for the top context ### ## Elaborate the top goal with name top-goal and top-state. ## both are required for backward compatibility ## Make it worst so it will be overridden by all other names. sp {default*top-goal*elaborate*state*name*top-goal*top-state "Propose top-goal as name of top goal. Make it worst." :default (state ^superstate nil) --> ( ^name top-goal + &, top-goal < ^name top-state + &, top-state <)} ## Elaborate state with io-state pointer. sp {default*top-ps*elaborate*state*io-state "Elaborate the initial state in the top problem space." :default (state ^name top-goal) --> ( ^io-state )} ## Propose the top problem space, top-ps. ## Make it worst so it will only be selected if there are no others. ## Augment state with a desired. Necessary for look-ahead. ## Other productions can elaborate the desired later. sp {default*top-goal*elaborate*state*problem-space*desired "Propose top-ps as problem space for goal top-goal." :default (state ^name top-goal) --> ( ^problem-space

+ <, ^desired + <) (

^name top-ps)} ### Make wait always acceptable in the top-ps problem space. sp {default*top-ps*propose*wait "Propose operator wait whenever in problem space top-ps." :default (state ^problem-space.name top-ps) --> ( ^operator <) ( ^name wait)} ### Terminate wait as soon as it is selected so that another ### operator can be selected if situation changes. sp {default*terminate*wait "Terminate wait as soon as it is selected." :default (state ^operator ) ( ^name wait) --> ( ^operator @)} sp {default*top-goal*halt*operator*failure "Halt if no operator can be selected for the top goal." :default (state ^superstate nil) (state ^impasse constraint-failure ^superstate ) --> (write (crlf) |No operator can be selected for top goal.| ) (write (crlf) |Soar must halt.| ) (halt)} ### ### 7.2 Default knowledge for impasses ### ### ### 7.2.1 Multi-choice impasses ### ### /* SBH/mvp 7-8-94 */ ### If the problem space for handling the subgoal fails, signified by the ### choices none impasse below it, make an indifferent and worst-preference ### for each tied object. ### Only applies to operators in NNPSCM because operators are the only context slot ### that can tie. sp {default*select*indifferent-and-worst*tied "Indifferent an object if it leads to a tie that can not be solved." :default (state ^problem-space.name selection ^superstate ^item ^quiescence t) (state ^attribute state ^choices none ^superstate ^quiescence t) (state ^operator +) --> ( ^operator =, < )} ### If the problem space for handling the subgoal fails, signified by ### the choices none impasse below it, make a reject-preference for each ### conflicted object. sp {default*select*reject-and-reconsider*conflict "Reject an object if it leads to a conflict that can not be solved." :default (state ^impasse conflict ^attribute operator ^superstate ^item ^quiescence t) (state ^attribute state ^choices none ^superstate ^quiescence t) (state ^operator +) --> ( ^operator -)} ### ### 7.2.2 Operator no-change impasses ### ### See operator subgoaling, as this is the default action here. ### ### 7.2.3 Other no-change impasses ### ### If no objects are available for a slot, and there is no operator to ### find more, reject next higher object. sp {default*elaborate*operator*failed "Mark an operator as failed if can not suggest operators in subgoal" :default :o-support ; required so fail persists following operator rejection (state ^attribute state ^choices none ^superstate ^quiescence t) (state ^attribute state ^choices none ^superstate ^quiescence t) (state ^attribute operator ^choices none ^superstate ^quiescence t) (state ^operator ) --> ( ^failed t + &)} sp {default*select*reject-and-reconsider*failed*operator "Reject an object if it leads to a no-change that cannot be solved." :default (state ^operator +) ( ^failed t) --> ( ^operator - @)} ### ### 7.2.4 Constraint-failure impasses ### ### If there is a constraint-failure for a operator, below an object, ### reject that object. sp {default*elaborate*operator*failed*constraint-failure :default :o-support (state ^impasse constraint-failure ^superstate ^quiescence t) (state ^superstate ^attribute operator ^choices none) (state ^operator ) --> ( ^failed t + &)} ### ### 7.3 The selection space for multi-choice impasses ### ### Use the selection problem space for all choice multiple, impasses ### - make it worst so that any other will dominate. sp {default*selection*propose*space*selection :default (state ^choices multiple) --> ( ^problem-space

+

< ) (

^name selection)} ### Signal that a value other than novalue has been assigned. sp {default*selection*elaborate*state*found-value-true :default (state ^problem-space.name selection ^choices multiple) ( ^evaluation ) ( ^ << numeric-value symbolic-value >> <> novalue) --> ( ^found-value true)} ### Signal that there are still objects to evaluate. sp {default*selection*elaborate*state*wait-true-not-all-objects-evaluated :default (state ^problem-space.name selection ^operator + ^choices multiple) - {( ^type evaluation ^evaluation ) ( ^ << numeric-value symbolic-value >> )} --> ( ^wait true)} ### ### 7.3.1 The evaluate-object operator ### ### Create evaluate operator in selection problem space. sp {default*selection*propose*evaluate-object :default (state ^problem-space.name selection ^item ) -{(state ^evaluation ) ;"state" added. AA/mvp 9-2-94 ( ^object ^value t)} --> ( ^state ^name evaluate-object ^object ) ( ^operator +)} ### Make them indifferent if not ^operator-selection not-indifferent. sp {default*selection*select*evaluate-object*indifferent :default (state ^problem-space

^operator +) (

^name selection - ^operator-selection not-indifferent) ( ^name evaluate-object) --> ( ^operator =)} ### Label all evaluation operators with ^type evaluation. sp {default*selection*elaborate*operator*evaluate-object*type-evaluation :default (state ^operator ) ( ^name << evaluate-object evaluate-dominated evaluate-primary >> ) --> ( ^type evaluation)} ### Create evaluation once the eval operator is selected. sp {default*selection*elaborate*state*evaluation :default (state ^operator ) ( ^type evaluation) --> ( ^evaluation + &) ( ^state ^operator ) ( ^evaluation )} sp {default*selection*elaborate*evaluate-object*desired :default (state ^operator ^superstate.desired ) ( ^type evaluation) --> ( ^desired + &)} sp {default*selection*elaborate*evaluate-object*superproblem-space :default (state ^problem-space.name selection ^operator ^superstate.problem-space ) ( ^type evaluation) --> ( ^superproblem-space )} sp {default*selection*elaborate*evaluate-object*superstate :default (state ^problem-space.name selection ^operator ^superstate ) ( ^type evaluation) --> ( ^superstate )} ### If all objects have been evaluated, and all have value novalue, and ### there is a object being evaluated in a higher context, assign that ### object novalue. sp {default*selection*elaboare*evaluate-object*all-objects-novalue :default (state ^superstate.superstate ^operator - ^wait - ^found-value ^quiescence t ^choices multiple) (state ^problem-space.name selection ^operator ) ( ^type evaluation) --> ( ^numeric-value novalue ^evaluation-type final)} ### ### 7.3.1.1 Evaluation Objects ### sp {default*selection*elaborate*evaluation*value :default (state ^evaluation ) ( ^ << numeric-value symbolic-value >>) --> ( ^value t)} sp {default*selection*elaborate*evaluation*desired :default (state ^superstate.desired ^evaluation ) --> ( ^desired &)} sp {default*selection*elaborate*evaluation*object :default (state ^operator ^evaluation ) ( ^object ^evaluation ^type evaluation) --> ( ^object )} sp {default*selection*elaborate*evaluation*type :default (state ^operator ^evaluation ) ( ^name ^evaluation ^type evaluation) --> ( ^type )} ### ### 7.3.1.2 Applying the evaluate-object operator ### ### Domain specific code may directly implement an evaluation, or an operator no-change may occur ### to do the job, see the next section. ### Reconsider evaluation operator after it finished in selection space. sp {default*terminate*evaluate-object :default (state ^operator ^evaluation ) ( ^object ) ( ^object ^value t) --> ( ^operator @)} ### ### 7.3.2 The evaluation subgoal ### ### ### These productions which fire once an evaluation subgoal has been created ### have also been generalized. ### SBH/mvp 9-2-94 sp {default*evaluate-object*elaborate*state*desired :default (state ^impasse no-change ^attribute operator ^superstate.operator ) ( -^default-desired-copy yes ^type evaluation ^desired ) --> ( ^desired + &)} sp {default*evaluate-object*elaborate*state*name :default (state ^impasse no-change ^attribute operator ^superstate.operator.name evaluate-object) --> ( ^name implement-evaluate-object)} sp {default*evaluate-object*elaborate*state*problem-space :default (state ^impasse no-change ^attribute operator ^superstate.operator ) ( ^type evaluation ^superproblem-space

) --> ( ^problem-space

)} ## install a copy of the state, when ^default-state-copying and there ## is an operator tie. sp {default*evaluate-object*elaborate*state*duplicate-of :default (state ^problem-space

^superstate ^default-state-copy yes) (state ^operator ) ( ^type evaluation ^superstate ) --> ( ^duplicate-of* )} ### Added test for superproblem-space. This restricts these productions ### to only fire in a lookahead. Previously, these productions made it ### impossible to use evaluation problem spaces other than lookahead. ### JEL 6/21/91 sp {default*evaluate-object*elaborate*state*look-ahead-operator*copy :default (state ^problem-space.name ^superstate.operator ) ( ^type evaluation ^default-operator-copy yes ^object ^superproblem-space.name ) --> ( ^look-ahead-operator ) ( ^duplicate-of* )} ## Create pointer for uniform access even in no copy ### Added test for superproblem-space. This restricts these productions ### to only fire in a lookahead. Previously, these productions made it ### impossible to use evaluation problem spaces other than lookahead. ### JEL 6/21/91 sp {default*evaluate-object*elaborate*state*look-ahead-operator*no-copy :default (state ^problem-space

^superstate.operator ) ( ^type evaluation ^default-operator-copy no ^object ^superproblem-space

) --> ( ^look-ahead-operator )} ### install copy of operator in lookahead context. ###

/ checks to correct bug from TJ ### Modified by JEL/mvp 07-Nov-93 sp {default*evaluate-object*propose*look-ahead :default (state ^problem-space.name ^look-ahead-operator ^superstate ) (state ^superstate.problem-space.name ^operator.type evaluation) -( ^tried-tied-operator ) --> ( ^operator ! +)} ### Detect that the operator has been tried when a duplicate is being used. sp {default*evaluate-object*elaborate*state*tried-tied-operator*copy :default (state ^problem-space

^operator ^superstate ^default-operator-copy yes) (state ^operator ) ( ^type evaluation ^superproblem-space

^object ) ( ^duplicate-of* ) --> ( ^tried-tied-operator + &)} ## Detect that the operator has been tried when a duplicate is not being used. sp {default*evaluate-object*elaborate*state*tried-tied-operator*no-copy :o-support :default (state ^problem-space

^operator ^superstate ^default-operator-copy no) (state ^operator ) ( ^type evaluation ^superproblem-space

^object ) --> ( ^tried-tied-operator + &)} ### Give symbol-value failure when no operators are proposed in subgoals sp {default*evaluate-object*elaborate*evaluation*failure*no-operators :default (state ^operator ) ( ^evaluation ) ( ^type evaluation ^evaluation ) (state ^superstate ^quiescence t) (state ^superstate ^attribute state ^impasse no-change ^quiescence t) (state ^superstate ^attribute state ^impasse no-change ^quiescence t) --> ( ^symbolic-value failure)} sp {default*evaluate-object*elaborate*evaluation*failure*constraint-failure :default (state ^operator ) ( ^evaluation ) ( ^type evaluation ^evaluation ) (state ^superstate ) (state ^superstate ^attribute operator ^impasse constraint-failure) --> ( ^symbolic-value failure)} sp {default*evaluate-object*elaborate*evaluation*from-subgoal :default (state ^superstate ^ { << required-success success partial-success indifferent partial-failure failure prohibit-failure draw lose win >> } ) (state ^operator ^evaluation ) ( ^type evaluation ^evaluation ^desired ) --> ( ^symbolic-value )} ## Added to handle duplicated desireds sp {default*evaluate-object*elaborate*evaluation*from-subgoal*duplicate-desired :default (state ^superstate ^ { << required-success success partial-success indifferent partial-failure failure prohibit-failure draw lose win >> } ) (state ^operator ^evaluation ) ( ^type evaluation ^evaluation ^desired ) ( ^duplicate-of* ) --> ( ^symbolic-value )} ### ### 7.3.2.1. State Copying ### ## If no signals on problem space, the default is to copy both state and operator sp {default*evaluate-object*elaborate*operator*type-evaluation*default-for-default-state-copy-is-yes :default (state ^operator ) ( ^type evaluation ^superproblem-space

) -(

^default-state-copy no) --> ( ^default-state-copy yes)} sp {default*evaluate-object*elaborate*operator*type-evaluation*default-state-copy-from-problem-space :default (state ^operator ) ( ^type evaluation ^superproblem-space

) (

^default-state-copy ) --> ( ^default-state-copy )} ### Default is that all-attributes-at-level are copied sp {default*evaluate-object*elaborate*state*default-state-copy-from-type-evaluation-operator :default (state ^impasse no-change ^attribute operator ^superstate ) (state ^operator ) ( ^type evaluation ^default-state-copy ) --> ( ^default-state-copy )} sp {default*evaluate-object*elaborate*state*default-copy-is-all-attributes-at-level-one :default (state ^impasse no-change ^attribute operator ^superstate ) (state ^operator ) ( ^type evaluation ^superproblem-space

) (

-^all-attributes-at-level two -^one-level-attributes -^two-level-attributes -^dont-copy -^dont-copy-anything) --> ( ^all-attributes-at-level one)} ### We want ^all-attributes-at-level one to be on the goal, but if someone ### puts it on the space along with the other copying flags, we should allow ### that. So, copy it from the space to the goal. sp {default*evaluate-object*elaborate*state*copy-all-attributes-at-level-one-from-problem-space :default (state ^problem-space

^default-state-copy yes) (

^all-attributes-at-level one) --> ( ^all-attributes-at-level one)} ### Set up identifier mapping table for state duplication. sp {default*evaluate-object*elaborate*state*create-duplicates-table :default (state ^impasse no-change ^attribute operator ^superstate ) (state ^operator ) ( ^type evaluation ^default-state-copy yes) --> ( ^duplicates* +)} ### Copy one-level-attributes. ### Replaced test for implement-evaluate-object with test for superproblem- ### space. Makes the productions more general and is consistent with other ### default productions for lookahead search. JEL 6/21/91 sp {default*evaluate-object*elaborate*state*add-one-level-attributes :default (state ^operator ) ( ^superproblem-space

) (state ^problem-space

^superstate ^default-state-copy yes) (

^one-level-attributes ) ( ^duplicate-of* ) ( ^ ) --> ( ^ + &)} ## Copy all attributes, when ^all-attributes-at-level one. ### Replaced test for implement-evaluate-object with test for superproblem- ### space. Makes the productions more general and is consistent with other ### default productions for lookahead search. JEL 6/21/91 sp {default*evaluate-object*elaborate*state*add-all-attributes-at-level-one :default (state ^operator ) ( ^superproblem-space

) (state ^problem-space

^superstate ^default-state-copy yes ^all-attributes-at-level one ^duplicate-of* ) (

- ^dont-copy-anything - ^dont-copy - ^two-level-attributes ) ( ^{ <> duplicate-of* <> tried-tied-operator <> problem-space <> impasse <> attribute <> choices <> quiescence <> operator <> superstate } ) --> ( ^ + &)} ### If we copied a one-level-attribute, and it later turned ### out that its value happened to be something that was pointed to by a ### two-level-attribute, change its value to be the copied object. sp {default*evaluate-object*elaborate*state*change-one-level-attribute-to-duplicate :default (state ^problem-space

^duplicates* ^default-state-copy yes ^duplicate-of* ) (

^one-level-attributes ) ( ^ ) ( ^ ) --> ( ^ - + &)} ### Fixes, when all-attributess-at-level one. sp {default*evaluate-object*elaborate*state*change-all-attributes-at-level-one-to-duplicate :default (state ^problem-space

^duplicates* ^default-state-copy yes ^all-attributes-at-level one ^duplicate-of* ) (

- ^dont-copy ) ( ^{ <> tried-tied-operator } ) ( ^ ) --> ( ^ - + &)} ### Create new ids for two-level-attributes. sp {default*evaluate-object*elaborate*state*duplicate-id-for-attribute :default (state ^problem-space

^duplicates* ^default-state-copy yes ^duplicate-of* ) (

^two-level-attributes ) ( ^ ) --> ( ^ + =)} ### Create new ids for all attributes, when ^all-attributes-at-level two. sp {default*evaluate-object*elaborate*state*duplicate-id-for-all-attributes :default (state ^problem-space

^duplicates* ^default-state-copy yes ^duplicate-of* ) (

-^dont-copy-anything -^dont-copy ^all-attributes-at-level two -^one-level-attributes ) ( ^{ <> duplicate-of* <> tried-tied-operator <> problem-space <> impasse <> attribute <> choices <> quiescence <> operator <> superstate } ) --> ( ^ + =)} ### Create a copy of the old object on the new link. First copy ### augmentations that don't point to objects that have been ### duplicated. warnings -off sp {default*evaluate-object*elaborate*add-attribute-to-duplicate :default (state ^duplicates* ^default-state-copy yes) ( ^ - ^) ( ^ { <> tried-tied-operator } ) --> ( ^ + &)} warnings -on ### Next copy augmentations that point to duplicated objects: warnings -off sp {default*evaluate-object*elaborate*add-duplicated-attribute-to-duplicate :default (state ^duplicates* ^default-state-copy yes) ( ^ ^ ) ( ^ { <> tried-tied-operator } ) --> ( ^ + &)} warnings -on ### Added ^two-level-attributes . Previously, it ### would copy any attribute that happened to point to the same value as ### one of the two-level-attributes. sp {default*evaluate-object*elaborate*state*add-duplicate-to-state :default (state ^problem-space

^duplicates* ^default-state-copy yes ^duplicate-of* ) (

^two-level-attributes ) ( ^ ) ( ^ ) --> ( ^ + &)} ### moves the new links to the state when ^all-atts two. sp {default*evaluate-object*elaborate*state*add-duplicates-for-all-attributes :default (state ^problem-space

^duplicates* ^default-state-copy yes ^duplicate-of* ) (

^all-attributes-at-level two - ^dont-copy-anything - ^dont-copy - ^one-level-attributes ) ( ^{ <> tried-tied-operator } ) ( ^ ) --> ( ^ + &)} ## ------------------------------- ## Desired copying: ## ------------------------------- ## Copy attributes to the duplicate desired state. We ## do this after the state is installed so that the duplicates table ## will already have been filled in. We just copy all attributes over ## from the original operator, except that attributes that pointed to ## objects that have been duplicated (on the state) are modified to point ## to the duplicate objects. sp {default*evaluate-object*elaborate*state*eval*desired :default (state ^superstate ) (state ^operator ) ( ^type evaluation ^desired ^default-desired-copy yes ) --> ( ^desired ) ( ^duplicate-of* )} ## Copy attributes whose values haven't been duplicated. ### SBH/mvp 9-2-94 ### Added parallel preference to the copied attribute. ### Also, added the condition that the desired be attached to ### an evaluation superoperator. This is because if we use the same ### desired in a lower lookahead context, this production re-firing ### can cause stupid chunks. sp {default*duplicate-desired*copy-old-value :default (state ^superstate ^duplicates* ^desired ) (state ^operator ) ( ^type evaluation ^desired ) ( ^duplicate-of* ) ( ^{ <> duplicate-of* } -^dont-copy ) - ( ^) --> ( ^ + &)} ## Copy attributes whose values have been duplicated. sp {default*duplicate-desired*replace-old-value :default (state ^duplicates* ^desired ) ( ^duplicate-of* ) ( ^ { <> duplicate-of* } - ^dont-copy ) ( ^ ) --> ( ^ )} ### 7.3.2.3 Operator copying ### ### Copy attributes to the duplicate operator. We ### do this after the state is installed so that the duplicates table ### will already have been filled in. We just copy all attributes over ### from the original operator, except that attributes that pointed to ### objects that have been duplicated (on the state) are modified to point ### to the duplicate objects. sp {default*evaluate-object*elaborate*operator*default-operator-copy-is-yes :default (state ^operator ) ( ^type evaluation ^superproblem-space

) -(

^default-operator-copy no) --> ( ^default-operator-copy yes)} sp {default*evaluate-object*elaborate*operator*copy-default-operator-copy-from-problem-space :default (state ^operator ) ( ^type evaluation ^superproblem-space

) (

^default-operator-copy ) --> ( ^default-operator-copy )} sp {default*evaluate-object*elaborate*state*copy-default-operator-copy-from-type-evaluation-operator :default (state ^impasse no-change ^attribute operator ^superstate ) (state ^operator ) ( ^type evaluation ^default-operator-copy ) --> ( ^default-operator-copy )} ### Set up identifier mapping table for operator sp {default*evaluate-object*elaborate*state*create-duplicates-table-for-operator-only :default (state ^impasse no-change ^attribute operator ^superstate ) (state ^operator ) ( ^type evaluation ^default-operator-copy yes - ^default-state-copy yes) --> ( ^duplicates* +)} ### Copy attributes whose values haven't been duplicated. ### sp {default*evaluate-object*elaborate*operator*add-attribute-to-duplicate-operator :default (state ^duplicates* ^look-ahead-operator ) ( ^duplicate-of* ) ( ^ { <> duplicate-of* } - ^ dont-copy ) ( - ^) --> ( ^ )} ### Copy attributes whose values have been duplicated. sp {default*evaluate-object*elaborate*operator*add-duplicated-attribute-to-duplicate-operator :default (state ^duplicates* ^look-ahead-operator ) ( ^duplicate-of* ) ( ^ { <> duplicate-of* } - ^dont-copy ) ( ^ ) --> ( ^ )} ### ### 7.3.3 Computing evaluations ### ### ### 7.3.3.1 Computing numeric evaluations ### ### This is domain specific, so there are no default productions for this. ### ### 7.3.3.2 Comparing numeric evaluations ### ### If two objects have equal evaluations they are indifferent. sp {default*selection*compare*equal-evaluation-indifferent :default (state ^problem-space.name selection ;^attribute ;REMOVED. ^superstate ^evaluation { <> }) ( ^desired ) ( ^object ^numeric-value ^desired ^type evaluate-object) ( ^object ^numeric-value ^desired ^type evaluate-object) - ( ^equal not-indifferent) --> ( ^operator = )} ;# was ^ ### ### Generate operator preferences based on their evaluations and info ### as to whether higher or lower evaluations are better. sp {default*selection*compare*higher-evaluation-better ; default*evaluate-object*elaborate* :default (state ^problem-space.name selection ;^attribute ;REMOVED. ^superstate ^evaluation ^evaluation { <> }) (state ^problem-space ^desired ) ( ^object ^numeric-value ^desired ^type evaluate-object) ( ^object ^numeric-value < ^desired ^type evaluate-object) ( ^better higher) --> ( ^operator < )} ;# was ^ sp {default*selection*compare*prefer-lower-evaluation ; default*evaluate-object*elaborate* :default (state ^problem-space.name selection ;^attribute ;REMOVED. ^superstate ^evaluation ^evaluation { <> }) (state ^problem-space ^desired ) ( ^object ^numeric-value ^desired ^type evaluate-object) ( ^object ^numeric-value > ^desired ^type evaluate-object) ( ^better lower) --> ( ^operator < )} ;# Aladin's rectification, was ^ ### ### 7.3.3.3 Computing symbolic evaluations ### sp {default*selection*compare*same-symbolic-evaluations-are-indifferent :default (state ^problem-space.name selection ^superstate ^evaluation { <> }) (state ^desired ) ( ^object ^symbolic-value ^desired ^type evaluate-object) ( ^object ^symbolic-value ^desired ^type evaluate-object) --> ( ^operator = )} ;# was ^ [unbound] SBH/mvp 9-2-94 sp {default*selection*compare*success-evaluation-better-than-partial-success :default (state ^problem-space.name selection ^superstate ^evaluation { <> }) (state ^desired ) ( ^object ^symbolic-value success ^desired ^type evaluate-object) ( ^object { <> } ^symbolic-value partial-success ^desired ^type evaluate-object) --> ( ^operator > )} ;# was ^ [unbound] SBH/mvp 9-2-94 sp {default*selection*compare*partial-failure-evaluation-better-than-failure :default (state ^problem-space.name selection ^superstate ^evaluation { <> }) (state ^desired ) ( ^object ^symbolic-value partial-failure ^desired ^type evaluate-object) ( ^object { <> } ^symbolic-value failure ^desired ^type evaluate-object) --> ( ^operator > )} ;# was ^ [unbound] SBH/mvp 9-2-94 sp {default*selection*select*required-success-evaluation-becomes-required-preference :default (state ^problem-space.name selection ^operator ^superstate ^evaluation ) (state ^desired ^operator +) ( ^name evaluate-object ^evaluation ^desired ^object ) ( ^symbolic-value required-success) --> ( ^operator ! )} sp {default*selection*select*success-evaluation-becomes-best-preference :default (state ^problem-space.name selection ^operator ^superstate ^evaluation ) (state ^desired ^operator +) ( ^name evaluate-object ^evaluation ^desired ^object ) ( ^symbolic-value << partial-success success >> ) --> ( ^operator > )} sp {default*selection*select*indifferent-evaluation-becomes-indifferent-preference :default (state ^problem-space.name selection ^operator ^superstate ^evaluation ) (state ^desired ^operator +) ( ^name evaluate-object ^evaluation ^desired ^object ) ( ^symbolic-value indifferent) --> ( ^operator =)} sp {default*selection*select*partial-failure-evaluation-becomes-worst-preference :default (state ^problem-space.name selection ^operator ^superstate ^evaluation ) (state ^desired ^operator +) ( ^name evaluate-object ^evaluation ^desired ^object ) ( ^symbolic-value partial-failure) --> ( ^operator < )} sp {default*selection*select*failure-evaluation-becomes-reject-preference :default (state ^problem-space.name selection ^operator ^superstate ^evaluation ) (state ^desired ^operator +) ( ^name evaluate-object ^evaluation ^desired ^object ) ( ^symbolic-value << lose failure >> ) --> ( ^operator - )} sp {default*selection*select*prohibit-failure-evaluation-becomes-prohibit-preference :default (state ^problem-space.name selection ^operator ^superstate ^evaluation ) (state ^desired ^operator +) ( ^name evaluate-object ^evaluation ^desired ^object ) ( ^symbolic-value prohibit-failure) --> ( ^operator ~ )} ### ### 7.3.3.4 Default evaluations ### ### A. default*pass-back-success ## if an operator leads to success and it is being ## tried out in a subgoal to evaluate another operator - ## give that second operator a success evaluation also ### AA/mvp 9-2-94 sp {default*pass-back-success :default (state ^operator ^superstate ) ; removed ^evaluation ( ^name evaluate-object ^evaluation ) ( ^symbolic-value << required-success success >> ) (state ^superstate ) (state ^operator ) ; removed ^evaluation ( ^name evaluate-object ^evaluation ^object ) ( ^name) --> ( ^symbolic-value partial-success )} ### ### 7.3.3.5 Novalue evaluations ### ### Make novalue worse than any other value. sp {default*selection*compare*novalue-evaluation-always-worse :default (state ^problem-space.name selection ;^attribute ;REMOVED. ^superstate ^evaluation ^evaluation { <> }) (state ^desired ) ( ^object ^numeric-value novalue ^desired ^type evaluate-object) ( ^object ^numeric-value <> novalue ^desired ^type evaluate-object) --> ( ^operator > )} ;# was ^ ### ### 7.3.4 Halting Soar with success or failure ### ### A. default*top-goal*halt*state*success ### Handle state augmentations dealing with goal termination for the top-level goal. sp {default*top-goal*halt*success :default (state ^name ^desired ^superstate nil ^<< required-success success >> ) --> (write (crlf) | achieved | ) (halt)} ### B. default*top-goal*halt*state*failure sp {default*top-goal*halt*failure :default (state ^superstate nil ^desired ^name ^ << prohibit-failure failure >> ) --> (write (crlf) | failed| ) (halt)} ### ### 7.4 Operator Subgoaling (modified extensively by JEL/mvp 07-Nov-93) ####################################################################################### ### RESTRICTIONS ON USE: ### ### 1. The problem space used for operator implmentation can not be exactly ### the same problem space used for operator subgoaling (or the original ### task problem space). It can be a duplicate, but can not have the same ### identifier. This is because operator subgoaling is signalled by the ### selection of the task space as the problem space in the operator ### no-change subgoal. ### ### 2. For operator subgoaling and operator implementation to work ### together, there must be a production that tests when the preconditions ### of the operator have been achieved (operator subgoaling is successful) ### and whose action is to reconsider the problem space. This is necessary ### so that the switch can be made from the operator subgoaling problem ### space (the original task space) and the operator implementation problem ### space. ### ### sp {task*reconsider*problem-space*operator-subgoaling ### (state ^impasse no-change ^attribute operator ^object ### ^problem-space

) ### (state ^problem-space

^operator ) ### (state ^attributes that test operator instantiated) ### (operator ^name ...) ### --> ### (state ^problem-space @)} ### ### 3. All operators must be augmented with ^achieved when they have ### successfully applied. This helps avoid problems where chunks learned ### through operator subgoaling, can undo operator actions, and vice ### versa. ### ### 4. Operators must apply by changing existing structures on the state, ### not by creating new ones, or destroying existing ones. ### ##################################################################################### ##################################################################################### ### OVERVIEW ### ### For look-ahead searches, always select the operator that subgoaling on ### after another operator has applied. If it then sucessfully applied, the ### look-ahead search was a success. ### ##################################################################################### ### make the super-problem space the default ### when there is a no-change for the operator ### make is worst so operator implementation will win out sp {default*generic*opsub*propose*space*generic :default (state ^impasse no-change ^attribute operator ^superstate ) (state ^problem-space ) --> ( ^problem-space + < )} ###if the superproblem-space is selected as the ### current problem space then operator subgoaling ### is being used so select the superstate - ### the super-operator becomes the desired) ### ### The name gets a parallel preference because the state ### above (which is being copied down to this state) may ### also have a name. sp {default*generic*opsub*elaborate*state*name*operator-subgoal :default (state ^problem-space

^impasse no-change ^attribute operator ^superstate ) (state ^problem-space

) --> ( ^name operator-subgoal + & operator-subgoal < )} sp {default*generic*opsub*elaborate*state*desired :default (state ^problem-space

^name operator-subgoal ^superstate ) (state ^operator ) --> ( ^desired )} sp {default*generic*opsub*copy*superstate :default (state ^name operator-subgoal ^superstate ) ( ^ { <> problem-space <> impasse <> object <> name <> superstate <> attribute <> operator <> desired } ) --> ( ^ + &)} ### The following is commented out; it would provide for keeping track ### of all levels of operator subgoaling, not just the most recent. ### Pass down all super operator subgoals as well. # # sp {default*generic*opsub*goal*elaborate*all-desireds # :default # (state ^problem-space

# ^impasse no-change ^attribute operator ^superstate ) # (state ^problem-space

^desired ) # --> # (state ^desired )} # # ###don't select the operator for the operator that we are ### subgoaling on. sp {default*generic*select*reject-desired :default (state ^name operator-subgoal ^problem-space

^desired ) --> ( ^operator - )} ##if there is an evaluation subgoal within ### an operator subgoal and the operator being ### subgoaled on is applied - success sp {default*generic*opsub*detect*state*success :default (state ^problem-space

^desired ^applied ) ( ^achieved ) --> ( ^success )} sp {opsub*select-operator*subgoaling :default (state ^name implement-evaluate-object ^problem-space

^operator <> ^desired ) ( ^name) --> ( ^operator !)} sp {default*generic*opsub*failure*no-operator :default (state ^superstate ^impasse no-change ^attribute state ^quiescence t) ( ^name operator-subgoal ^desired ) --> ( ^failure &)} sp {default*generic*evaluation*failure*no-operator :default (state ^superstate ^impasse no-change ^name operator-subgoal ^attribute operator ^desired ^quiescence t ^failure ) ( ^operator ^desired ) --> ( ^failure &)} sp {default*generic*opsub*avoid*duplicate-operator :default (state ^impasse no-change ^name operator-subgoal ^attribute operator ^operator + ^super-desired ) ( ^name ) ( ^name ) --> ( ^operator -)} sp {default*generic*opsub*operator-subgoals :default (state ^name implement-evaluate-object ^problem-space

^operator ^desired ) (state ^name operator-subgoal ^superstate ) --> ( ^operator @)} ## These maintain the super-desireds sp {default*generic*opsub*subgoal-on-all-desired-super-desireds :default (state ^problem-space

^impasse no-change ^attribute operator ^superstate ) ( ^problem-space

^desired ) --> ( ^super-desired &)} sp {default*generic*opsub*subgoal-on-all-super-desireds :default (state ^problem-space

^impasse no-change ^attribute operator ^superstate ) ( ^problem-space

^super-desired ) --> ( ^super-desired &)} sp {default*apply*evaluate*augment*evaluation-operator-super-desired :default (state ^operator ^superstate ) ( ^super-desired ) ( ^evaluation ^type evaluation) --> ( ^super-desired &)} sp {default*elaborate*state*eval*super-desired :default (state ^impasse no-change ^attribute operator ^superstate ) ( ^operator ) ( ^type evaluation ^super-desired ) --> ( ^super-desired &)} ### ### 7.5 Execution monitoring ### ### If the state is marked with ^success , the goal succeeds. sp {default*monitor*goal*success :default (state ^superstate nil - ^verbose false) (state ^name ^desired ^<< partial-success required-success success >> ) --> (write (crlf) | Goal | | succeeded. |)} ### If the state is marked with ^failure , the goal fails. sp {default*monitor*goal*failure :default (state ^superstate nil - ^verbose false) (state ^name ^desired ^<< partial-failure failure prohibit-failure >> ) --> (write (crlf) | Goal | | failed. |)} ### Print the evaluation of any object that has a name (which doesn't ### get states). sp {default*monitor*operator*evaluation :default (state ^superstate nil -^verbose false) (state ^operator ) ( ^type evaluation ^object ^evaluation ) ( ^ << numeric-value symbolic-value >> ) ( ^name ) --> (write (crlf) | Evaluation of | | (| |) is | )} sp {default*monitor*attribute-impasses :default (state ^superstate nil -^verbose false) (impasse ^object ^attribute ^impasse ) --> (write (crlf) | Impasse for | | ^| | type: | )}