You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the resulting syntax trees are cluttered with RuleNode(3, [...]). For example, the program for grab, move up, and finally move right is written as
(grab(); (moveUp(); moveRight()))
which corresponds to the RuleNodes: 3{11,3{9,6}}.
Note that this current Sequence syntax does not allow us to write variable-length sequences. It always results in a quote block with two children, the first one being another operation and the other being either an operation or another nested quote block.
Alternative
What if we let each Transformation take the next action as an argument? We would then remove the Sequence rules and maybe add a single End() terminal operation.
The expression would become
grab(moveUp(moveRight(End())))
and the RuleNode representation: `11{9,{6,{22}}
We can keep the interpret function mostly the same, meaning that we first apply grab to the state, thenmoveUp, etc. Functionally, it would be the same, but the resulting syntax trees will contain roughly half the number of nodes.
The text was updated successfully, but these errors were encountered:
Some ideas regarding the robot grammar after discussing today with @pwochner.
Current Implementation
In the new robot grammar, here:
HerbBenchmarks.jl/src/data/Robots_2020/grammar.jl
Lines 1 to 14 in a1a801b
the resulting syntax trees are cluttered with
RuleNode(3, [...])
. For example, the program for grab, move up, and finally move right is written aswhich corresponds to the
RuleNode
s:3{11,3{9,6}}
.Note that this current
Sequence
syntax does not allow us to write variable-length sequences. It always results in a quote block with two children, the first one being another operation and the other being either an operation or another nested quote block.Alternative
What if we let each
Transformation
take the next action as an argument? We would then remove theSequence
rules and maybe add a singleEnd()
terminal operation.The expression would become
and the
RuleNode
representation: `11{9,{6,{22}}We can keep the interpret function mostly the same, meaning that we first apply
grab
to the state, thenmoveUp
, etc. Functionally, it would be the same, but the resulting syntax trees will contain roughly half the number of nodes.The text was updated successfully, but these errors were encountered: