\d k \l a K:{adverb project flat order binary unary tree x} / "x" -> (`c;"x") type:{:[~4:x;_f'x;x[0]_in A;({`a};x);&/x _lin V;({`v};x);({`n};x)]} V:".-_~!@#$%^&*=+|<,>?:" A:"'/\\" / x is the type of the result of binding y and z S:(`vvv`vuv`vvu`vuu `nvn `nun `unv `nnn `vna`vva`vua`vnb`vvb`vub) / "xyz" -> B[y;z]=index of yz in S, C[y;z]=x abc:{ s:`$'''$(),/:x j:,/s[;;1 2];k:,/l:s[;;0];i:,/a,\:/:a:?,//s b:./[./[_n;i;:;-1];j;:;&#:'l] c:./[./[_n;i;:;_n];j;:;(. 1!"}{`",)'$k] (b;c)} @[_d;`B`C;:;abc S]; / parse 2x2 tree:{*(1<#:)(bind . drop@)/|@[x;&term'x;_f@]} / token-list -> parse-tree term:{:[1=#x;1;~4:x 1]} / nested token-list bind:{,/.[(0,y+0 2)_ x;1;pair;C_ . x[1 0+y;0]]} / ..xy.. -> ..(t;yx).. drop:{(x;(<':B_':*:'x)?1)} / drop in binding strength pair:{,(y;|x)} / binding operation B_:{B[x[]]y[]} / binding strength C_:{C[x[]]y[]} / result category / disambiguate verbs: n(vn) -> n(v:n) unary:{:[4:x 1;u . x;unary_ .[x;(1;);_f]]} unary_:{:[vn x;u0;vu x;uu;vv x;u0;::]x} u:{:[(`v~x[])&(1<#1_ y)&(&/(1_ y)_lin V)&":"=*-1#y;({`u};y);(x;y)]} vv:{(`v=x[0][])&(`v=x[1;0;0][])&(~~4:x[1;0;1])&`v=x[1;1;0][]} vu:{(`v=x[0][])&(`v=x[1;0;0][])&(~~4:x[1;0;1])&`u=x[1;1;0][]} uu:{({`u};.[x;1 0;:;({`u};x[1;0;1],":")])} vn:{(`v=x[1;0;0][])&(x[1;1;0][]_in`n`u)&~~4:x[1;0;1]} u0:{.[x;1 0;:;({`u};x[1;0;1],":")]} / disambiguate adverbs: n(v(va)) -> n(v(vb)) binary:{:[4:x 1;b . x;binary_ .[x;(1;);_f]]} binary_:{:[va x 1;vb x;x]} b:{:[(`a~x[])&(1<#y)&(&/(-1_ 1_ y)_lin A)&"."=*-1#y;({`b};y);(x;y)]} va:{:[~`n=x[0;0][];0;~`v=x[1;0][];0;4:x[1;1];0;(x[1;1;0;0][]_in`n`v)&`a=x[1;1;1;0][]]} vb:{.[x;1 1 1 1 0;:;{`b}]} / head normal form: xf -> fx order:{:[4:x 1;x;o . _f'x]} o:{:[(x[0][];y[0][])_in(`n`a;`n`b;`v`a;`v`b;`n`v;`u`a;`u`b);(y;x);(x;y)]} / eliminate derived types flat:{:[4:x 1;x;_f'x 1]} / project verb: x. -> {x[;y]} project:{:[4:x 1;p . x;_f'x]} p:{(x;:["U"=*y;"V{",y[1],"[;x]}";y])} / simulate first-class adverbs adverb:{:[4:x 1;a . x;_f'x]} a:{(x;y[0],:[`a~x[];A1;`b~x[];A2;::]1_ y)} \d ^ K:k.K \ drop:{(x;((&':noun'-1_ x)|<':B_':*:'x)?1)} / drop in binding strength or n n noun:{`n~x[0][]} / ?noun