
APT.all-test.Algebra.algebra.accept-input.convert-input-to-clause-form.process-value.soar Maven / Gradle / Ivy
sp {convert-input-to-clause-form*propose*process-value
(state ^name convert-input-to-clause-form
^top-state.problem.current-input-value { <> nil })
( -^value << |+| |*| |-| |/| |[| |]| |=| >>)
-->
( ^operator + =)
( ^name process-value)
}
## Split between nil and not nil cases is required for chunking to work
## can learn a general rule (with variable) and specific (test for nil)
## that overlap
########## If next is nil
#sp {convert-input-to-clause-form*apply*process-value*clause-beginning*number*nil
# (state ^operator.name process-value
# ^top-state.problem )
# (
^parse-clause
# ^current-input-value )
# ( ^parse-status clause-beginning)
# ( ^value { <> x <> |x| }
# ^next.value nil)
#-->
# ( ^current-input-value -
# nil)
# ( ^left-side )
# ( ^type number
# ^value (int ))
#}
#
#sp {convert-input-to-clause-form*apply*process-value*clause-beginning*variable*nil
# (state ^operator.name process-value
# ^top-state.problem )
# (
^parse-clause
# ^current-input-value )
# ( ^parse-status clause-beginning)
# ( ^value { << x |x| >> }
# ^next.value nil)
#-->
# ( ^current-input-value -
# nil)
#
# ( ^left-side )
# ( ^type variable
# ^value )
#}
#
#
#sp {convert-input-to-clause-form*apply*process-value*post-operation*nil
# (state ^operator.name process-value
# ^top-state.problem )
# (
^parse-clause
# ^current-input-value )
# ( ^parse-status post-operation)
# ( ^value { <> x <> |x| }
# ^next.value nil)
#-->
# ( ^current-input-value -
# nil)
# ( ^right-side )
# ( ^type number
# ^value (int ))
#}
#
#sp {convert-input-to-clause-form*apply*process-variable*post-operation*nil
# (state ^operator.name process-value
# ^top-state.problem )
# (
^parse-clause
# ^current-input-value )
# ( ^parse-status post-operation)
# ( ^value { << x |x| >> }
# ^next.value nil)
#-->
# ( ^current-input-value -
# nil)
# ( ^right-side )
# ( ^type variable
# ^value )
#}
#
#sp {convert-input-to-clause-form*apply*process-value*error*nil
# (state ^operator.name process-value
# ^top-state.problem )
# (
^parse-clause
# ^current-input-value )
# ( ^parse-status << post-right post-left post-close-bracket >>)
# ( ^value
# ^next.value nil)
#-->
# ( ^current-input-value -
# nil)
# ( ^right-side )
# ( ^type number
# ^value (int ))
#}
######### If next is not nil
sp {convert-input-to-clause-form*apply*process-value*clause-beginning*number
(state ^operator.name process-value
^top-state.problem )
(
^parse-clause
^current-input-value )
( ^parse-status clause-beginning)
( ^value { <> x <> |x| }
^next )
-->
( ^current-input-value -
)
( ^left-side )
( ^type number
^value (int ))
}
sp {convert-input-to-clause-form*apply*process-value*clause-beginning*variable
(state ^operator.name process-value
^top-state.problem )
(
^parse-clause
^current-input-value )
( ^parse-status clause-beginning)
( ^value { << x |x| >> }
^next )
-->
( ^current-input-value -
)
( ^left-side )
( ^type variable
^value )
}
sp {convert-input-to-clause-form*apply*process-value*post-operation
(state ^operator.name process-value
^top-state.problem )
(
^parse-clause
^current-input-value )
( ^parse-status post-operation)
( ^value { <> x <> |x| <> nil }
^next )
-->
( ^current-input-value -
)
( ^right-side )
( ^type number
^value (int ))
}
sp {convert-input-to-clause-form*apply*process-variable*post-operation
(state ^operator.name process-value
^top-state.problem )
(
^parse-clause
^current-input-value )
( ^parse-status post-operation)
( ^value { << x |x| >> }
^next )
-->
( ^current-input-value -
)
( ^right-side )
( ^type variable
^value )
}
sp {convert-input-to-clause-form*apply*process-value*error
(state ^operator.name process-value
^top-state.problem )
(
^parse-clause
^current-input-value )
( ^parse-status << post-right post-left post-close-bracket >>)
( ^value
^next )
-->
( ^current-input-value -
)
( ^right-side )
( ^type number
^value (int ))
}
sp {convert-input-to-clause-form*apply*process-value*failure
(state ^operator.name process-value
^top-state.problem )
(
^parse-clause.parse-status { <> post-operation <> clause-beginning } )
-->
(write (crlf) |Unexpected value.|)
(
^failed true)
}