
APT.all-test.Pyramid.instruct.execute-solve-procedure.execute-step.execute-action.soar Maven / Gradle / Ivy
sp {execute-step*propose*execute-action
(state ^name execute-step
-^alternate-action
^current-problem )
( ^current-step.action
-^completed-action )
-->
( ^operator + =)
( ^name execute-action
^action )
}
sp {execute-step*propose*alternate-action
(state ^name execute-step
^alternate-action )
-->
( ^operator + =)
( ^name execute-action
^action )
}
########## SET
sp {apply*execute-action*set*from-constant
(state ^operator
^current-problem )
( ^name execute-action
^action )
( ^command set
^variable
^value
^value-type constant)
-->
( ^
^completed-action
^terms )
( ^term-name
^type intermediate
^term-initial-value )
(write |Set ^| | | )
}
sp {apply*execute-action*set*from-variable
(state ^operator
^current-problem )
( ^name execute-action
^action )
( ^command set
^variable
^value
^value-type variable)
( ^ )
-->
( ^
^terms )
( ^term-name
^type intermediate
^term-initial-value )
(write |Set ^| | | )
( ^completed-action )
}
sp {apply*execute-action*set*list
(state ^operator
^current-problem )
( ^name execute-action
^action )
( ^command set
^variable
^value-type list)
-->
( ^ )
( ^current
^next )
( ^completed-action )
(write |Create List ^| | | )
}
########## ADD
sp {apply*execute-action*add*from-constant
(state ^operator
^current-problem
^superstate )
( ^name execute-action
^action )
( ^command add
^variable
^value
^value-type constant)
( ^ )
-->
( ^ -
(+ )
^completed-action )
(write (crlf) |Add ^| | | | + | | = | (+ ))
}
sp {apply*execute-action*add*from-variable
(state ^operator
^current-problem )
( ^name execute-action
^action )
( ^command add
^variable
^value
^value-type variable)
( ^
^ { <> 0 })
-->
(write (crlf) |Add ^| | | | + | |: | | = | (+ ))
( ^ -)
( ^ (+ )
^completed-action )}
sp {apply*execute-action*add*from-variable*zero
(state ^operator
^current-problem )
( ^name execute-action
^action )
( ^command add
^variable
^value
^value-type variable)
( ^
^ 0)
-->
( ^completed-action )
(write |Add ^| | | | + | |: 0 = | )
}
########## SUBTRACT
sp {apply*execute-action*subtract*from-constant
(state ^operator
^current-problem )
( ^name execute-action
^action )
( ^command subtract
^variable
^value
^value-type constant)
( ^ )
-->
( ^ -
(- )
^completed-action )
(write |Subtract ^| | | | - | | = | (- ))
}
sp {apply*execute-action*subtract*from-variable
(state ^operator
^current-problem )
( ^name execute-action
^action )
( ^command subtract
^variable
^value
^value-type variable)
( ^
^ )
-->
( ^ -
(- )
^completed-action )
(write |Subtract ^| | | | - | |: | | = | (- ))
}
########## INCREMENT
sp {apply*execute-action*increment
(state ^operator
^current-problem )
( ^name execute-action
^action )
( ^command increment
^variable )
( ^ )
-->
( ^ -
(+ 1)
^completed-action )
(write |Increment ^| | | | = | (+ 1))
}
########## DECREMENT
sp {apply*execute-action*decrement
(state ^operator
^current-problem )
( ^name execute-action
^action )
( ^command decrement
^variable )
( ^ )
-->
( ^ -
(- 1)
^completed-action )
(write |Decrement ^| | | | = | (- 1))
}
########## WRITE - Add to a linked list?
sp {apply*execute-action*write
(state ^operator
^current-problem )
( ^name execute-action
^action )
( ^command write
^variable
^save-command
^list )
( ^ -
^
)
(- ^current
)
-->
(- ^current
-
)
( ^command
^value
^variable
^next )
( ^completed-action )
(write |write: | |: | | (| |)|)
}
########## GOAL-TEST
sp {apply*execute-action*goal-test*equal*variable
(state ^operator
^current-problem )
( ^name execute-action
^action )
( ^command goal-test
^relation equal
^variable
^value
^value-type variable)
( ^
^ )
-->
( ^goal-test-success