'# Teach Maple (through depends and eval) about our new binding forms.\n' Comment.Single

'# forall bind from 1st arg to 2nd arg.\n' Comment.Single

'# Ints,Sums,ints,sums bind from 2nd arg to 1st arg, and also from each element\n' Comment.Single

'#   of the 4th arg to the other elements on the left and to the 3rd arg.\n' Comment.Single

'\n'          Text.Whitespace

'`depends/forall`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'bvar'        Name
','           Operator
' '           Text.Whitespace
'pred'        Name
','           Operator
' '           Text.Whitespace
'x'           Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n  '        Text.Whitespace
'depends'     Name
'('           Punctuation
'pred'        Name
','           Operator
' '           Text.Whitespace
'x'           Name
' '           Text.Whitespace
'minus'       Keyword
' '           Text.Whitespace
'convert'     Name.Builtin
'('           Punctuation
'bvar'        Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'set'         Name
"'"           Punctuation
'))'          Punctuation
'\n'          Text.Whitespace

'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
':'           Operator
'\n\n'        Text.Whitespace

'`depends/Ints`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'body'        Name
','           Operator
' '           Text.Whitespace
'bvar'        Name
','           Operator
' '           Text.Whitespace
'rng'         Name
','           Operator
' '           Text.Whitespace
'loops'       Name
','           Operator
' '           Text.Whitespace
'x'           Name
','           Operator
' '           Text.Whitespace
'y'           Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n  '        Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'xx'          Name
','           Operator
' '           Text.Whitespace
'i'           Name
';'           Punctuation
'\n  '        Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'nargs'       Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'5'           Literal.Number.Integer
' '           Text.Whitespace
'then'        Keyword
'\n    '      Text.Whitespace
'xx'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'x'           Name
';'           Punctuation
' '           Text.Whitespace
'# y is ununsed and x lists the variables to look for\n' Comment.Single

'  '          Text.Whitespace
'else'        Keyword
'\n    '      Text.Whitespace
'xx'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'y'           Name
';'           Punctuation
' '           Text.Whitespace
'# x is some KB and y lists the variables to look for\n' Comment.Single

'    '        Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'depends'     Name
'('           Punctuation
'x'           Name
','           Operator
' '           Text.Whitespace
'y'           Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'true'        Name
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n  '        Text.Whitespace
"# don't remove bvar from xx!\n" Comment.Single

'  '          Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'depends'     Name
'('           Punctuation
'body'        Name
','           Operator
' '           Text.Whitespace
'xx'          Name
' '           Text.Whitespace
'minus'       Keyword
' '           Text.Whitespace
'{'           Punctuation
'bvar'        Name
'})'          Punctuation
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'true'        Name
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n  '        Text.Whitespace
'for'         Keyword
' '           Text.Whitespace
'i'           Name
' '           Text.Whitespace
'from'        Keyword
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'loops'       Name
')'           Punctuation
' '           Text.Whitespace
'to'          Keyword
' '           Text.Whitespace
'1'           Literal.Number.Integer
' '           Text.Whitespace
'by'          Keyword
' '           Text.Whitespace
'-'           Operator
'1'           Literal.Number.Integer
' '           Text.Whitespace
'do'          Keyword
'\n    '      Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'depends'     Name
'('           Punctuation
'op'          Name.Builtin
'(['          Punctuation
'i'           Name
','           Operator
'2'           Literal.Number.Integer
']'           Punctuation
','           Operator
'loops'       Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'xx'          Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'true'        Name
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'xx'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'xx'          Name
' '           Text.Whitespace
'minus'       Keyword
' '           Text.Whitespace
'{'           Punctuation
'op'          Name.Builtin
'(['          Punctuation
'i'           Name
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'loops'       Name
')};'         Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'do'          Keyword
';'           Punctuation
'\n  '        Text.Whitespace
'depends'     Name
'('           Punctuation
'rng'         Name
','           Operator
' '           Text.Whitespace
'xx'          Name
')'           Punctuation
'\n'          Text.Whitespace

'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
':'           Operator
'\n'          Text.Whitespace

'`depends/Sums`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'`depends/Ints`' Name
')'           Punctuation
':'           Operator
'\n'          Text.Whitespace

'`depends/ints`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'`depends/Ints`' Name
')'           Punctuation
':'           Operator
'\n'          Text.Whitespace

'`depends/sums`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'`depends/Ints`' Name
')'           Punctuation
':'           Operator
'\n\n'        Text.Whitespace

'`eval/forall`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'eqs'         Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n  '        Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'bvar'        Name
','           Operator
' '           Text.Whitespace
'pred'        Name
';'           Punctuation
'\n  '        Text.Whitespace
'bvar'        Name
','           Operator
' '           Text.Whitespace
'pred'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'e'           Name
');'          Punctuation
'\n  '        Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'0'           Literal.Number.Integer
','           Operator
'e'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'eqs'         Name
')('          Punctuation
'BindingTools' Name
':'           Operator
'-'           Operator
'generic_evalat' Name
'('           Punctuation
'bvar'        Name
','           Operator
' '           Text.Whitespace
'pred'        Name
','           Operator
' '           Text.Whitespace
'eqs'         Name
'))'          Punctuation
'\n'          Text.Whitespace

'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
':'           Operator
'\n\n'        Text.Whitespace

'`eval/Ints`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'eqs'         Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n  '        Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'body'        Name
','           Operator
' '           Text.Whitespace
'bvar'        Name
','           Operator
' '           Text.Whitespace
'rng'         Name
','           Operator
' '           Text.Whitespace
'loops'       Name
','           Operator
' '           Text.Whitespace
'n'           Name
','           Operator
' '           Text.Whitespace
'i'           Name
';'           Punctuation
'\n  '        Text.Whitespace
'body'        Name
','           Operator
' '           Text.Whitespace
'bvar'        Name
','           Operator
' '           Text.Whitespace
'rng'         Name
','           Operator
' '           Text.Whitespace
'loops'       Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
'..'          Punctuation
'4'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'e'           Name
');'          Punctuation
'\n  '        Text.Whitespace
'bvar'        Name
','           Operator
' '           Text.Whitespace
'body'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'BindingTools' Name
':'           Operator
'-'           Operator
'generic_evalat' Name
'('           Punctuation
'bvar'        Name
','           Operator
' '           Text.Whitespace
'body'        Name
','           Operator
' '           Text.Whitespace
'eqs'         Name
');'          Punctuation
'\n  '        Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'0'           Literal.Number.Integer
','           Operator
'e'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'eqs'         Name
')('          Punctuation
'body'        Name
','           Operator
' '           Text.Whitespace
'bvar'        Name
','           Operator
'\n                     ' Text.Whitespace
'BindingTools' Name
':'           Operator
'-'           Operator
'generic_evalatstar' Name
'('           Punctuation
'rng'         Name
','           Operator
' '           Text.Whitespace
'loops'       Name
','           Operator
' '           Text.Whitespace
'eqs'         Name
')'           Punctuation
','           Operator
'\n                     ' Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'5'           Literal.Number.Integer
'..'          Punctuation
'-'           Operator
'1'           Literal.Number.Integer
','           Operator
'e'           Name
'))'          Punctuation
'\n'          Text.Whitespace

'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
':'           Operator
'\n'          Text.Whitespace

'`eval/Sums`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'`eval/Ints`' Name
')'           Punctuation
':'           Operator
'\n'          Text.Whitespace

'`eval/ints`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'`eval/Ints`' Name
')'           Punctuation
':'           Operator
'\n'          Text.Whitespace

'`eval/sums`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'`eval/Ints`' Name
')'           Punctuation
':'           Operator
'\n\n'        Text.Whitespace

'`eval/Int`'  Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'eqs'         Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n  '        Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'body'        Name
','           Operator
' '           Text.Whitespace
'bound'       Name
','           Operator
' '           Text.Whitespace
'bvar'        Name
';'           Punctuation
'\n  '        Text.Whitespace
'body'        Name
','           Operator
' '           Text.Whitespace
'bound'       Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
'..'          Punctuation
'2'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'e'           Name
');'          Punctuation
'\n  '        Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'bound'       Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'name'        Name
' '           Text.Whitespace
'then'        Keyword
'\n    '      Text.Whitespace
'bound'       Name
','           Operator
' '           Text.Whitespace
'body'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'BindingTools' Name
':'           Operator
'-'           Operator
'generic_evalat' Name
'('           Punctuation
'bound'       Name
','           Operator
' '           Text.Whitespace
'body'        Name
','           Operator
' '           Text.Whitespace
'eqs'         Name
');'          Punctuation
'\n  '        Text.Whitespace
'elif'        Keyword
' '           Text.Whitespace
'bound'       Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'`=`'         Name
' '           Text.Whitespace
'then'        Keyword
'\n    '      Text.Whitespace
'bvar'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'lhs'         Name.Builtin
'('           Punctuation
'bound'       Name
');'          Punctuation
'\n    '      Text.Whitespace
'bvar'        Name
','           Operator
' '           Text.Whitespace
'body'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'BindingTools' Name
':'           Operator
'-'           Operator
'generic_evalat' Name
'('           Punctuation
'bvar'        Name
','           Operator
' '           Text.Whitespace
'body'        Name
','           Operator
' '           Text.Whitespace
'eqs'         Name
');'          Punctuation
'\n    '      Text.Whitespace
'bound'       Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'bvar'        Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'rhs'         Name.Builtin
'('           Punctuation
'bound'       Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'eqs'         Name
');'          Punctuation
'\n  '        Text.Whitespace
'else'        Keyword
'\n    '      Text.Whitespace
'body'        Name
','           Operator
' '           Text.Whitespace
'bound'       Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'BindingTools' Name
':'           Operator
'-'           Operator
'generic_evalatstar' Name
'('           Punctuation
'body'        Name
','           Operator
' '           Text.Whitespace
'bound'       Name
','           Operator
' '           Text.Whitespace
'eqs'         Name
');'          Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n  '        Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'0'           Literal.Number.Integer
','           Operator
'e'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'eqs'         Name
')('          Punctuation
'body'        Name
','           Operator
' '           Text.Whitespace
'bound'       Name
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'eval'        Name.Builtin
'(['          Punctuation
'op'          Name.Builtin
'('           Punctuation
'3'           Literal.Number.Integer
'..'          Punctuation
'-'           Operator
'1'           Literal.Number.Integer
','           Operator
'e'           Name
')]'          Punctuation
','           Operator
' '           Text.Whitespace
'eqs'         Name
')))'         Punctuation
'\n'          Text.Whitespace

'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
':'           Operator
'\n'          Text.Whitespace

'`eval/Sum`'  Name
'     '       Text.Whitespace
':='          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'`eval/Int`'  Name
')'           Punctuation
':'           Operator
'\n'          Text.Whitespace

'`eval/Product`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'`eval/Int`'  Name
')'           Punctuation
':'           Operator
'\n'          Text.Whitespace

'`eval/int`'  Name
'     '       Text.Whitespace
':='          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'`eval/Int`'  Name
')'           Punctuation
':'           Operator
'\n'          Text.Whitespace

'`eval/sum`'  Name
'     '       Text.Whitespace
':='          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'`eval/Int`'  Name
')'           Punctuation
':'           Operator
'\n'          Text.Whitespace

'`eval/product`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'`eval/Int`'  Name
')'           Punctuation
':'           Operator
'\n\n'        Text.Whitespace

'#############################################################################\n' Comment.Single

'\n'          Text.Whitespace

'Loop'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'module'      Keyword
' '           Text.Whitespace
'()'          Punctuation
'\n  '        Text.Whitespace
'option'      Keyword
' '           Text.Whitespace
'package'     Name
';'           Punctuation
'\n  '        Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'intssums'    Name
','           Operator
' '           Text.Whitespace
'enter_piecewise' Name
','           Operator
' '           Text.Whitespace
'wrap'        Name
','           Operator
'\n        '  Text.Whitespace
't_peel'      Name
','           Operator
' '           Text.Whitespace
'do_peel'     Name
','           Operator
' '           Text.Whitespace
'do_split'    Name
','           Operator
' '           Text.Whitespace
'do_graft'    Name
','           Operator
' '           Text.Whitespace
'do_rebase_lower' Name
','           Operator
' '           Text.Whitespace
'do_rebase_upper' Name
','           Operator
'\n        '  Text.Whitespace
'Binder'      Name
','           Operator
' '           Text.Whitespace
'Stmt'        Name
','           Operator
' '           Text.Whitespace
't_binder'    Name
','           Operator
' '           Text.Whitespace
't_stmt'      Name
','           Operator
' '           Text.Whitespace
't_exp'       Name
','           Operator
'\n        '  Text.Whitespace
'ModuleLoad'  Name
';'           Punctuation
'\n  '        Text.Whitespace
'export'      Keyword
'\n     '     Text.Whitespace
'# These first few are smart constructors (for themselves):\n' Comment.Single

'         '   Text.Whitespace
'ints'        Name
','           Operator
' '           Text.Whitespace
'sums'        Name
','           Operator
'\n     '     Text.Whitespace
'# while these are "proper functions"\n' Comment.Single

'         '   Text.Whitespace
'mk_HArray'   Name
','           Operator
' '           Text.Whitespace
'genLoop'     Name
','           Operator
' '           Text.Whitespace
'unproducts'  Name
','           Operator
' '           Text.Whitespace
'unproduct'   Name
','           Operator
'\n         ' Text.Whitespace
'peel'        Name
','           Operator
' '           Text.Whitespace
'split'       Name
','           Operator
' '           Text.Whitespace
'graft'       Name
','           Operator
' '           Text.Whitespace
'rebase_lower' Name
','           Operator
' '           Text.Whitespace
'rebase_upper' Name
','           Operator
' '           Text.Whitespace
'Print'       Name
';'           Punctuation
'\n  '        Text.Whitespace
'# these names are not assigned (and should not be).  But they are\n' Comment.Single

'  '          Text.Whitespace
'# used as global names, so document that here.\n' Comment.Single

