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

23 or = .s!([.w? "|" .w?] and:"arg")
22 and = .s!([.w? "&" .w?] type_or_pow:"arg")
21 var = [.._seps!:"name" ?"'":"sym"]
20 imply_left = or:"or"
18 , = [.w? "," .w?]
17 app_left = var:"var"
16 app = [!"all(" !"excm(" app_left:"left" "(" .w? .s!(, type_or_fun:"arg") .w? ")"]
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? "->":"pow" .w? type_or_fun:"left"]
10 excm = ["excm(" .w? type:"arg" .w? ")"]
9 not = ["!" typeleft_or_not:"arg"]
7 eq = [type_or_pow:"left" .w? {
    "==":"eq"
    "=^=":"pow_eq"
} .w? type_or_pow:"right"]
5 pow = [typeleft:"left" .w? "^":"pow" .w? typeleft:"right"]
4 imply = [imply_left:"left" .w? "=>":"imply" .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"
    var:"var"
}
1 type = {
    imply:"imply"
    eq:"eq"
    or:"or"
}
0 doc = [.w? type_or_fun:"type" .w?]

