%% a move consists of an action %% and an old stack which is just a list of goals declare fun {SpellWrappedLiteral WL} case {Record.toList WL} of nil then WL % unwrapped else % wrapped {Label WL}#"("#WL.1#")" % assume just one end end fun {SpellListOfWrappedLiterals L} fun {Concat X Y} case X#Y of nil#Y then Y [] X#nil then X [] X#Y then X#" "#Y end end in {List.foldL L fun {$ Sofar ST} {Concat Sofar {SpellWrappedLiteral ST}} end nil} end fun {SpellRule LHS#Trigger#Rest} LHS#"->"#{SpellListOfWrappedLiterals Trigger}#"|"#{SpellListOfWrappedLiterals Rest} end fun {SpellAction A} case A of glc(Rule) then "glc("#{SpellRule Rule}#")" [] glccomplete(Rule) then "glccomplete("#{SpellRule Rule}#")" [] glccompletefinal(Rule) then "glccompletefinal("#{SpellRule Rule}#")" [] shift(W) then "shift("#W#")" [] shiftcomplete then "shiftcomplete" end end fun {SpellMove Thing} case Thing of move(action:A oldstack:S) then "move(action="#{SpellAction A}#" oldstack=["#{SpellListOfWrappedLiterals S}#"])\n" [] failing then "failing\n" [] done then "done\n" else Thing end end % {System.showInfo {SpellMove move(action:glc('N1'#['A']#['N1']) oldstack:[neg('A') 'NP' neg('DP') 'S'])}}