'  '          Text.Whitespace
'global'      Keyword
' '           Text.Whitespace
'Ints'        Name
','           Operator
' '           Text.Whitespace
'Sums'        Name
','           Operator
' '           Text.Whitespace
'csgn'        Name
','           Operator
' '           Text.Whitespace
'sum'         Name
','           Operator
' '           Text.Whitespace
'signum'      Name
';'           Punctuation
'\n  '        Text.Whitespace
'uses'        Keyword
' '           Text.Whitespace
'Hakaru'      Name
','           Operator
' '           Text.Whitespace
'KB'          Name
','           Operator
' '           Text.Whitespace
'Utilities'   Name
';'           Punctuation
'\n\n  '      Text.Whitespace
't_binder'    Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
"'"           Punctuation
'Binder'      Name
'('           Punctuation
'identical'   Name
'('           Punctuation
'product'     Name
','           Operator
' '           Text.Whitespace
'Product'     Name
','           Operator
' '           Text.Whitespace
'sum'         Name
','           Operator
' '           Text.Whitespace
'Sum'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
't_kb'        Name
')'           Punctuation
"'"           Punctuation
';'           Punctuation
'\n  '        Text.Whitespace
't_stmt'      Name
'   '         Text.Whitespace
':='          Operator
' '           Text.Whitespace
"'"           Punctuation
'Stmt'        Name
'('           Punctuation
'anything'    Name
','           Operator
' '           Text.Whitespace
'list'        Name
','           Operator
' '           Text.Whitespace
'list'        Name
')'           Punctuation
"'"           Punctuation
';'           Punctuation
'\n  '        Text.Whitespace
't_exp'       Name
'    '        Text.Whitespace
':='          Operator
' '           Text.Whitespace
"'"           Punctuation
'{'           Punctuation
'Stmt'        Name
'('           Punctuation
'identical'   Name
'('           Punctuation
'exp'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'[]'          Punctuation
','           Operator
' '           Text.Whitespace
'[])'         Punctuation
','           Operator
'\n                ' Text.Whitespace
'Stmt'        Name
'('           Punctuation
'identical'   Name
'('           Punctuation
'`^`'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'['           Punctuation
'anything'    Name
']'           Punctuation
','           Operator
' '           Text.Whitespace
'[])}'        Punctuation
"'"           Punctuation
';'           Punctuation
'\n\n  '      Text.Whitespace
'ints'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'()'          Punctuation
' '           Text.Whitespace
'intssums'    Name
'('           Punctuation
"'"           Punctuation
'ints'        Name
"'"           Punctuation
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'int'         Name
"'"           Punctuation
','           Operator
' '           Text.Whitespace
'_passed'     Name
')'           Punctuation
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n  '        Text.Whitespace
'sums'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'()'          Punctuation
' '           Text.Whitespace
'intssums'    Name
'('           Punctuation
"'"           Punctuation
'sums'        Name
"'"           Punctuation
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'sum'         Name
"'"           Punctuation
','           Operator
' '           Text.Whitespace
'_passed'     Name
')'           Punctuation
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'Print'       Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'kind'        Name
'::'          Operator
'identical'   Name
'('           Punctuation
'Ints'        Name
','           Operator
'Sums'        Name
','           Operator
'ints'        Name
','           Operator
'sums'        Name
')'           Punctuation
','           Operator
'e'           Name
','           Operator
'v'           Name
'::'          Operator
'name'        Name
','           Operator
'r0'          Name
'::'          Operator
'range'       Name
','           Operator
'rs'          Name
'::'          Operator
'list'        Name
'('           Punctuation
'name'        Name
'='           Operator
'range'       Name
')'           Punctuation
','           Operator
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'k'           Name
';'           Punctuation
'\n    '      Text.Whitespace
'k'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'StringTools' Name
'['           Punctuation
'Capitalize'  Name
']('          Punctuation
'StringTools' Name
'['           Punctuation
'Chop'        Name
']('          Punctuation
'convert'     Name.Builtin
'('           Punctuation
'kind'        Name
','           Operator
'string'      Name
')));'        Punctuation
'\n    '      Text.Whitespace
'k'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'parse'       Name.Builtin
'('           Punctuation
'cat'         Name.Builtin
'('           Punctuation
'"`print/"'   Literal.String
','           Operator
'eval'        Name.Builtin
'('           Punctuation
'k'           Name
')'           Punctuation
','           Operator
'"`"'         Literal.String
'));'         Punctuation
'\n    '      Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'k'           Name
')('          Punctuation
'e'           Name
','           Operator
'v'           Name
'['           Punctuation
'op'          Name.Builtin
'('           Punctuation
'rs'          Name
')]'          Punctuation
'='           Operator
'r0'          Name
');'          Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'intssums'    Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'makes'       Name
'::'          Operator
'name'        Name
','           Operator
' '           Text.Whitespace
'make'        Name
'::'          Operator
'name'        Name
','           Operator
'\n                   ' Text.Whitespace
'e'           Name
'::'          Operator
'anything'    Name
','           Operator
' '           Text.Whitespace
'x'           Name
'::'          Operator
'name'        Name
','           Operator
' '           Text.Whitespace
'rr'          Name
'::'          Operator
'range'       Name
','           Operator
' '           Text.Whitespace
'll'          Name
'::'          Operator
'list'        Name
'('           Punctuation
'name'        Name
'='           Operator
'range'       Name
')'           Punctuation
','           Operator
'\n                   ' Text.Whitespace
'kb'          Name
'::'          Operator
't_kb'        Name
':='          Operator
'empty'       Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
't'           Name
','           Operator
' '           Text.Whitespace
'r'           Name
','           Operator
' '           Text.Whitespace
'l'           Name
','           Operator
' '           Text.Whitespace
'kb2'         Name
','           Operator
' '           Text.Whitespace
'w0'          Name
','           Operator
' '           Text.Whitespace
'pp'          Name
','           Operator
' '           Text.Whitespace
'i'           Name
';'           Punctuation
'\n    '      Text.Whitespace
't'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'`if`'        Name
'('           Punctuation
'make'        Name
'='           Operator
'int'         Name
','           Operator
' '           Text.Whitespace
'HReal'       Name
'('           Punctuation
'open_bounds' Name
'('           Punctuation
'rr'          Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'HInt'        Name
'('           Punctuation
'closed_bounds' Name
'('           Punctuation
'rr'          Name
')));'        Punctuation
'\n    '      Text.Whitespace
'r'           Name
','           Operator
' '           Text.Whitespace
'l'           Name
','           Operator
' '           Text.Whitespace
'kb2'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'genLoop'     Name
'('           Punctuation
'rr'          Name
','           Operator
' '           Text.Whitespace
'll'          Name
','           Operator
' '           Text.Whitespace
'kb'          Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'Integrand'   Name
"'"           Punctuation
'('           Punctuation
'x'           Name
','           Operator
'e'           Name
'));'         Punctuation
'\n    '      Text.Whitespace
'w0'          Name
','           Operator
' '           Text.Whitespace
'pp'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'unproducts'  Name
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'x'           Name
','           Operator
' '           Text.Whitespace
'l'           Name
','           Operator
' '           Text.Whitespace
'kb2'         Name
');'          Punctuation
'\n    '      Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'depends'     Name
'('           Punctuation
'w0'          Name
','           Operator
' '           Text.Whitespace
'x'           Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n      '    Text.Whitespace
"'"           Punctuation
'makes'       Name
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'x'           Name
','           Operator
' '           Text.Whitespace
'rr'          Name
','           Operator
' '           Text.Whitespace
'll'          Name
')'           Punctuation
"'"           Punctuation
'\n    '      Text.Whitespace
'else'        Keyword
'\n      '    Text.Whitespace
'pp'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
"'"           Punctuation
'make'        Name
"'"           Punctuation
'('           Punctuation
'pp'          Name
','           Operator
' '           Text.Whitespace
'x'           Name
'='           Operator
'r'           Name
');'          Punctuation
'\n      '    Text.Whitespace
'for'         Keyword
' '           Text.Whitespace
'i'           Name
' '           Text.Whitespace
'in'          Keyword
' '           Text.Whitespace
'l'           Name
' '           Text.Whitespace
'do'          Keyword
' '           Text.Whitespace
'pp'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
"'"           Punctuation
'product'     Name
"'"           Punctuation
'('           Punctuation
'pp'          Name
','           Operator
' '           Text.Whitespace
'i'           Name
')'           Punctuation
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'do'          Keyword
';'           Punctuation
'\n      '    Text.Whitespace
'NewSLO'      Name
':'           Operator
'-'           Operator
'simplify_factor_assuming' Name
'('           Punctuation
'w0'          Name
' '           Text.Whitespace
'*'           Operator
' '           Text.Whitespace
'pp'          Name
','           Operator
' '           Text.Whitespace
'kb'          Name
');'          Punctuation
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'mk_HArray'   Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
't'           Name
'::'          Operator
't_type'      Name
','           Operator
' '           Text.Whitespace
'loops'       Name
'::'          Operator
'list'        Name
'('           Punctuation
'name'        Name
'='           Operator
'range'       Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'res'         Name
','           Operator
' '           Text.Whitespace
'i'           Name
';'           Punctuation
'\n    '      Text.Whitespace
'res'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
't'           Name
';'           Punctuation
'\n    '      Text.Whitespace
'for'         Keyword
' '           Text.Whitespace
'i'           Name
' '           Text.Whitespace
'in'          Keyword
' '           Text.Whitespace
'loops'       Name
' '           Text.Whitespace
'do'          Keyword
' '           Text.Whitespace
'res'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'HArray'      Name
'('           Punctuation
'res'         Name
')'           Punctuation
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'do'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'res'         Name
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'genLoop'     Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'loops'       Name
'::'          Operator
'list'        Name
'('           Punctuation
'name'        Name
'='           Operator
'range'       Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'kb'          Name
'::'          Operator
't_kb'        Name
')'           Punctuation
'\n    '      Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'kb1'         Name
','           Operator
' '           Text.Whitespace
'rng'         Name
','           Operator
' '           Text.Whitespace
'ind'         Name
','           Operator
' '           Text.Whitespace
'do_subst'    Name
','           Operator
' '           Text.Whitespace
'i'           Name
';'           Punctuation
'\n    '      Text.Whitespace
'kb1'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'kb'          Name
';'           Punctuation
'\n    '      Text.Whitespace
'rng'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'table'       Name.Builtin
'();'         Punctuation
'\n    '      Text.Whitespace
'ind'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'table'       Name.Builtin
'();'         Punctuation
'\n    '      Text.Whitespace
'do_subst'    Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'e'           Name
' '           Text.Whitespace
'->'          Operator
' '           Text.Whitespace
'foldl'       Name
'((('         Punctuation
'e'           Name
','           Operator
'eq'          Name
')'           Punctuation
' '           Text.Whitespace
'->'          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'(['          Punctuation
'lhs'         Name.Builtin
'('           Punctuation
'eq'          Name
')'           Punctuation
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'loops'       Name
')'           Punctuation
'='           Operator
'rhs'         Name.Builtin
'('           Punctuation
'eq'          Name
')))'         Punctuation
','           Operator
'\n                           ' Text.Whitespace
'e'           Name
','           Operator
' '           Text.Whitespace
'entries'     Name.Builtin
'('           Punctuation
'ind'         Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'pairs'       Name
"'"           Punctuation
'));'         Punctuation
'\n    '      Text.Whitespace
'for'         Keyword
' '           Text.Whitespace
'i'           Name
' '           Text.Whitespace
'from'        Keyword
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'loops'       Name
')'           Punctuation
' '           Text.Whitespace
'to'          Keyword
' '           Text.Whitespace
'1'           Literal.Number.Integer
' '           Text.Whitespace
'by'          Keyword
' '           Text.Whitespace
'-'           Operator
'1'           Literal.Number.Integer
' '           Text.Whitespace
'do'          Keyword
'\n      '    Text.Whitespace
'rng'         Name
'['           Punctuation
'i'           Name
']'           Punctuation
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'do_subst'    Name
'('           Punctuation
'op'          Name.Builtin
'(['          Punctuation
'i'           Name
','           Operator
'2'           Literal.Number.Integer
']'           Punctuation
','           Operator
'loops'       Name
'));'         Punctuation
'\n      '    Text.Whitespace
'ind'         Name
'['           Punctuation
'i'           Name
']'           Punctuation
','           Operator
' '           Text.Whitespace
'kb1'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'genType'     Name
'('           Punctuation
'op'          Name.Builtin
'(['          Punctuation
'i'           Name
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'loops'       Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'HInt'        Name
'('           Punctuation
'closed_bounds' Name
'('           Punctuation
'rng'         Name
'['           Punctuation
'i'           Name
']))'         Punctuation
','           Operator
'\n                               ' Text.Whitespace
'kb1'         Name
','           Operator
' '           Text.Whitespace
'_rest'       Name
');'          Punctuation
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'do'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'do_subst'    Name
'('           Punctuation
'e'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'zip'         Name
'('           Punctuation
'`=`'         Name
','           Operator
' '           Text.Whitespace
'['           Punctuation
'entries'     Name.Builtin
'('           Punctuation
'ind'         Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'nolist'      Name
"'"           Punctuation
')]'          Punctuation
','           Operator
'\n                          ' Text.Whitespace
'['           Punctuation
'entries'     Name.Builtin
'('           Punctuation
'rng'         Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'nolist'      Name
"'"           Punctuation
')])'         Punctuation
','           Operator
' '           Text.Whitespace
'kb1'         Name
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'unproducts'  Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'w'           Name
','           Operator
' '           Text.Whitespace
'x'           Name
'::'          Operator
'name'        Name
','           Operator
' '           Text.Whitespace
'loops'       Name
'::'          Operator
'list'        Name
'('           Punctuation
'name'        Name
'='           Operator
'range'       Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'kb'          Name
'::'          Operator
't_kb'        Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'w0'          Name
','           Operator
' '           Text.Whitespace
'pp'          Name
','           Operator
' '           Text.Whitespace
'j'           Name
','           Operator
' '           Text.Whitespace
'w1'          Name
','           Operator
' '           Text.Whitespace
'w2'          Name
','           Operator
' '           Text.Whitespace
'loop'        Name
';'           Punctuation
'\n    '      Text.Whitespace
'w0'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
';'           Punctuation
'\n    '      Text.Whitespace
'pp'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'w'           Name
';'           Punctuation
'\n    '      Text.Whitespace
'for'         Keyword
' '           Text.Whitespace
'j'           Name
' '           Text.Whitespace
'from'        Keyword
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'loops'       Name
')'           Punctuation
' '           Text.Whitespace
'to'          Keyword
' '           Text.Whitespace
'1'           Literal.Number.Integer
' '           Text.Whitespace
'by'          Keyword
' '           Text.Whitespace
'-'           Operator
'1'           Literal.Number.Integer
' '           Text.Whitespace
'do'          Keyword
'\n      '    Text.Whitespace
'w1'          Name
','           Operator
' '           Text.Whitespace
'pp'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'unproduct'   Name
'('           Punctuation
'pp'          Name
','           Operator
' '           Text.Whitespace
'x'           Name
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'j'           Name
','           Operator
'loops'       Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'[]'          Punctuation
','           Operator
' '           Text.Whitespace
'`*`'         Name
','           Operator
' '           Text.Whitespace
'kb'          Name
','           Operator
' '           Text.Whitespace
'kb'          Name
'));'         Punctuation
'\n      '    Text.Whitespace
'# separate out each of the factors in w1, as they might have different\n' Comment.Single

