_seps: "',(){}=<>^&|!->"

20 imply_left = {
    and:"and"
    type_or_pow
}
19 and_right = {
    and:"and"
    type_or_pow
}
18 , = [.w? "," .w?]
17 app_left = {
    [.._seps!:"sym" ?"'"]
}
16 app = [!"all(" !"excm(" app_left:"left" "(" .w? .s!(, type:"arg") .w? ")"]
15 pow_eq = [typeleft_or_not:"left" .w? "=^=" .w? typeleft_or_not:"right"]
14 all = ["all(" .w? type_or_fun:"arg" .w? ")"]
13 type_or_fun = {fun:"pow" type}
12 type_or_pow = {
    pow:"pow"
    typeleft_or_not
}
11 fun = [type:"right" .w? "->" .w? type_or_fun:"left"]
10 excm = ["excm(" .w? type:"arg" .w? ")"]
9 not = ["!" typeleft_or_not:"arg"]
8 or = [type_or_pow:"left" .w? "|" .w? type_or_pow:"right"]
7 eq = [type_or_pow:"left" .w? "==" .w? type_or_pow:"right"]
6 and = [type_or_pow:"left" .w? "&" .w? and_right:"right"]
5 pow = [typeleft:"left" .w? "^" .w? typeleft:"right"]
4 imply = [imply_left:"left" .w? "=>" .w? type:"right"]
3 typeleft_or_not = {
    not:"not"
    typeleft
}
2 typeleft = {
    ["(" .w? type_or_fun .w? ")"]
    excm:"excm"
    all:"all"
    "true":"true"
    "false":"false"
    app:"app"
    [.._seps!:"sym" "'"]
    .._seps!:"name"
}
1 type = {
    imply:"imply"
    and:"and"
    or:"or"
    eq:"eq"
    pow_eq:"pow_eq"
    pow:"pow"
    typeleft_or_not
}
0 doc = [.w? type_or_fun:"type" .w?]