'      '      Text.Whitespace
'# variable dependencies, which can be exploited by other routines\n' Comment.Single

'      '      Text.Whitespace
'w2'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'convert'     Name.Builtin
'('           Punctuation
'w1'          Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'list'        Name
"'"           Punctuation
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'`*`'         Name
"'"           Punctuation
');'          Punctuation
'\n      '    Text.Whitespace
'for'         Keyword
' '           Text.Whitespace
'loop'        Name
' '           Text.Whitespace
'in'          Keyword
' '           Text.Whitespace
'['           Punctuation
'op'          Name.Builtin
'('           Punctuation
'j'           Name
'+'           Operator
'1'           Literal.Number.Integer
'..'          Punctuation
'-'           Operator
'1'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'loops'       Name
')]'          Punctuation
' '           Text.Whitespace
'do'          Keyword
'\n        '  Text.Whitespace
'w2'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'map'         Name.Builtin
'(('          Punctuation
'w'           Name
' '           Text.Whitespace
'->'          Operator
' '           Text.Whitespace
'product'     Name
'('           Punctuation
'eval'        Name.Builtin
'('           Punctuation
'w'           Name
','           Operator
' '           Text.Whitespace
'x'           Name
'='           Operator
'idx'         Name
'('           Punctuation
'x'           Name
','           Operator
'lhs'         Name.Builtin
'('           Punctuation
'loop'        Name
')))'         Punctuation
','           Operator
' '           Text.Whitespace
'loop'        Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'w2'          Name
');'          Punctuation
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'do'          Keyword
';'           Punctuation
'\n      '    Text.Whitespace
'w0'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'w0'          Name
' '           Text.Whitespace
'*'           Operator
' '           Text.Whitespace
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'w2'          Name
'));'         Punctuation
'\n      '    Text.Whitespace
'# w0 := w0 * foldl(product, w1, op(j+1..-1, loops));\n' Comment.Single

'    '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'do'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'# Rewrite ... * piecewise(i<=kk-1, xs^2, 1)\n' Comment.Single

'    '        Text.Whitespace
'#      to ... * xs ^ (2*piecewise(i<=kk-1, 1))\n' Comment.Single

'    '        Text.Whitespace
'# because the latter is easier to integrate and recognize with respect to xs\n' Comment.Single

'    '        Text.Whitespace
'pp'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'for_poly'    Name
'('           Punctuation
'pp'          Name
','           Operator
' '           Text.Whitespace
'# TODO: move this rewrite into eval_factor (then remove for_poly?)?\n' Comment.Single

'      '      Text.Whitespace
'proc'        Keyword
' '           Text.Whitespace
'('           Punctuation
'p'           Name
')'           Punctuation
'\n        '  Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'n'           Name
','           Operator
' '           Text.Whitespace
's'           Name
','           Operator
' '           Text.Whitespace
'r'           Name
';'           Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'p'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
"'"           Punctuation
'And'         Name
'('           Punctuation
'specfunc'    Name
'('           Punctuation
'piecewise'   Name.Builtin
')'           Punctuation
','           Operator
' '           Text.Whitespace
'anyfunc'     Name
'('           Punctuation
'freeof'      Name
'('           Punctuation
'x'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'anything'    Name
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
'))'          Punctuation
"'"           Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'n'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'indets'      Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'p'           Name
')'           Punctuation
','           Operator
'name'        Name
');'          Punctuation
'\n          ' Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'p'           Name
')'           Punctuation
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'{'           Punctuation
"'"           Punctuation
'exp'         Name
'('           Punctuation
'anything'    Name
')'           Punctuation
"'"           Punctuation
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'`^`'         Name
"'"           Punctuation
'('           Punctuation
"'"           Punctuation
'freeof'      Name
"'"           Punctuation
'('           Punctuation
'n'           Name
')'           Punctuation
','           Operator
"'"           Punctuation
'anything'    Name
"'"           Punctuation
')}'          Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n            ' Text.Whitespace
's'           Name
','           Operator
' '           Text.Whitespace
'r'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'selectremove' Name.Builtin
'('           Punctuation
'depends'     Name
','           Operator
' '           Text.Whitespace
'convert'     Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'-'           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'p'           Name
')'           Punctuation
','           Operator
"'"           Punctuation
'list'        Name
"'"           Punctuation
','           Operator
"'"           Punctuation
'`*`'         Name
"'"           Punctuation
')'           Punctuation
','           Operator
' '           Text.Whitespace
'n'           Name
');'          Punctuation
'\n            ' Text.Whitespace
'subsop'      Name.Builtin
'('           Punctuation
'-'           Operator
'1'           Literal.Number.Integer
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'`*`'         Name
'('           Punctuation
'piecewise'   Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'p'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
's'           Name
')))'         Punctuation
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'r'           Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'p'           Name
'))'          Punctuation
'\n          ' Text.Whitespace
'else'        Keyword
'\n            ' Text.Whitespace
's'           Name
','           Operator
' '           Text.Whitespace
'r'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'selectremove' Name.Builtin
'('           Punctuation
'depends'     Name
','           Operator
' '           Text.Whitespace
'convert'     Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'p'           Name
')'           Punctuation
','           Operator
"'"           Punctuation
'list'        Name
"'"           Punctuation
','           Operator
"'"           Punctuation
'`*`'         Name
"'"           Punctuation
')'           Punctuation
','           Operator
' '           Text.Whitespace
'n'           Name
');'          Punctuation
'\n            ' Text.Whitespace
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'r'           Name
'))'          Punctuation
' '           Text.Whitespace
'^'           Operator
' '           Text.Whitespace
'piecewise'   Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'p'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
')'           Punctuation
'\n              ' Text.Whitespace
'*'           Operator
' '           Text.Whitespace
'`if`'        Name
'('           Punctuation
'nops'        Name.Builtin
'('           Punctuation
's'           Name
')'           Punctuation
' '           Text.Whitespace
'>'           Operator
' '           Text.Whitespace
'0'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'piecewise'   Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'p'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
's'           Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
')'           Punctuation
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
')'           Punctuation
'\n          ' Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n        '  Text.Whitespace
'else'        Keyword
'\n          ' Text.Whitespace
'p'           Name
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
');'          Punctuation
'\n    '      Text.Whitespace
'w0'          Name
','           Operator
' '           Text.Whitespace
'pp'          Name
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'# Find [w1,pp] so that\n' Comment.Single

'  '          Text.Whitespace
'#   wrap(heap,w,mode,kb1,kb0)\n' Comment.Single

'  '          Text.Whitespace
'#   = w1*product(eval(pp,var=idx(var,lhs(loop))),loop)\n' Comment.Single

'  '          Text.Whitespace
'# making w1 depend on var as little as possible.\n' Comment.Single

'  '          Text.Whitespace
'# The flag "mode" should be `+` if "heap" contains an entry of the form\n' Comment.Single

'  '          Text.Whitespace
'# t_exp, or `*` otherwise.\n' Comment.Single

'  '          Text.Whitespace
'unproduct'   Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'w'           Name
','           Operator
' '           Text.Whitespace
'var'         Name
'::'          Operator
'name'        Name
','           Operator
' '           Text.Whitespace
'loop'        Name
'::'          Operator
'('           Punctuation
'name'        Name
'='           Operator
'range'       Name
')'           Punctuation
','           Operator
'\n                    ' Text.Whitespace
'heap'        Name
'::'          Operator
'list'        Name
','           Operator
' '           Text.Whitespace
'mode'        Name
'::'          Operator
'identical'   Name
'('           Punctuation
'`*`'         Name
','           Operator
'`+`'         Name
')'           Punctuation
','           Operator
'\n                    ' Text.Whitespace
'kb1'         Name
'::'          Operator
't_kb'        Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
'::'          Operator
't_kb'        Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'ind'         Name
','           Operator
' '           Text.Whitespace
'res'         Name
','           Operator
' '           Text.Whitespace
'dummy'       Name
','           Operator
' '           Text.Whitespace
'kb'          Name
','           Operator
' '           Text.Whitespace
'kbThen'      Name
','           Operator
' '           Text.Whitespace
'i'           Name
','           Operator
' '           Text.Whitespace
'w1'          Name
','           Operator
' '           Text.Whitespace
'pp'          Name
','           Operator
' '           Text.Whitespace
's'           Name
','           Operator
' '           Text.Whitespace
'r'           Name
','           Operator
' '           Text.Whitespace
'x'           Name
';'           Punctuation
'\n    '      Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'depends'     Name
'('           Punctuation
'w'           Name
','           Operator
' '           Text.Whitespace
'var'         Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n      '    Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'['           Punctuation
'wrap'        Name
'('           Punctuation
'heap'        Name
','           Operator
' '           Text.Whitespace
'w'           Name
','           Operator
' '           Text.Whitespace
'mode'        Name
','           Operator
' '           Text.Whitespace
'kb1'         Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
']'           Punctuation
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
"# The `..' (indices) of all occurences of `idx(var,..)'\n" Comment.Single

'    '        Text.Whitespace
'ind'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'map2'        Name
'('           Punctuation
'op'          Name.Builtin
','           Operator
' '           Text.Whitespace
'2'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'indets'      Name.Builtin
'('           Punctuation
'w'           Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'idx'         Name
'('           Punctuation
'identical'   Name
'('           Punctuation
'var'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'anything'    Name
')'           Punctuation
"'"           Punctuation
'));'         Punctuation
'\n    '      Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'ind'         Name
')'           Punctuation
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
' '           Text.Whitespace
'then'        Keyword
'\n      '    Text.Whitespace
'ind'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'ind'         Name
');'          Punctuation
'\n      '    Text.Whitespace
'# Make sure ind contains no bound variables before lifting it!\n' Comment.Single

'      '      Text.Whitespace
'# So, check that "extract using indets" and "rename using eval" commute.\n' Comment.Single

'      '      Text.Whitespace
's'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'indets'      Name.Builtin
'('           Punctuation
'ind'         Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'name'        Name
"'"           Punctuation
');'          Punctuation
'\n      '    Text.Whitespace
's'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'map'         Name.Builtin
'('           Punctuation
'proc'        Keyword
'('           Punctuation
'x'           Name
','           Operator
'$'           Operator
')'           Punctuation
' '           Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'y'           Name
';'           Punctuation
' '           Text.Whitespace
'`if`'        Name
'('           Punctuation
'depends'     Name
'('           Punctuation
'ind'         Name
','           Operator
'x'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'x'           Name
'='           Operator
'y'           Name
','           Operator
' '           Text.Whitespace
'NULL'        Name
')'           Punctuation
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
','           Operator
' '           Text.Whitespace
's'           Name
');'          Punctuation
'\n      '    Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'indets'      Name.Builtin
'('           Punctuation
'eval'        Name.Builtin
'('           Punctuation
'w'           Name
','           Operator
' '           Text.Whitespace
's'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'idx'         Name
'('           Punctuation
'identical'   Name
'('           Punctuation
'var'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'anything'    Name
')'           Punctuation
"'"           Punctuation
')'           Punctuation
'\n                ' Text.Whitespace
'='           Operator
' '           Text.Whitespace
'{'           Punctuation
'idx'         Name
'('           Punctuation
'var'         Name
','           Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'ind'         Name
','           Operator
' '           Text.Whitespace
's'           Name
'))}'         Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n        '  Text.Whitespace
"# use kb as a local context, and 'solve' for the innermost bound var\n" Comment.Single

'        '    Text.Whitespace
'#   used in ind.\n' Comment.Single

'        '    Text.Whitespace
'kb'          Name
'  '          Text.Whitespace
':='          Operator
' '           Text.Whitespace
'assert'      Name
'('           Punctuation
'lhs'         Name.Builtin
'('           Punctuation
'loop'        Name
')'           Punctuation
'='           Operator
'ind'         Name
','           Operator
' '           Text.Whitespace
'kb1'         Name
');'          Punctuation
' '           Text.Whitespace
'# BUG! bijectivity assumed!\n' Comment.Single

'        '    Text.Whitespace
"# if the assertion makes the KB false, it isn't needed(?)\n" Comment.Single

'        '    Text.Whitespace
'ASSERT'      Name.Builtin
'('           Punctuation
'type'        Name.Builtin
'('           Punctuation
'kb'          Name
','           Operator
' '           Text.Whitespace
't_kb'        Name
')'           Punctuation
','           Operator
'\n          ' Text.Whitespace
'sprintf'     Name
'('           Punctuation
'"assert(%a,%a) produced a false KB!\\n"' Literal.String
','           Operator
' '           Text.Whitespace
'lhs'         Name.Builtin
'('           Punctuation
'loop'        Name
')'           Punctuation
'='           Operator
'ind'         Name
','           Operator
'kb1'         Name
'))'          Punctuation
':'           Operator
'\n        '  Text.Whitespace
'res'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'subs'        Name.Builtin
'('           Punctuation
'idx'         Name
'('           Punctuation
'var'         Name
','           Operator
'ind'         Name
')'           Punctuation
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'idx'         Name
'('           Punctuation
'var'         Name
','           Operator
'lhs'         Name.Builtin
'('           Punctuation
'loop'        Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'w'           Name
');'          Punctuation
'\n        '  Text.Whitespace
'res'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'wrap'        Name
'('           Punctuation
'heap'        Name
','           Operator
' '           Text.Whitespace
'res'         Name
','           Operator
' '           Text.Whitespace
'mode'        Name
','           Operator
' '           Text.Whitespace
'kb'          Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
');'          Punctuation
'\n        '  Text.Whitespace
'res'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'subs'        Name.Builtin
'('           Punctuation
'idx'         Name
'('           Punctuation
'var'         Name
','           Operator
'lhs'         Name.Builtin
'('           Punctuation
'loop'        Name
'))'          Punctuation
'='           Operator
'dummy'       Name
','           Operator
' '           Text.Whitespace
'res'         Name
');'          Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'depends'     Name
'('           Punctuation
'res'         Name
','           Operator
' '           Text.Whitespace
'var'         Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'['           Punctuation
'1'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'subs'        Name.Builtin
'('           Punctuation
'dummy'       Name
'='           Operator
'var'         Name
','           Operator
' '           Text.Whitespace
'res'         Name
')]'          Punctuation
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'# distribute the unproduct over each part\n' Comment.Single

'    '        Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'w'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'mode'        Name
' '           Text.Whitespace
'then'        Keyword
'\n      '    Text.Whitespace
'res'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'map'         Name.Builtin
'('           Punctuation
'unproduct'   Name
','           Operator
' '           Text.Whitespace
'`if`'        Name
'('           Punctuation
'mode'        Name
'='           Operator
'`*`'         Name
','           Operator
' '           Text.Whitespace
'list_of_mul' Name
'('           Punctuation
'w'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'['           Punctuation
'op'          Name.Builtin
'('           Punctuation
'w'           Name
')])'         Punctuation
','           Operator
'\n                 ' Text.Whitespace
'var'         Name
','           Operator
' '           Text.Whitespace
'loop'        Name
','           Operator
' '           Text.Whitespace
'heap'        Name
','           Operator
' '           Text.Whitespace
'mode'        Name
','           Operator
' '           Text.Whitespace
'kb1'         Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
');'          Punctuation
'\n      '    Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'['           Punctuation
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'map2'        Name
'('           Punctuation
'op'          Name.Builtin
','           Operator
'1'           Literal.Number.Integer
','           Operator
'res'         Name
')))'         Punctuation
','           Operator
' '           Text.Whitespace
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'map2'        Name
'('           Punctuation
'op'          Name.Builtin
','           Operator
'2'           Literal.Number.Integer
','           Operator
'res'         Name
')))]'        Punctuation
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'# for piecewise, just map right in (using KB for context tracking)\n' Comment.Single

'    '        Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'w'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
"'"           Punctuation
'specfunc'    Name
'('           Punctuation
'piecewise'   Name.Builtin
')'           Punctuation
"'"           Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n      '    Text.Whitespace
'kb'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'kb1'         Name
';'           Punctuation
'\n      '    Text.Whitespace
'for'         Keyword
' '           Text.Whitespace
'i'           Name
' '           Text.Whitespace
'from'        Keyword
' '           Text.Whitespace
'1'           Literal.Number.Integer
' '           Text.Whitespace
'to'          Keyword
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'w'           Name
')'           Punctuation
' '           Text.Whitespace
'do'          Keyword
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'i'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'even'        Name
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'kbThen'      Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'assert'      Name
'('           Punctuation
'    '        Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'i'           Name
'-'           Operator
'1'           Literal.Number.Integer
','           Operator
'w'           Name
')'           Punctuation
' '           Text.Whitespace
','           Operator
' '           Text.Whitespace
'kb'          Name
');'          Punctuation
'\n          ' Text.Whitespace
'# accumulate the rest, regardless\n' Comment.Single

'          '  Text.Whitespace
'kb'          Name
'     '       Text.Whitespace
':='          Operator
' '           Text.Whitespace
'assert'      Name
'('           Punctuation
'Not'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'i'           Name
'-'           Operator
'1'           Literal.Number.Integer
','           Operator
'w'           Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'kb'          Name
');'          Punctuation
'\n\n          ' Text.Whitespace
'# if kbThen is invalid, deal appropriately\n' Comment.Single

'          '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'type'        Name.Builtin
'('           Punctuation
'kbThen'      Name
','           Operator
't_kb'        Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'next'        Keyword
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n\n          ' Text.Whitespace
'w1'          Name
'['           Punctuation
'i'           Name
']'           Punctuation
','           Operator
' '           Text.Whitespace
'pp'          Name
'['           Punctuation
'i'           Name
']'           Punctuation
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'unproduct'   Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'i'           Name
','           Operator
'w'           Name
')'           Punctuation
','           Operator
'var'         Name
','           Operator
'loop'        Name
','           Operator
'heap'        Name
','           Operator
'mode'        Name
','           Operator
'kbThen'      Name
','           Operator
'kb0'         Name
'));'         Punctuation
'\n          ' Text.Whitespace
"# if kb is inconsistent, we're done\n" Comment.Single

'          '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'type'        Name.Builtin
'('           Punctuation
'kb'          Name
','           Operator
't_kb'        Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'break'       Keyword
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'elif'        Keyword
' '           Text.Whitespace
'i'           Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'w'           Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'type'        Name.Builtin
'('           Punctuation
'kb'          Name
','           Operator
't_kb'        Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'next'        Keyword
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n          ' Text.Whitespace
'w1'          Name
'['           Punctuation
'i'           Name
']'           Punctuation
','           Operator
' '           Text.Whitespace
'pp'          Name
'['           Punctuation
'i'           Name
']'           Punctuation
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'unproduct'   Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'i'           Name
','           Operator
'w'           Name
')'           Punctuation
','           Operator
'var'         Name
','           Operator
'loop'        Name
','           Operator
'heap'        Name
','           Operator
'mode'        Name
','           Operator
'kb'          Name
'    '        Text.Whitespace
','           Operator
'kb0'         Name
'))'          Punctuation
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'do'          Keyword
';'           Punctuation
'\n      '    Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'['           Punctuation
'`*`'         Name
'('           Punctuation
'entries'     Name.Builtin
'('           Punctuation
'w1'          Name
','           Operator
"'"           Punctuation
'nolist'      Name
"'"           Punctuation
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'`*`'         Name
'('           Punctuation
'entries'     Name.Builtin
'('           Punctuation
'pp'          Name
','           Operator
"'"           Punctuation
'nolist'      Name
"'"           Punctuation
'))]'         Punctuation
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'mode'        Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'`*`'         Name
' '           Text.Whitespace
'then'        Keyword
'\n      '    Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'w'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'('           Punctuation
'anything'    Name
'^'           Operator
'freeof'      Name
'('           Punctuation
'var'         Name
'))'          Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n        '  Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'unproduct'   Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'w'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'var'         Name
','           Operator
' '           Text.Whitespace
'loop'        Name
','           Operator
'\n                         ' Text.Whitespace
'['           Punctuation
'op'          Name.Builtin
'('           Punctuation
'heap'        Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'Stmt'        Name
'('           Punctuation
'`^`'         Name
','           Operator
' '           Text.Whitespace
'[]'          Punctuation
','           Operator
' '           Text.Whitespace
'['           Punctuation
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'w'           Name
')])]'        Punctuation
','           Operator
' '           Text.Whitespace
'`*`'         Name
','           Operator
' '           Text.Whitespace
'kb1'         Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
')'           Punctuation
'\n      '    Text.Whitespace
'elif'        Keyword
' '           Text.Whitespace
'w'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'exp'         Name
'('           Punctuation
'anything'    Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n        '  Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'unproduct'   Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'w'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'var'         Name
','           Operator
' '           Text.Whitespace
'loop'        Name
','           Operator
'\n                         ' Text.Whitespace
'['           Punctuation
'op'          Name.Builtin
'('           Punctuation
'heap'        Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'Stmt'        Name
'('           Punctuation
'exp'         Name
','           Operator
' '           Text.Whitespace
'[]'          Punctuation
','           Operator
' '           Text.Whitespace
'[])]'        Punctuation
','           Operator
' '           Text.Whitespace
'`+`'         Name
','           Operator
' '           Text.Whitespace
'kb1'         Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
')'           Punctuation
'\n      '    Text.Whitespace
'elif'        Keyword
' '           Text.Whitespace
'w'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'('           Punctuation
'freeof'      Name
'('           Punctuation
'var'         Name
')^'          Punctuation
'anything'    Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n        '  Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'unproduct'   Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'w'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'var'         Name
','           Operator
' '           Text.Whitespace
'loop'        Name
','           Operator
'\n                         ' Text.Whitespace
'['           Punctuation
'op'          Name.Builtin
'('           Punctuation
'heap'        Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'Stmt'        Name
'('           Punctuation
'`^`'         Name
','           Operator
' '           Text.Whitespace
'['           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'w'           Name
')]'          Punctuation
','           Operator
' '           Text.Whitespace
'[])]'        Punctuation
','           Operator
' '           Text.Whitespace
'`+`'         Name
','           Operator
' '           Text.Whitespace
'kb1'         Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
')'           Punctuation
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'mode'        Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'`+`'         Name
' '           Text.Whitespace
'and'         Keyword
' '           Text.Whitespace
'w'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'`*`'         Name
' '           Text.Whitespace
'then'        Keyword
'\n      '    Text.Whitespace
's'           Name
','           Operator
' '           Text.Whitespace
'r'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'selectremove' Name.Builtin
'('           Punctuation
'depends'     Name
','           Operator
' '           Text.Whitespace
'w'           Name
','           Operator
' '           Text.Whitespace
'var'         Name
');'          Punctuation
'\n      '    Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
's'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'`*`'         Name
' '           Text.Whitespace
'then'        Keyword
'\n        '  Text.Whitespace
'# Nonlinear %1 (time to reread kiselyov-lifted?)\n' Comment.Single

'      '      Text.Whitespace
'else'        Keyword
'\n        '  Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'unproduct'   Name
'('           Punctuation
's'           Name
','           Operator
' '           Text.Whitespace
'var'         Name
','           Operator
' '           Text.Whitespace
'loop'        Name
','           Operator
'\n                         ' Text.Whitespace
'['           Punctuation
'op'          Name.Builtin
'('           Punctuation
'heap'        Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'Stmt'        Name
'('           Punctuation
'`*`'         Name
','           Operator
' '           Text.Whitespace
'[]'          Punctuation
','           Operator
' '           Text.Whitespace
'['           Punctuation
'r'           Name
'])]'         Punctuation
','           Operator
' '           Text.Whitespace
'`+`'         Name
','           Operator
' '           Text.Whitespace
'kb1'         Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
')'           Punctuation
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'w'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'And'         Name
'('           Punctuation
'specfunc'    Name
'('           Punctuation
'`if`'        Name
'('           Punctuation
'mode'        Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'`*`'         Name
','           Operator
' '           Text.Whitespace
'{'           Punctuation
'product'     Name
','           Operator
' '           Text.Whitespace
'Product'     Name
'}'           Punctuation
','           Operator
' '           Text.Whitespace
'{'           Punctuation
'sum'         Name
','           Operator
' '           Text.Whitespace
'Sum'         Name
'}))'         Punctuation
','           Operator
'\n                ' Text.Whitespace
'anyfunc'     Name
'('           Punctuation
'anything'    Name
','           Operator
' '           Text.Whitespace
'name'        Name
'='           Operator
'range'       Name
'('           Punctuation
'freeof'      Name
'('           Punctuation
'var'         Name
'))))'        Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n      '    Text.Whitespace
'x'           Name
','           Operator
' '           Text.Whitespace
'kb'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'genType'     Name
'('           Punctuation
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'w'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'HInt'        Name
'('           Punctuation
'closed_bounds' Name
'('           Punctuation
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
']'           Punctuation
','           Operator
'w'           Name
')))'         Punctuation
','           Operator
' '           Text.Whitespace
'kb1'         Name
','           Operator
'\n                       ' Text.Whitespace
'w'           Name
','           Operator
' '           Text.Whitespace
'var'         Name
','           Operator
' '           Text.Whitespace
'loop'        Name
','           Operator
' '           Text.Whitespace
'heap'        Name
');'          Punctuation
'\n      '    Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'unproduct'   Name
'('           Punctuation
'eval'        Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'w'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'w'           Name
')'           Punctuation
'='           Operator
'x'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'var'         Name
','           Operator
' '           Text.Whitespace
'loop'        Name
','           Operator
'\n                       ' Text.Whitespace
'['           Punctuation
'op'          Name.Builtin
'('           Punctuation
'heap'        Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'Binder'      Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'0'           Literal.Number.Integer
','           Operator
'w'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'kb1'         Name
')]'          Punctuation
','           Operator
' '           Text.Whitespace
'mode'        Name
','           Operator
' '           Text.Whitespace
'kb'          Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
')'           Punctuation
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'mode'        Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'`*`'         Name
' '           Text.Whitespace
'and'         Keyword
' '           Text.Whitespace
'w'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
"'"           Punctuation
'{'           Punctuation
'`+`'         Name
','           Operator
' '           Text.Whitespace
'specfunc'    Name
'({'          Punctuation
'sum'         Name
','           Operator
' '           Text.Whitespace
'Sum'         Name
'})}'         Punctuation
"'"           Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n      '    Text.Whitespace
'# Maybe this w is one of those big sums involving products that are\n' Comment.Single

'      '      Text.Whitespace
'# always equal to 1, left behind by the density of Categorical\n' Comment.Single

'      '      Text.Whitespace
'w1'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'graft'       Name
'('           Punctuation
'split'       Name
'('           Punctuation
'peel'        Name
'('           Punctuation
'w'           Name
')));'        Punctuation
'\n      '    Text.Whitespace
'w1'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'combine'     Name
'('           Punctuation
'rebase_upper' Name
'('           Punctuation
'w1'          Name
'));'         Punctuation
'\n      '    Text.Whitespace
'w1'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'combine'     Name
'('           Punctuation
'rebase_lower' Name
'('           Punctuation
'w1'          Name
'));'         Punctuation
'\n      '    Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'['           Punctuation
'wrap'        Name
'('           Punctuation
'heap'        Name
','           Operator
' '           Text.Whitespace
'w1'          Name
','           Operator
' '           Text.Whitespace
'mode'        Name
','           Operator
' '           Text.Whitespace
'kb1'         Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
']'           Punctuation
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'['           Punctuation
'wrap'        Name
'('           Punctuation
'heap'        Name
','           Operator
' '           Text.Whitespace
'w'           Name
','           Operator
' '           Text.Whitespace
'mode'        Name
','           Operator
' '           Text.Whitespace
'kb1'         Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
']'           Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'enter_piecewise' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'ee'          Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
'::'          Operator
't_kb'        Name
','           Operator
' '           Text.Whitespace
'mode'        Name
'::'          Operator
'identical'   Name
'('           Punctuation
'`*`'         Name
','           Operator
'`+`'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'e'           Name
','           Operator
' '           Text.Whitespace
'kb'          Name
','           Operator
' '           Text.Whitespace
'mo'          Name
';'           Punctuation
'\n    '      Text.Whitespace
'e'           Name
'  '          Text.Whitespace
':='          Operator
' '           Text.Whitespace
'ee'          Name
';'           Punctuation
'\n    '      Text.Whitespace
'kb'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'kb0'         Name
';'           Punctuation
'\n    '      Text.Whitespace
'mo'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'mode'        Name
'();'         Punctuation
'\n    '      Text.Whitespace
'while'       Keyword
' '           Text.Whitespace
'e'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
"'"           Punctuation
'specfunc'    Name
'('           Punctuation
'piecewise'   Name.Builtin
')'           Punctuation
"'"           Punctuation
' '           Text.Whitespace
'and'         Keyword
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'e'           Name
')'           Punctuation
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'3'           Literal.Number.Integer
' '           Text.Whitespace
'do'          Keyword
'\n      '    Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'3'           Literal.Number.Integer
','           Operator
'e'           Name
')'           Punctuation
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'mo'          Name
' '           Text.Whitespace
'then'        Keyword
'\n        '  Text.Whitespace
'kb'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'assert'      Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'e'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'kb'          Name
');'          Punctuation
'\n        '  Text.Whitespace
'e'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'e'           Name
');'          Punctuation
'\n      '    Text.Whitespace
'elif'        Keyword
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'e'           Name
')'           Punctuation
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'mo'          Name
' '           Text.Whitespace
'then'        Keyword
'\n        '  Text.Whitespace
'kb'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'assert'      Name
'('           Punctuation
'Not'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'e'           Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'kb'          Name
');'          Punctuation
'\n        '  Text.Whitespace
'e'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'3'           Literal.Number.Integer
','           Operator
'e'           Name
');'          Punctuation
'\n      '    Text.Whitespace
'else'        Keyword
'\n        '  Text.Whitespace
'break'       Keyword
';'           Punctuation
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'do'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'ASSERT'      Name.Builtin
'('           Punctuation
'type'        Name.Builtin
'('           Punctuation
'kb'          Name
','           Operator
't_kb'        Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'"enter_piecewise: KB of piecewise conditions is not valid, so the input piecewise must not be valid."' Literal.String
');'          Punctuation
'\n    '      Text.Whitespace
'e'           Name
','           Operator
' '           Text.Whitespace
'kb'          Name
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'# heap is a list of t_binder and t_stmt\n' Comment.Single

'  '          Text.Whitespace
'# one invariant to maintain:\n' Comment.Single

'  '          Text.Whitespace
'#  wrap(heap, mode(a,b)) = wrap(heap,a) * wrap(heap,b)\n' Comment.Single

'\n  '        Text.Whitespace
'# Also, a t_binder is a Product/product/Sum/sum.\n' Comment.Single

'  '          Text.Whitespace
'# And, a t_stmt is a 1-hole context of a (multiplicative) AST,\n' Comment.Single

'  '          Text.Whitespace
'#   used for [a ^ hole, hole ^ b, exp(hole), c * hole].\n' Comment.Single

'\n  '        Text.Whitespace
'wrap'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'heap'        Name
'::'          Operator
'list'        Name
','           Operator
' '           Text.Whitespace
'e1'          Name
','           Operator
' '           Text.Whitespace
'mode1'       Name
'::'          Operator
'identical'   Name
'('           Punctuation
'`*`'         Name
','           Operator
'`+`'         Name
')'           Punctuation
','           Operator
'\n               ' Text.Whitespace
'kb1'         Name
'::'          Operator
't_kb'        Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
'::'          Operator
't_kb'        Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'e'           Name
','           Operator
' '           Text.Whitespace
'kb'          Name
','           Operator
' '           Text.Whitespace
'mode'        Name
','           Operator
' '           Text.Whitespace
'i'           Name
','           Operator
' '           Text.Whitespace
'entry'       Name
','           Operator
' '           Text.Whitespace
'rest'        Name
','           Operator
' '           Text.Whitespace
'var'         Name
','           Operator
' '           Text.Whitespace
'new_rng'     Name
','           Operator
' '           Text.Whitespace
'make'        Name
','           Operator
' '           Text.Whitespace
'logmake'     Name
','           Operator
'\n       '   Text.Whitespace
'dom_spec'    Name
','           Operator
' '           Text.Whitespace
'w'           Name
','           Operator
' '           Text.Whitespace
'wPow'        Name
','           Operator
' '           Text.Whitespace
'wExp'        Name
','           Operator
' '           Text.Whitespace
'arrrgs'      Name
';'           Punctuation
'\n    '      Text.Whitespace
'e'           Name
'    '        Text.Whitespace
':='          Operator
' '           Text.Whitespace
'e1'          Name
';'           Punctuation
'\n    '      Text.Whitespace
'kb'          Name
'   '         Text.Whitespace
':='          Operator
' '           Text.Whitespace
'kb1'         Name
';'           Punctuation
'\n    '      Text.Whitespace
'mode'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'mode1'       Name
';'           Punctuation
'\n    '      Text.Whitespace
'for'         Keyword
' '           Text.Whitespace
'i'           Name
' '           Text.Whitespace
'from'        Keyword
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'heap'        Name
')'           Punctuation
' '           Text.Whitespace
'to'          Keyword
' '           Text.Whitespace
'1'           Literal.Number.Integer
' '           Text.Whitespace
'by'          Keyword
' '           Text.Whitespace
'-'           Operator
'1'           Literal.Number.Integer
' '           Text.Whitespace
'do'          Keyword
'\n      '    Text.Whitespace
'entry'       Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'i'           Name
','           Operator
'heap'        Name
');'          Punctuation
'\n      '    Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'entry'       Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
't_binder'    Name
' '           Text.Whitespace
'then'        Keyword
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'entry'       Name
')'           Punctuation
' '           Text.Whitespace
'in'          Keyword
' '           Text.Whitespace
'`if`'        Name
'('           Punctuation
'mode'        Name
'='           Operator
'`+`'         Name
','           Operator
' '           Text.Whitespace
'{'           Punctuation
'sum'         Name
','           Operator
'Sum'         Name
'}'           Punctuation
','           Operator
'\n                                              ' Text.Whitespace
'{'           Punctuation
'product'     Name
','           Operator
'Product'     Name
'}))'         Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'print'       Name.Builtin
'('           Punctuation
'"Warning: heap mode inconsistency"' Literal.String
','           Operator
' '           Text.Whitespace
'heap'        Name
','           Operator
' '           Text.Whitespace
'mode1'       Name
')'           Punctuation
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'e'           Name
','           Operator
' '           Text.Whitespace
'kb'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'enter_piecewise' Name
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'kb'          Name
','           Operator
' '           Text.Whitespace
'mode'        Name
');'          Punctuation
'\n        '  Text.Whitespace
'rest'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'kb_subtract' Name
'('           Punctuation
'kb'          Name
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'entry'       Name
'));'         Punctuation
'\n        '  Text.Whitespace
'new_rng'     Name
','           Operator
' '           Text.Whitespace
'rest'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'selectremove' Name.Builtin
'('           Punctuation
'type'        Name.Builtin
','           Operator
' '           Text.Whitespace
'rest'        Name
','           Operator
'\n          ' Text.Whitespace
'{['          Punctuation
'identical'   Name
'('           Punctuation
'genType'     Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'name'        Name
','           Operator
' '           Text.Whitespace
'specfunc'    Name
'('           Punctuation
'HInt'        Name
')]'          Punctuation
','           Operator
'\n           ' Text.Whitespace
'['           Punctuation
'identical'   Name
'('           Punctuation
'genLet'      Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'name'        Name
','           Operator
' '           Text.Whitespace
'anything'    Name
']});'        Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'('           Punctuation
'new_rng'     Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'['           Punctuation
'list'        Name
'])'          Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'error'       Keyword
' '           Text.Whitespace
'"kb_subtract should return exactly one gen*"' Literal.String
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'new_rng'     Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'new_rng'     Name
');'          Punctuation
'\n        '  Text.Whitespace
'var'         Name
'     '       Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'new_rng'     Name
');'          Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'new_rng'     Name
')'           Punctuation
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'genType'     Name
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'make'        Name
'    '        Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'entry'       Name
');'          Punctuation
'\n          ' Text.Whitespace
'new_rng'     Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'range_of_HInt' Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'3'           Literal.Number.Integer
','           Operator
'new_rng'     Name
'));'         Punctuation
'\n        '  Text.Whitespace
'else'        Keyword
' '           Text.Whitespace
'# op(1,new_rng) = genLet\n' Comment.Single

'          '  Text.Whitespace
'make'        Name
'    '        Text.Whitespace
':='          Operator
' '           Text.Whitespace
'eval'        Name.Builtin
';'           Punctuation
'\n          ' Text.Whitespace
'new_rng'     Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'3'           Literal.Number.Integer
','           Operator
'new_rng'     Name
');'          Punctuation
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'dom_spec'    Name
','           Operator
' '           Text.Whitespace
'rest'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'selectremove' Name.Builtin
'('           Punctuation
'depends'     Name
','           Operator
'\n          ' Text.Whitespace
'map'         Name.Builtin
'('           Punctuation
'proc'        Keyword
'('           Punctuation
'a'           Name
'::'          Operator
'['           Punctuation
'identical'   Name
'('           Punctuation
'assert'      Name
')'           Punctuation
','           Operator
'anything'    Name
']'           Punctuation
','           Operator
'$'           Operator
')'           Punctuation
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'a'           Name
')'           Punctuation
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
','           Operator
' '           Text.Whitespace
'rest'        Name
')'           Punctuation
','           Operator
'\n          ' Text.Whitespace
'var'         Name
');'          Punctuation
'\n\n        ' Text.Whitespace
'# Like e := make(piecewise(And(op(dom_spec)), e, mode()), var=new_rng);\n' Comment.Single

'        '    Text.Whitespace
'# but try to simplify by pushing the make and the piecewise into e\n' Comment.Single

'        '    Text.Whitespace
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'w'           Name
')'           Punctuation
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'selectremove' Name.Builtin
'('           Punctuation
'depends'     Name
','           Operator
' '           Text.Whitespace
'convert'     Name.Builtin
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'list'        Name
"'"           Punctuation
','           Operator
' '           Text.Whitespace
'`*`'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'var'         Name
');'          Punctuation
'\n        '  Text.Whitespace
'w'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'w'           Name
'));'         Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'mode'        Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'`*`'         Name
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'('           Punctuation
'wPow'        Name
','           Operator
' '           Text.Whitespace
'e'           Name
')'           Punctuation
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'selectremove' Name.Builtin
'('           Punctuation
'type'        Name.Builtin
','           Operator
' '           Text.Whitespace
'e'           Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'`^`'         Name
"'"           Punctuation
'('           Punctuation
"'"           Punctuation
'freeof'      Name
"'"           Punctuation
'('           Punctuation
'var'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'anything'    Name
"'"           Punctuation
'));'         Punctuation
'\n          ' Text.Whitespace
'('           Punctuation
'wExp'        Name
','           Operator
' '           Text.Whitespace
'e'           Name
')'           Punctuation
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'selectremove' Name.Builtin
'('           Punctuation
'type'        Name.Builtin
','           Operator
' '           Text.Whitespace
'e'           Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'exp'         Name
'('           Punctuation
'anything'    Name
')'           Punctuation
"'"           Punctuation
');'          Punctuation
'\n          ' Text.Whitespace
'wExp'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'`+`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'map2'        Name
'('           Punctuation
'op'          Name.Builtin
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'wExp'        Name
')));'        Punctuation
'\n          ' Text.Whitespace
'wExp'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'expand'      Name.Builtin
'('           Punctuation
'wExp'        Name
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'indets'      Name.Builtin
'('           Punctuation
'wExp'        Name
','           Operator
' '           Text.Whitespace
'function'    Name
')));'        Punctuation
'\n          ' Text.Whitespace
'logmake'     Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
't'           Name
')'           Punctuation
'\n            ' Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
's'           Name
','           Operator
' '           Text.Whitespace
'r'           Name
';'           Punctuation
'\n            ' Text.Whitespace
's'           Name
','           Operator
' '           Text.Whitespace
'r'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'selectremove' Name.Builtin
'('           Punctuation
'depends'     Name
','           Operator
' '           Text.Whitespace
'convert'     Name.Builtin
'('           Punctuation
't'           Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'list'        Name
"'"           Punctuation
','           Operator
' '           Text.Whitespace
'`*`'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'var'         Name
');'          Punctuation
'\n            ' Text.Whitespace
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
','           Operator
'\n                ' Text.Whitespace
'`if`'        Name
'('           Punctuation
'make'        Name
'='           Operator
'eval'        Name.Builtin
','           Operator
'eval'        Name.Builtin
','           Operator
'Sum'         Name
')'           Punctuation
'\n                    ' Text.Whitespace
'('           Punctuation
'piecewise_And' Name
'('           Punctuation
'dom_spec'    Name
','           Operator
' '           Text.Whitespace
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
's'           Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'0'           Literal.Number.Integer
')'           Punctuation
','           Operator
' '           Text.Whitespace
'var'         Name
'='           Operator
'new_rng'     Name
'));'         Punctuation
'\n          ' Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n          ' Text.Whitespace
'w'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'`*`'         Name
'('           Punctuation
' '           Text.Whitespace
'`if`'        Name
'('           Punctuation
'w'           Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'w'           Name
' '           Text.Whitespace
'^'           Operator
' '           Text.Whitespace
'logmake'     Name
'('           Punctuation
'1'           Literal.Number.Integer
'))'          Punctuation
'\n                  ' Text.Whitespace
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'map'         Name.Builtin
'(('          Punctuation
'f'           Name
' '           Text.Whitespace
'->'          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'f'           Name
')'           Punctuation
' '           Text.Whitespace
'^'           Operator
' '           Text.Whitespace
'logmake'     Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'f'           Name
')))'         Punctuation
','           Operator
' '           Text.Whitespace
'wPow'        Name
'))'          Punctuation
'\n                  ' Text.Whitespace
','           Operator
' '           Text.Whitespace
'`if`'        Name
'('           Punctuation
'wExp'        Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'0'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'exp'         Name
'('           Punctuation
'maptype'     Name
'('           Punctuation
'`+`'         Name
','           Operator
'logmake'     Name
','           Operator
'wExp'        Name
')))'         Punctuation
' '           Text.Whitespace
');'          Punctuation
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'e'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'w'           Name
' '           Text.Whitespace
'*'           Operator
' '           Text.Whitespace
'make'        Name
'('           Punctuation
'piecewise_And' Name
'('           Punctuation
'dom_spec'    Name
','           Operator
' '           Text.Whitespace
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'e'           Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'mode'        Name
'())'         Punctuation
','           Operator
' '           Text.Whitespace
'var'         Name
'='           Operator
'new_rng'     Name
');'          Punctuation
'\n\n        ' Text.Whitespace
"# `rest' originally comes from `entry', and this reinserts it after some\n" Comment.Single

'        '    Text.Whitespace
'# processing. The original KB was valid, so this one should also be valid.\n' Comment.Single

'        '    Text.Whitespace
'kb'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'foldr'       Name
'('           Punctuation
'assert'      Name
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'entry'       Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'rest'        Name
'));'         Punctuation
'\n        '  Text.Whitespace
'ASSERT'      Name.Builtin
'('           Punctuation
'type'        Name.Builtin
'('           Punctuation
'kb'          Name
','           Operator
't_kb'        Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'"Loop/wrap{t_binder}: rebuilding kb produced contradiction"' Literal.String
');'          Punctuation
'\n\n      '  Text.Whitespace
'elif'        Keyword
' '           Text.Whitespace
'entry'       Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
't_stmt'      Name
' '           Text.Whitespace
'then'        Keyword
'\n        '  Text.Whitespace
'# We evaluate arrrgs first, in case op(1,stmt) is an operation (such as\n' Comment.Single

'        '    Text.Whitespace
'# piecewise) that looks ahead at how many arguments it is passed before\n' Comment.Single

'        '    Text.Whitespace
'# they are evaluated.\n' Comment.Single

'        '    Text.Whitespace
'arrrgs'      Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'entry'       Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'e'           Name
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'3'           Literal.Number.Integer
','           Operator
'entry'       Name
'));'         Punctuation
'\n        '  Text.Whitespace
'e'           Name
'      '      Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'entry'       Name
')('          Punctuation
'arrrgs'      Name
');'          Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'entry'       Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
't_exp'       Name
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'mode'        Name
' '           Text.Whitespace
'<>'          Operator
' '           Text.Whitespace
'`+`'         Name
' '           Text.Whitespace
'then'        Keyword
'\n            ' Text.Whitespace
'print'       Name.Builtin
'('           Punctuation
'"Warning: heap mode inconsistency?"' Literal.String
','           Operator
' '           Text.Whitespace
'heap'        Name
','           Operator
' '           Text.Whitespace
'mode1'       Name
')'           Punctuation
'\n          ' Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n          ' Text.Whitespace
'mode'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'`*`'         Name
';'           Punctuation
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n      '    Text.Whitespace
'else'        Keyword
' '           Text.Whitespace
'error'       Keyword
' '           Text.Whitespace
'"Malformed heap entry %1"' Literal.String
','           Operator
' '           Text.Whitespace
'entry'       Name
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'do'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'mode'        Name
' '           Text.Whitespace
'<>'          Operator
' '           Text.Whitespace
'`*`'         Name
' '           Text.Whitespace
'then'        Keyword
'\n      '    Text.Whitespace
'print'       Name.Builtin
'('           Punctuation
'"Warning: heap mode inconsistency??"' Literal.String
','           Operator
' '           Text.Whitespace
'heap'        Name
','           Operator
' '           Text.Whitespace
'mode1'       Name
')'           Punctuation
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'e'           Name
','           Operator
' '           Text.Whitespace
'kb'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'enter_piecewise' Name
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'kb'          Name
','           Operator
' '           Text.Whitespace
'mode'        Name
');'          Punctuation
'\n    '      Text.Whitespace
'rest'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'kb_subtract' Name
'('           Punctuation
'kb'          Name
','           Operator
' '           Text.Whitespace
'kb0'         Name
');'          Punctuation
'\n    '      Text.Whitespace
'rest'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'map'         Name.Builtin
'('           Punctuation
'proc'        Keyword
'('           Punctuation
'a'           Name
'::'          Operator
'['           Punctuation
'identical'   Name
'('           Punctuation
'assert'      Name
')'           Punctuation
','           Operator
'anything'    Name
']'           Punctuation
','           Operator
'$'           Operator
')'           Punctuation
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'2'           Literal.Number.Integer
','           Operator
'a'           Name
')'           Punctuation
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
','           Operator
' '           Text.Whitespace
'rest'        Name
');'          Punctuation
'\n    '      Text.Whitespace
'('           Punctuation
'wExp'        Name
','           Operator
' '           Text.Whitespace
'e'           Name
')'           Punctuation
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'selectremove' Name.Builtin
'('           Punctuation
'type'        Name.Builtin
','           Operator
' '           Text.Whitespace
'convert'     Name.Builtin
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'list'        Name
"'"           Punctuation
','           Operator
' '           Text.Whitespace
'`*`'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'exp'         Name
'('           Punctuation
'anything'    Name
')'           Punctuation
"'"           Punctuation
');'          Punctuation
'\n    '      Text.Whitespace
'wExp'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'`+`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'map2'        Name
'('           Punctuation
'op'          Name.Builtin
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'wExp'        Name
')));'        Punctuation
'\n    '      Text.Whitespace
'wExp'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'expand'      Name.Builtin
'('           Punctuation
'wExp'        Name
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'indets'      Name.Builtin
'('           Punctuation
'wExp'        Name
','           Operator
' '           Text.Whitespace
'function'    Name
')));'        Punctuation
'\n    '      Text.Whitespace
'logmake'     Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'('           Punctuation
't'           Name
' '           Text.Whitespace
'->'          Operator
' '           Text.Whitespace
't'           Name
' '           Text.Whitespace
'*'           Operator
' '           Text.Whitespace
'piecewise_And' Name
'('           Punctuation
'rest'        Name
','           Operator
'1'           Literal.Number.Integer
','           Operator
'0'           Literal.Number.Integer
'));'         Punctuation
'\n    '      Text.Whitespace
'`if`'        Name
'('           Punctuation
'wExp'        Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'0'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'exp'         Name
'('           Punctuation
'maptype'     Name
'('           Punctuation
'`+`'         Name
','           Operator
'logmake'     Name
','           Operator
'wExp'        Name
')))'         Punctuation
'\n      '    Text.Whitespace
'*'           Operator
' '           Text.Whitespace
'piecewise_And' Name
'('           Punctuation
'rest'        Name
','           Operator
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'e'           Name
'))'          Punctuation
','           Operator
'1'           Literal.Number.Integer
');'          Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'# Rewrite product(...piecewise(i+42=lo+42,th,el)...,i=lo..hi)\n' Comment.Single

'  '          Text.Whitespace
'# to eval(...th...,i=lo)*product(...el...,i=lo+1..hi)\n' Comment.Single

'  '          Text.Whitespace
't_peel'      Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
"'"           Punctuation
'And'         Name
'('           Punctuation
'specfunc'    Name
'({'          Punctuation
'sum'         Name
','           Operator
'Sum'         Name
','           Operator
'product'     Name
','           Operator
'Product'     Name
'})'          Punctuation
','           Operator
'\n                 ' Text.Whitespace
'anyfunc'     Name
'('           Punctuation
'anything'    Name
','           Operator
' '           Text.Whitespace
'name'        Name
'='           Operator
'range'       Name
'))'          Punctuation
"'"           Punctuation
';'           Punctuation
'\n  '        Text.Whitespace
'peel'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'subsindets'  Name.Builtin
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
't_peel'      Name
','           Operator
' '           Text.Whitespace
'do_peel'     Name
');'          Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n  '        Text.Whitespace
'do_peel'     Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'make'        Name
','           Operator
' '           Text.Whitespace
'body'        Name
','           Operator
' '           Text.Whitespace
'x'           Name
','           Operator
' '           Text.Whitespace
'r'           Name
','           Operator
' '           Text.Whitespace
'cond'        Name
','           Operator
' '           Text.Whitespace
'line'        Name
','           Operator
' '           Text.Whitespace
'test'        Name
','           Operator
' '           Text.Whitespace
'x0'          Name
','           Operator
' '           Text.Whitespace
'r0'          Name
','           Operator
' '           Text.Whitespace
'cond0'       Name
','           Operator
' '           Text.Whitespace
'here'        Name
','           Operator
' '           Text.Whitespace
'rest'        Name
';'           Punctuation
'\n    '      Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'('           Punctuation
'e'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
't_peel'      Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'e'           Name
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'if'          Keyword
'   '         Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'0'           Literal.Number.Integer
','           Operator
'e'           Name
')'           Punctuation
' '           Text.Whitespace
'in'          Keyword
' '           Text.Whitespace
"'"           Punctuation
'{'           Punctuation
'sum'         Name
'    '        Text.Whitespace
','           Operator
'Sum'         Name
'    '        Text.Whitespace
'}'           Punctuation
"'"           Punctuation
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'make'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'`+`'         Name
';'           Punctuation
'\n    '      Text.Whitespace
'elif'        Keyword
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'0'           Literal.Number.Integer
','           Operator
'e'           Name
')'           Punctuation
' '           Text.Whitespace
'in'          Keyword
' '           Text.Whitespace
"'"           Punctuation
'{'           Punctuation
'product'     Name
','           Operator
'Product'     Name
'}'           Punctuation
"'"           Punctuation
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'make'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'`*`'         Name
';'           Punctuation
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'body'        Name
','           Operator
' '           Text.Whitespace
'r'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'e'           Name
');'          Punctuation
'\n    '      Text.Whitespace
'x'           Name
','           Operator
' '           Text.Whitespace
'r'           Name
'    '        Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'r'           Name
');'          Punctuation
'\n    '      Text.Whitespace
'for'         Keyword
' '           Text.Whitespace
'cond'        Name
' '           Text.Whitespace
'in'          Keyword
' '           Text.Whitespace
'indets'      Name.Builtin
'('           Punctuation
'body'        Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'{'           Punctuation
'`=`'         Name
'('           Punctuation
'algebraic'   Name
')'           Punctuation
','           Operator
'`<`'         Name
','           Operator
'`<=`'        Name
'}'           Punctuation
"'"           Punctuation
')'           Punctuation
' '           Text.Whitespace
'do'          Keyword
'\n      '    Text.Whitespace
'line'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'`-`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'cond'        Name
'));'         Punctuation
'\n      '    Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'1'           Literal.Number.Integer
' '           Text.Whitespace
'<>'          Operator
' '           Text.Whitespace
'degree'      Name.Builtin
'('           Punctuation
'line'        Name
','           Operator
' '           Text.Whitespace
'x'           Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'next'        Keyword
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n      '    Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'cond'        Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'`=`'         Name
' '           Text.Whitespace
'then'        Keyword
'\n        '  Text.Whitespace
'cond0'       Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'true'        Name
';'           Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'Testzero'    Name
'('           Punctuation
'eval'        Name.Builtin
'('           Punctuation
'line'        Name
','           Operator
' '           Text.Whitespace
'x'           Name
'='           Operator
'lhs'         Name.Builtin
'('           Punctuation
'r'           Name
')))'         Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'x0'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'lhs'         Name.Builtin
'('           Punctuation
'r'           Name
');'          Punctuation
' '           Text.Whitespace
'r0'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'applyop'     Name
'('           Punctuation
'`+`'         Name
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'r'           Name
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
');'          Punctuation
'\n        '  Text.Whitespace
'elif'        Keyword
' '           Text.Whitespace
'Testzero'    Name
'('           Punctuation
'eval'        Name.Builtin
'('           Punctuation
'line'        Name
','           Operator
' '           Text.Whitespace
'x'           Name
'='           Operator
'rhs'         Name.Builtin
'('           Punctuation
'r'           Name
')))'         Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'x0'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'rhs'         Name.Builtin
'('           Punctuation
'r'           Name
');'          Punctuation
' '           Text.Whitespace
'r0'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'applyop'     Name
'('           Punctuation
'`-`'         Name
','           Operator
' '           Text.Whitespace
'2'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'r'           Name
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
');'          Punctuation
'\n        '  Text.Whitespace
'else'        Keyword
' '           Text.Whitespace
'next'        Keyword
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n      '    Text.Whitespace
'else'        Keyword
'\n        '  Text.Whitespace
'test'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'x0'          Name
','           Operator
' '           Text.Whitespace
'x1'          Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n          ' Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'res'         Name
';'           Punctuation
'\n          ' Text.Whitespace
'res'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'evalb'       Name.Builtin
'('           Punctuation
'not'         Keyword
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'0'           Literal.Number.Integer
','           Operator
'cond'        Name
')('          Punctuation
'eval'        Name.Builtin
'('           Punctuation
'line'        Name
','           Operator
' '           Text.Whitespace
'x'           Name
'='           Operator
'x1'          Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'0'           Literal.Number.Integer
'));'         Punctuation
'\n          ' Text.Whitespace
'`if`'        Name
'('           Punctuation
'res'         Name
' '           Text.Whitespace
'in'          Keyword
' '           Text.Whitespace
"'"           Punctuation
'{'           Punctuation
'true'        Name
','           Operator
'false'       Name
'}'           Punctuation
"'"           Punctuation
'\n                 ' Text.Whitespace
'and'         Keyword
' '           Text.Whitespace
'evalb'       Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'0'           Literal.Number.Integer
','           Operator
'cond'        Name
')('          Punctuation
'eval'        Name.Builtin
'('           Punctuation
'line'        Name
','           Operator
' '           Text.Whitespace
'x'           Name
'='           Operator
'x0'          Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'0'           Literal.Number.Integer
'))'          Punctuation
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'res'         Name
','           Operator
'\n               ' Text.Whitespace
'res'         Name
','           Operator
'\n               ' Text.Whitespace
'FAIL'        Name
')'           Punctuation
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'cond0'       Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'test'        Name
'('           Punctuation
'lhs'         Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'lhs'         Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
'+'           Operator
'1'           Literal.Number.Integer
');'          Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'cond0'       Name
' '           Text.Whitespace
'<>'          Operator
' '           Text.Whitespace
'FAIL'        Name
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'x0'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'lhs'         Name.Builtin
'('           Punctuation
'r'           Name
');'          Punctuation
' '           Text.Whitespace
'r0'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'applyop'     Name
'('           Punctuation
'`+`'         Name
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'r'           Name
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
');'          Punctuation
'\n        '  Text.Whitespace
'else'        Keyword
'\n          ' Text.Whitespace
'cond0'       Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'test'        Name
'('           Punctuation
'rhs'         Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'rhs'         Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
'-'           Operator
'1'           Literal.Number.Integer
');'          Punctuation
'\n          ' Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'cond0'       Name
' '           Text.Whitespace
'<>'          Operator
' '           Text.Whitespace
'FAIL'        Name
' '           Text.Whitespace
'then'        Keyword
'\n            ' Text.Whitespace
'x0'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'rhs'         Name.Builtin
'('           Punctuation
'r'           Name
');'          Punctuation
' '           Text.Whitespace
'r0'          Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'applyop'     Name
'('           Punctuation
'`-`'         Name
','           Operator
' '           Text.Whitespace
'2'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'r'           Name
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
');'          Punctuation
'\n          ' Text.Whitespace
'else'        Keyword
' '           Text.Whitespace
'next'        Keyword
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n      '    Text.Whitespace
'here'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'subs'        Name.Builtin
'('           Punctuation
'cond'        Name
' '           Text.Whitespace
'='           Operator
'           ' Text.Whitespace
'cond0'       Name
' '           Text.Whitespace
','           Operator
' '           Text.Whitespace
'body'        Name
');'          Punctuation
'\n      '    Text.Whitespace
'rest'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'subs'        Name.Builtin
'('           Punctuation
'cond'        Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'evalb'       Name.Builtin
'('           Punctuation
'not'         Keyword
' '           Text.Whitespace
'cond0'       Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'body'        Name
');'          Punctuation
'\n      '    Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'make'        Name
'('           Punctuation
'eval'        Name.Builtin
'('           Punctuation
'here'        Name
','           Operator
' '           Text.Whitespace
'x'           Name
'='           Operator
'x0'          Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'do_peel'     Name
'('           Punctuation
'eval'        Name.Builtin
'('           Punctuation
'subsop'      Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
'='           Operator
'rest'        Name
','           Operator
' '           Text.Whitespace
'['           Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
']'           Punctuation
'='           Operator
'r0'          Name
','           Operator
' '           Text.Whitespace
'e'           Name
'))));'       Punctuation
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'do'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'e'           Name
';'           Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'# Expand sum(a*(b-c),q) to sum(a*b,q)-sum(a*c,q)\n' Comment.Single

'  '          Text.Whitespace
'split'       Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'subsindets'  Name.Builtin
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'And'         Name
'('           Punctuation
'specfunc'    Name
'({'          Punctuation
'sum'         Name
','           Operator
'Sum'         Name
'})'          Punctuation
','           Operator
'\n                       ' Text.Whitespace
'anyfunc'     Name
'('           Punctuation
'And'         Name
'('           Punctuation
'`*`'         Name
','           Operator
'Not'         Name
'('           Punctuation
'`*`'         Name
'('           Punctuation
'Not'         Name
'('           Punctuation
'`+`'         Name
'))))'        Punctuation
','           Operator
'name'        Name
'='           Operator
'anything'    Name
'))'          Punctuation
"'"           Punctuation
','           Operator
'\n                  ' Text.Whitespace
'do_split'    Name
');'          Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n  '        Text.Whitespace
'do_split'    Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'terms'       Name
','           Operator
' '           Text.Whitespace
'x'           Name
';'           Punctuation
'\n    '      Text.Whitespace
'terms'       Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'convert'     Name.Builtin
'('           Punctuation
'expand'      Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'e'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'indets'      Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'e'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'function'    Name
')))'         Punctuation
','           Operator
'\n                     ' Text.Whitespace
"'"           Punctuation
'list'        Name
"'"           Punctuation
','           Operator
' '           Text.Whitespace
'`+`'         Name
');'          Punctuation
'\n    '      Text.Whitespace
'x'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'e'           Name
');'          Punctuation
'\n    '      Text.Whitespace
'`+`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'map'         Name.Builtin
'('           Punctuation
'proc'        Keyword
'('           Punctuation
'term'        Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n      '    Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
's'           Name
','           Operator
' '           Text.Whitespace
'r'           Name
';'           Punctuation
'\n      '    Text.Whitespace
's'           Name
','           Operator
' '           Text.Whitespace
'r'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'selectremove' Name.Builtin
'('           Punctuation
'depends'     Name
','           Operator
' '           Text.Whitespace
'convert'     Name.Builtin
'('           Punctuation
'term'        Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'list'        Name
"'"           Punctuation
','           Operator
' '           Text.Whitespace
'`*`'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'x'           Name
');'          Punctuation
'\n      '    Text.Whitespace
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'subsop'      Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
'='           Operator
'`*`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
's'           Name
'))'          Punctuation
','           Operator
'e'           Name
'))'          Punctuation
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
','           Operator
' '           Text.Whitespace
'terms'       Name
')))'         Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'# Simplify f(lo-1)*product(f(i),i=lo..hi) to product(f(i),i=lo-1..hi)\n' Comment.Single

'  '          Text.Whitespace
'graft'       Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'subsindets'  Name.Builtin
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'Or'          Name
'('           Punctuation
'And'         Name
'('           Punctuation
'`*`'         Name
','           Operator
'Not'         Name
'('           Punctuation
'`*`'         Name
'('           Punctuation
'Not'         Name
'('           Punctuation
'specfunc'    Name
'({'          Punctuation
'product'     Name
','           Operator
'Product'     Name
'})))))'      Punctuation
','           Operator
'\n                      ' Text.Whitespace
'And'         Name
'('           Punctuation
'`+`'         Name
','           Operator
'Not'         Name
'('           Punctuation
'`+`'         Name
'('           Punctuation
'Not'         Name
'('           Punctuation
'specfunc'    Name
'({'          Punctuation
'sum'         Name
'    '        Text.Whitespace
','           Operator
'Sum'         Name
'    '        Text.Whitespace
'}))))))'     Punctuation
"'"           Punctuation
','           Operator
'\n                  ' Text.Whitespace
'do_graft'    Name
');'          Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n  '        Text.Whitespace
'do_graft'    Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'produce'     Name
','           Operator
' '           Text.Whitespace
'factors'     Name
','           Operator
' '           Text.Whitespace
'i'           Name
','           Operator
' '           Text.Whitespace
'j'           Name
';'           Punctuation
'\n    '      Text.Whitespace
'produce'     Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'`if`'        Name
'('           Punctuation
'e'           Name
'::'          Operator
'`*`'         Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'{'           Punctuation
'product'     Name
','           Operator
'Product'     Name
'}'           Punctuation
"'"           Punctuation
','           Operator
'\n                            ' Text.Whitespace
"'"           Punctuation
'{'           Punctuation
'sum'         Name
'    '        Text.Whitespace
','           Operator
'Sum'         Name
'    '        Text.Whitespace
'}'           Punctuation
"'"           Punctuation
');'          Punctuation
'\n    '      Text.Whitespace
'factors'     Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'sort'        Name.Builtin
'('           Punctuation
'convert'     Name.Builtin
'('           Punctuation
'e'           Name
','           Operator
"'"           Punctuation
'list'        Name
"'"           Punctuation
')'           Punctuation
','           Operator
'\n                    ' Text.Whitespace
'key'         Name
' '           Text.Whitespace
'='           Operator
' '           Text.Whitespace
'('           Punctuation
'factor'      Name
' '           Text.Whitespace
'->'          Operator
' '           Text.Whitespace
'-'           Operator
'numboccur'   Name.Builtin
'('           Punctuation
'factor'      Name
','           Operator
'produce'     Name
')));'        Punctuation
'\n    '      Text.Whitespace
'for'         Keyword
' '           Text.Whitespace
'i'           Name
' '           Text.Whitespace
'from'        Keyword
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'factors'     Name
')'           Punctuation
' '           Text.Whitespace
'to'          Keyword
' '           Text.Whitespace
'2'           Literal.Number.Integer
' '           Text.Whitespace
'by'          Keyword
' '           Text.Whitespace
'-'           Operator
'1'           Literal.Number.Integer
' '           Text.Whitespace
'do'          Keyword
'\n      '    Text.Whitespace
'for'         Keyword
' '           Text.Whitespace
'j'           Name
' '           Text.Whitespace
'from'        Keyword
' '           Text.Whitespace
'i'           Name
'-'           Operator
'1'           Literal.Number.Integer
' '           Text.Whitespace
'to'          Keyword
' '           Text.Whitespace
'1'           Literal.Number.Integer
' '           Text.Whitespace
'by'          Keyword
' '           Text.Whitespace
'-'           Operator
'1'           Literal.Number.Integer
' '           Text.Whitespace
'do'          Keyword
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'j'           Name
','           Operator
'factors'     Name
')'           Punctuation
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
"'"           Punctuation
'And'         Name
"'"           Punctuation
'('           Punctuation
"'"           Punctuation
'specfunc'    Name
"'"           Punctuation
'('           Punctuation
'produce'     Name
')'           Punctuation
','           Operator
'\n                                  ' Text.Whitespace
"'"           Punctuation
'anyfunc'     Name
'('           Punctuation
'anything'    Name
','           Operator
'name'        Name
'='           Operator
'range'       Name
')'           Punctuation
"'"           Punctuation
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'Testzero'    Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'i'           Name
','           Operator
'factors'     Name
')'           Punctuation
' '           Text.Whitespace
'-'           Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'(['          Punctuation
'j'           Name
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'factors'     Name
')'           Punctuation
','           Operator
'\n               ' Text.Whitespace
'op'          Name.Builtin
'(['          Punctuation
'j'           Name
','           Operator
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'factors'     Name
')'           Punctuation
'='           Operator
'op'          Name.Builtin
'(['          Punctuation
'j'           Name
','           Operator
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'factors'     Name
')'           Punctuation
'-'           Operator
'1'           Literal.Number.Integer
'))'          Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n            ' Text.Whitespace
'factors'     Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'subsop'      Name.Builtin
'('           Punctuation
'i'           Name
'='           Operator
'NULL'        Name
','           Operator
'applyop'     Name
'('           Punctuation
'`-`'         Name
','           Operator
'['           Punctuation
'j'           Name
','           Operator
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'factors'     Name
','           Operator
'1'           Literal.Number.Integer
'));'         Punctuation
'\n            ' Text.Whitespace
'break'       Keyword
'\n          ' Text.Whitespace
'elif'        Keyword
' '           Text.Whitespace
'Testzero'    Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'i'           Name
','           Operator
'factors'     Name
')'           Punctuation
' '           Text.Whitespace
'-'           Operator
' '           Text.Whitespace
'eval'        Name.Builtin
'('           Punctuation
'op'          Name.Builtin
'(['          Punctuation
'j'           Name
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'factors'     Name
')'           Punctuation
','           Operator
'\n                 ' Text.Whitespace
'op'          Name.Builtin
'(['          Punctuation
'j'           Name
','           Operator
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'factors'     Name
')'           Punctuation
'='           Operator
'op'          Name.Builtin
'(['          Punctuation
'j'           Name
','           Operator
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
']'           Punctuation
','           Operator
'factors'     Name
')'           Punctuation
'+'           Operator
'1'           Literal.Number.Integer
'))'          Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n            ' Text.Whitespace
'factors'     Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'subsop'      Name.Builtin
'('           Punctuation
'i'           Name
'='           Operator
'NULL'        Name
','           Operator
'applyop'     Name
'('           Punctuation
'`+`'         Name
','           Operator
'['           Punctuation
'j'           Name
','           Operator
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
']'           Punctuation
','           Operator
'factors'     Name
','           Operator
'1'           Literal.Number.Integer
'));'         Punctuation
'\n            ' Text.Whitespace
'break'       Keyword
'\n          ' Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'do'          Keyword
'\n    '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'do'          Keyword
';'           Punctuation
'\n    '      Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'0'           Literal.Number.Integer
','           Operator
'e'           Name
')('          Punctuation
'op'          Name.Builtin
'('           Punctuation
'factors'     Name
'))'          Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'# Normalize sum(f(i),i=2..hi) to sum(f(i+2),i=0..hi-2)\n' Comment.Single

'  '          Text.Whitespace
'rebase_lower' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'subsindets'  Name.Builtin
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'And'         Name
'('           Punctuation
'specfunc'    Name
'({'          Punctuation
'sum'         Name
','           Operator
'Sum'         Name
','           Operator
'product'     Name
','           Operator
'Product'     Name
'})'          Punctuation
','           Operator
'\n                       ' Text.Whitespace
'anyfunc'     Name
'('           Punctuation
'anything'    Name
','           Operator
'\n                         ' Text.Whitespace
'name'        Name
'='           Operator
'Not'         Name
'({'          Punctuation
'0'           Literal.Number.Integer
','           Operator
'SymbolicInfinity' Name
','           Operator
'undefined'   Name
'})'          Punctuation
'..'          Operator
'anything'    Name
'))'          Punctuation
"'"           Punctuation
','           Operator
'\n                  ' Text.Whitespace
'do_rebase_lower' Name
');'          Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n  '        Text.Whitespace
'do_rebase_lower' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'subsop'      Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
'='           Operator
'0'           Literal.Number.Integer
','           Operator
'\n           ' Text.Whitespace
'applyop'     Name
'('           Punctuation
'`-`'         Name
','           Operator
'\n                   ' Text.Whitespace
'['           Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
']'           Punctuation
','           Operator
'\n                   ' Text.Whitespace
'applyop'     Name
'('           Punctuation
'eval'        Name.Builtin
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'e'           Name
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'e'           Name
')'           Punctuation
'='           Operator
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'e'           Name
')'           Punctuation
'+'           Operator
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'e'           Name
'))'          Punctuation
','           Operator
'\n                   ' Text.Whitespace
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'e'           Name
')))'         Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'# Normalize sum(f(i),i=lo..2) to sum(f(i+2),i=lo-2..0)\n' Comment.Single

'  '          Text.Whitespace
'rebase_upper' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'subsindets'  Name.Builtin
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'And'         Name
'('           Punctuation
'specfunc'    Name
'({'          Punctuation
'sum'         Name
','           Operator
'Sum'         Name
','           Operator
'product'     Name
','           Operator
'Product'     Name
'})'          Punctuation
','           Operator
'\n                       ' Text.Whitespace
'anyfunc'     Name
'('           Punctuation
'anything'    Name
','           Operator
'\n                         ' Text.Whitespace
'name'        Name
'='           Operator
'anything'    Name
'..'          Operator
'Not'         Name
'({'          Punctuation
'0'           Literal.Number.Integer
','           Operator
'SymbolicInfinity' Name
','           Operator
'undefined'   Name
'})))'        Punctuation
"'"           Punctuation
','           Operator
'\n                  ' Text.Whitespace
'do_rebase_upper' Name
');'          Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n  '        Text.Whitespace
'do_rebase_upper' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'('           Punctuation
'e'           Name
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n    '      Text.Whitespace
'subsop'      Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
']'           Punctuation
'='           Operator
'0'           Literal.Number.Integer
','           Operator
'\n           ' Text.Whitespace
'applyop'     Name
'('           Punctuation
'`-`'         Name
','           Operator
'\n                   ' Text.Whitespace
'['           Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'\n                   ' Text.Whitespace
'applyop'     Name
'('           Punctuation
'eval'        Name.Builtin
','           Operator
' '           Text.Whitespace
'1'           Literal.Number.Integer
','           Operator
' '           Text.Whitespace
'e'           Name
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'e'           Name
')'           Punctuation
'='           Operator
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'e'           Name
')'           Punctuation
'+'           Operator
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
']'           Punctuation
','           Operator
'e'           Name
'))'          Punctuation
','           Operator
'\n                   ' Text.Whitespace
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
']'           Punctuation
','           Operator
'e'           Name
')))'         Punctuation
'\n  '        Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n\n  '      Text.Whitespace
'ModuleLoad'  Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'proc'        Keyword
'($)'         Punctuation
'\n    '      Text.Whitespace
'# Override csgn to work a little bit harder on piecewise and sum\n' Comment.Single

'    '        Text.Whitespace
'# (to get rid of csgn(1/2+1/2*sum(piecewise(...,1,0),...))\n' Comment.Single

'    '        Text.Whitespace
'#  produced by int on a Gaussian mixture model)\n' Comment.Single

'    '        Text.Whitespace
'unprotect'   Name
'('           Punctuation
'csgn'        Name
');'          Punctuation
'\n    '      Text.Whitespace
'csgn'        Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'overload'    Name
'(['          Punctuation
'\n      '    Text.Whitespace
"# Handle if the csgn of a piecewise doesn't depend on which branch\n" Comment.Single

'      '      Text.Whitespace
'proc'        Keyword
'('           Punctuation
'a'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'specfunc'    Name
'('           Punctuation
'piecewise'   Name.Builtin
')'           Punctuation
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n        '  Text.Whitespace
'option'      Keyword
' '           Text.Whitespace
'overload'    Name
';'           Punctuation
'\n        '  Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'r'           Name
','           Operator
' '           Text.Whitespace
'i'           Name
';'           Punctuation
'\n        '  Text.Whitespace
'r'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'{'           Punctuation
'seq'         Name.Builtin
'('           Punctuation
'`if`'        Name
'('           Punctuation
'i'           Name
'::'          Operator
'even'        Name
' '           Text.Whitespace
'or'          Keyword
' '           Text.Whitespace
'i'           Name
'='           Operator
'nops'        Name.Builtin
'('           Punctuation
'a'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'csgn'        Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'i'           Name
','           Operator
'a'           Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'NULL'        Name
')'           Punctuation
','           Operator
'\n                  ' Text.Whitespace
'i'           Name
'='           Operator
'1'           Literal.Number.Integer
'..'          Punctuation
'nops'        Name.Builtin
'('           Punctuation
'a'           Name
'))};'        Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
'='           Operator
'1'           Literal.Number.Integer
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'assigned'    Name.Builtin
'(_'          Punctuation
'Envsignum0'  Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'r'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'r'           Name
' '           Text.Whitespace
'minus'       Keyword
' '           Text.Whitespace
'{'           Punctuation
'0'           Literal.Number.Integer
'};'          Punctuation
'\n          ' Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
'='           Operator
'1'           Literal.Number.Integer
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'error'       Keyword
' '           Text.Whitespace
'"invalid input: cannot csgn %1"' Literal.String
','           Operator
' '           Text.Whitespace
'a'           Name
';'           Punctuation
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
','           Operator
'\n      '    Text.Whitespace
"# Handle if the csgn of a sum doesn't depend on the bound variable\n" Comment.Single

'      '      Text.Whitespace
'proc'        Keyword
'('           Punctuation
'a'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'And'         Name
'('           Punctuation
'specfunc'    Name
'({'          Punctuation
'sum'         Name
','           Operator
' '           Text.Whitespace
'Sum'         Name
'})'          Punctuation
','           Operator
' '           Text.Whitespace
'anyfunc'     Name
'('           Punctuation
'anything'    Name
','           Operator
' '           Text.Whitespace
'name'        Name
'='           Operator
'range'       Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n        '  Text.Whitespace
'option'      Keyword
' '           Text.Whitespace
'overload'    Name
';'           Punctuation
'\n        '  Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'r'           Name
';'           Punctuation
'\n        '  Text.Whitespace
'r'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'csgn'        Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'a'           Name
'));'         Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'depends'     Name
'('           Punctuation
'r'           Name
','           Operator
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'a'           Name
'))'          Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'signum'      Name
'('           Punctuation
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
']'           Punctuation
','           Operator
'a'           Name
')'           Punctuation
'+'           Operator
'1'           Literal.Number.Integer
'-'           Operator
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'a'           Name
'))'          Punctuation
' '           Text.Whitespace
'*'           Operator
' '           Text.Whitespace
'r'           Name
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'error'       Keyword
' '           Text.Whitespace
'"invalid input: cannot csgn %1"' Literal.String
','           Operator
' '           Text.Whitespace
'a'           Name
';'           Punctuation
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
','           Operator
'\n      '    Text.Whitespace
'csgn'        Name
']);'         Punctuation
'\n    '      Text.Whitespace
'protect'     Name
'('           Punctuation
'csgn'        Name
');'          Punctuation
'\n\n    '    Text.Whitespace
'# Do the same to signum.\n' Comment.Single

'    '        Text.Whitespace
'unprotect'   Name
'('           Punctuation
'signum'      Name
');'          Punctuation
'\n    '      Text.Whitespace
'signum'      Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'overload'    Name
'(['          Punctuation
'\n      '    Text.Whitespace
"# Handle if the signum of a piecewise doesn't depend on which branch\n" Comment.Single

'      '      Text.Whitespace
'proc'        Keyword
'('           Punctuation
'a'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'specfunc'    Name
'('           Punctuation
'piecewise'   Name.Builtin
')'           Punctuation
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n        '  Text.Whitespace
'option'      Keyword
' '           Text.Whitespace
'overload'    Name
';'           Punctuation
'\n        '  Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'r'           Name
','           Operator
' '           Text.Whitespace
'i'           Name
';'           Punctuation
'\n        '  Text.Whitespace
'r'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'{'           Punctuation
'seq'         Name.Builtin
'('           Punctuation
'`if`'        Name
'('           Punctuation
'i'           Name
'::'          Operator
'even'        Name
' '           Text.Whitespace
'or'          Keyword
' '           Text.Whitespace
'i'           Name
'='           Operator
'nops'        Name.Builtin
'('           Punctuation
'a'           Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'signum'      Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'i'           Name
','           Operator
'a'           Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'NULL'        Name
')'           Punctuation
','           Operator
'\n                  ' Text.Whitespace
'i'           Name
'='           Operator
'1'           Literal.Number.Integer
'..'          Punctuation
'nops'        Name.Builtin
'('           Punctuation
'a'           Name
'))};'        Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
'='           Operator
'1'           Literal.Number.Integer
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'assigned'    Name.Builtin
'(_'          Punctuation
'Envsignum0'  Name
')'           Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'r'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'r'           Name
' '           Text.Whitespace
'minus'       Keyword
' '           Text.Whitespace
'{'           Punctuation
'0'           Literal.Number.Integer
'};'          Punctuation
'\n          ' Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'nops'        Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
'='           Operator
'1'           Literal.Number.Integer
' '           Text.Whitespace
'then'        Keyword
' '           Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'r'           Name
')'           Punctuation
' '           Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'error'       Keyword
' '           Text.Whitespace
'"invalid input: cannot signum %1"' Literal.String
','           Operator
' '           Text.Whitespace
'a'           Name
';'           Punctuation
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
','           Operator
'\n      '    Text.Whitespace
"# Handle if the signum of a sum doesn't depend on the bound variable\n" Comment.Single

'      '      Text.Whitespace
'proc'        Keyword
'('           Punctuation
'a'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'And'         Name
'('           Punctuation
'specfunc'    Name
'({'          Punctuation
'sum'         Name
','           Operator
' '           Text.Whitespace
'Sum'         Name
'})'          Punctuation
','           Operator
' '           Text.Whitespace
'anyfunc'     Name
'('           Punctuation
'anything'    Name
','           Operator
' '           Text.Whitespace
'name'        Name
'='           Operator
'range'       Name
'))'          Punctuation
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n        '  Text.Whitespace
'option'      Keyword
' '           Text.Whitespace
'overload'    Name
';'           Punctuation
'\n        '  Text.Whitespace
'local'       Keyword
' '           Text.Whitespace
'r'           Name
';'           Punctuation
'\n        '  Text.Whitespace
'r'           Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'signum'      Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'a'           Name
'));'         Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'depends'     Name
'('           Punctuation
'r'           Name
','           Operator
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'a'           Name
'))'          Punctuation
' '           Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
'return'      Keyword
' '           Text.Whitespace
'signum'      Name
'('           Punctuation
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
']'           Punctuation
','           Operator
'a'           Name
')'           Punctuation
'+'           Operator
'1'           Literal.Number.Integer
'-'           Operator
'op'          Name.Builtin
'(['          Punctuation
'2'           Literal.Number.Integer
','           Operator
'2'           Literal.Number.Integer
','           Operator
'1'           Literal.Number.Integer
']'           Punctuation
','           Operator
'a'           Name
'))'          Punctuation
' '           Text.Whitespace
'*'           Operator
' '           Text.Whitespace
'r'           Name
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
';'           Punctuation
'\n        '  Text.Whitespace
'error'       Keyword
' '           Text.Whitespace
'"invalid input: cannot signum %1"' Literal.String
','           Operator
' '           Text.Whitespace
'a'           Name
';'           Punctuation
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
','           Operator
'\n      '    Text.Whitespace
'signum'      Name
']);'         Punctuation
'\n    '      Text.Whitespace
'protect'     Name
'('           Punctuation
'signum'      Name
');'          Punctuation
'\n\n    '    Text.Whitespace
'# Override sum to fail faster\n' Comment.Single

'    '        Text.Whitespace
'unprotect'   Name
'('           Punctuation
'sum'         Name
');'          Punctuation
'\n    '      Text.Whitespace
'sum'         Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'overload'    Name
'(['          Punctuation
'\n      '    Text.Whitespace
'proc'        Keyword
'('           Punctuation
'f'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'Not'         Name
'({'          Punctuation
'`+`'         Name
','           Operator
'`+`'         Name
'^'           Operator
'integer'     Name
'})'          Punctuation
','           Operator
'\n           ' Text.Whitespace
'k'           Name
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
'name'        Name
'='           Operator
'And'         Name
'('           Punctuation
'range'       Name
','           Operator
'Not'         Name
'('           Punctuation
'range'       Name
'('           Punctuation
'rational'    Name
')))'         Punctuation
','           Operator
' '           Text.Whitespace
'$'           Operator
')'           Punctuation
'\n        '  Text.Whitespace
'option'      Keyword
' '           Text.Whitespace
'overload'    Name
';'           Punctuation
'\n        '  Text.Whitespace
'if'          Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'('           Punctuation
'`-`'         Name
'('           Punctuation
'op'          Name.Builtin
'('           Punctuation
'rhs'         Name.Builtin
'('           Punctuation
'k'           Name
')))'         Punctuation
' '           Text.Whitespace
'::'          Operator
' '           Text.Whitespace
"'"           Punctuation
'rational'    Name
"'"           Punctuation
')'           Punctuation
'\n           ' Text.Whitespace
'and'         Keyword
' '           Text.Whitespace
'not'         Keyword
' '           Text.Whitespace
'('           Punctuation
'subsindets'  Name.Builtin
'('           Punctuation
'f'           Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'anything'    Name
'^'           Operator
'integer'     Name
"'"           Punctuation
','           Operator
' '           Text.Whitespace
'f'           Name
'->'          Operator
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'f'           Name
'))'          Punctuation
'\n                    ' Text.Whitespace
'::'          Operator
' '           Text.Whitespace
"'"           Punctuation
'{'           Punctuation
'`+`'         Name
','           Operator
'And'         Name
'('           Punctuation
'`*`'         Name
','           Operator
'Not'         Name
'('           Punctuation
'`*`'         Name
'('           Punctuation
'Not'         Name
'('           Punctuation
'`+`'         Name
'))))}'       Punctuation
"'"           Punctuation
')'           Punctuation
'\n           ' Text.Whitespace
'and'         Keyword
' '           Text.Whitespace
'depends'     Name
'('           Punctuation
'indets'      Name.Builtin
'('           Punctuation
'f'           Name
','           Operator
' '           Text.Whitespace
"'"           Punctuation
'{'           Punctuation
'specfunc'    Name
'('           Punctuation
'idx'         Name
')'           Punctuation
','           Operator
' '           Text.Whitespace
'specindex'   Name
'('           Punctuation
'idx'         Name
')}'          Punctuation
"'"           Punctuation
')'           Punctuation
','           Operator
' '           Text.Whitespace
'op'          Name.Builtin
'('           Punctuation
'1'           Literal.Number.Integer
','           Operator
'k'           Name
'))'          Punctuation
'\n        '  Text.Whitespace
'then'        Keyword
'\n          ' Text.Whitespace
"'"           Punctuation
'procname'    Name
'(_'          Punctuation
'passed'      Name
')'           Punctuation
"'"           Punctuation
'\n        '  Text.Whitespace
'else'        Keyword
'\n          ' Text.Whitespace
'error'       Keyword
' '           Text.Whitespace
'"invalid input: cannot fast-fail sum(%1, %2)"' Literal.String
','           Operator
' '           Text.Whitespace
'_passed'     Name
'\n        '  Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'if'          Keyword
'\n      '    Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
','           Operator
'\n      '    Text.Whitespace
'sum'         Name
']);'         Punctuation
'\n    '      Text.Whitespace
'protect'     Name
'('           Punctuation
'sum'         Name
');'          Punctuation
'\n\n    '    Text.Whitespace
':'           Operator
'-'           Operator
'`print/Ints`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'curry'       Name
'('           Punctuation
'thismodule'  Name
':'           Operator
'-'           Operator
'Print'       Name
','           Operator
'Ints'        Name
');'          Punctuation
'\n    '      Text.Whitespace
':'           Operator
'-'           Operator
'`print/Sums`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'curry'       Name
'('           Punctuation
'thismodule'  Name
':'           Operator
'-'           Operator
'Print'       Name
','           Operator
'Sums'        Name
');'          Punctuation
'\n    '      Text.Whitespace
':'           Operator
'-'           Operator
'`print/ints`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'curry'       Name
'('           Punctuation
'thismodule'  Name
':'           Operator
'-'           Operator
'Print'       Name
','           Operator
'ints'        Name
');'          Punctuation
'\n    '      Text.Whitespace
':'           Operator
'-'           Operator
'`print/sums`' Name
' '           Text.Whitespace
':='          Operator
' '           Text.Whitespace
'curry'       Name
'('           Punctuation
'thismodule'  Name
':'           Operator
'-'           Operator
'Print'       Name
','           Operator
'sums'        Name
');'          Punctuation
'\n\n  '      Text.Whitespace
'end'         Keyword
' '           Text.Whitespace
'proc'        Keyword
';'           Punctuation
'\n  '        Text.Whitespace
'ModuleLoad'  Name
'()'          Punctuation
':'           Operator
'\n'          Text.Whitespace

'end'         Keyword
' '           Text.Whitespace
'module'      Keyword
';'           Punctuation
' '           Text.Whitespace
'# Loop\n'    Comment.Single
