(sumti
 . (seq
    (choice
     (seq
      (optional (comment "Outer quantifier" number))
      (choice
       (comment "Description"
                (choice
                 ;; FIXME: Indefinite description? http://dag.github.ui/cll/6/8/
                 (seq 
                  (comment
                   "These are known as gadri"
                   (choice
                    (comment "{le} = the thing(s) I describe as...\n{lei} = the mass of things I describe as ...\n{le'i} = the set of things I describe as ..." "le|lei|le'i")
                    (comment "{lo} = the thing(s) which are...\n{loi} = the mass of things which are ...\n{lo'i} = the set of things which are ..." "lo|loi|lo'i")
                    (comment "{lo'e} = the typical thing which is...\n{le'e} what I perceive as the typical thing which is..." "lo'e|le'e")))
                  (optional (comment "Inner quantifier" number))
                  (choice bridi sumti)
                  (elidable "ku"))))
       pro-sumti
       (seq (comment "{la} = the thing(s) named\n{lai} = the mass of things named\n{la'i} = the set of things named\nIn all caseds, the name refers to the members, not the mass/set;\nyou can use {la} to refer to a named set." "la|lai|la'i")
            (choice bridi cmene)
            (elidable "ku"))
       (seq "lu" valid-lojban-text "li'u")
       (seq "lo'u" invalid-lojban-text "le'u")
       (seq "zo" lojban-word)
       (seq "zoi" delimiter-word foreign-text delimiter-word)
       (seq "la'o" delimiter-word foreign-name delimiter-word)
       (comment "The number value"
                (seq "li" number (elidable "lo'o")))
       (comment "The numerical expression"
                (seq "me'o" number (elidable "lo'o")))
       (seq
        (choice
         (comment
          "{la'e} = the thing referred to (by name; {lu'e} = a name/title/reference of
{tu'a} = some abstract involving; {lu'a} = a member/part of
{lu'i} = a set formed from; {lu'o} = a mass formed from
{vu'i} = a sequence formed from; {na'ebo} = something other than
{to'ebo} = the opposite of; {no'ebo} = the neutral form of
{je'abo} = that which indeed is"
          "la'e|lu'e|tu'a|lu'a|lu'i|lu'o|vu'i|na'ebo|to'ebo|no'ebo|je'abo"))
        sumti (elidable "lu'u"))))
     (seq sumti
          (choice
           (comment "A {.a} B = A and/or B; A {.e} B = A and B; A {.o} B = A if and only if B; A {.u} B = A (whether or not B)
A {na.a} B = A, only if B; A {.anai} B = A, and/or (not B); A {na.anai} B = not (A and B); A {na.e} B = (not A), and B
A {.enai} B = A, and (not B); A {na.enai} B = neither A nor B; A {.onai} B = A (exclusive) or B; A {na.u} B = not A (whether or not B)
A {nase.u} B = B (whether or not A); A {se.unai} B = (not B) (whether or not A)"
                    ".a|.e|.o|.u|na.a|.anai|na.anai|na.e|.enai|na.enai|.onai|na.u|nase.u|se.unai")
           (comment "A {joi} B = A and B (as a mass); A {ce} B = A and B (as a set); A {ce'o} B = A then B (sequence)
A {sece'o} B = B then A (sequence); A {jo'u} B = A and B (jointly); A {fa'u} B = A and B (respectively)
A {sefa'u} B = B and A (respectively); A {jo'e} B = A union B (sets); A {ku'a} B = A intersect B (sets)
A {pi'u} B = A cross B (sets, makes set of pairs); A {sepi'u} B = B cross A (sets, makes set of pairs)"
                    "joi|ce|ce'o|sec'o|jo'u|fa'u|sefa'u|jo'e|ku'a|pi'u|sepi'u"))
          (elidable "bo") sumti)
     (seq
      (comment "{ga} A {gi} B = A and/or B; {ge} A {gi} B = A and B; {go} A {gi} B = A if and only if B; {gu} A {gi} B = A (whether or not B)
{naga} A {gi} B = A, only if B; {ganai} A {gi} B = A, and/or (not B); {naganai} A {gi} B = not (A and B); {nage} A {gi} B = (not A), and B
{genai} A {gi} B = A, and (not B); {nagenai} A {gi} B = neither A nor B; {gonai} A {gi} B = A (exclusive) or B; {nagu} A {gi} B = not A (whether or not B)
{nasegu} A {gi} B = B (whether or not A); {segunai} A {gi} B = (not B) (whether or not A)"
               "ga|ge|go|gu|naga|ganai|naganai|nage|genai|nagenai|gonai|nagu|nasegu|segunai")
      sumti "gi" sumti)
     (comment "Note: Outermost sumti may not use {ke}"
              (seq "ke" sumti "ke'e")))
(optional (seq relative (zero-or-more (seq "zi'e" relative))))))

(pro-sumti
 . (choice
    (comment "{mi} = the speaker\n{do} = the audience\n{mi'o} = the speaker and the audience\n{mi'a} = the speaker and others, but not the audience\n{ma'a} = the speaker, the audience, and others\n{do'o} = the audience and others\n{ko} = you (imperative)"
             "mi|do|mi'o|mi'a|ma'a|do'o|ko")
    (comment "{ti} = this\n{ta} = that\n{tu} = that (distant)"
             "ti|ta|tu")
    (comment "{da'u} = a much earlier utterance\n{de'u} = an earlier utterance\n{di'u} = the previous utterance\n{dei} = this utterance\n{di'e} = the next utterance\n{de'e} = a later utterance\n{da'e} = a much later utterance\n{do'i} = some utterance"
             "da'u|de'u|di'u|dei|di'e|de'e|da'e|do'i")
    (comment "Assignable pro-sumti (bind them with {goi})"
             (choice
              "ko'a|ko'e|ko'i|ko'o|ko'u|fo'a|fo'e|fo'i|fo'o|fo'u"
              letteral))
    (comment "{ra} = repeat some recent sumti\n{ru} = repeat some earlier sumti"
             "ra|ru")
    (comment "Repeat last (or Nth previous) complete sumti"
             (seq "ri" (optional (seq "xi" number))))
    (comment "{zo'e} = the obvious value\n{zu'i} = the typical value\n{zi'o} = no value"
             "zo'e|zu'i|zi'o")
    (comment "{vo'a} = x1 of this bridi\n..."
             "vo'a|vo'e|vo'i|vo'o|vo'u")
    (comment "Sumti question"
             "ma")
    (comment "{ke'a} = placeholder sumti for relative clauses\n{ce'u} = placeholder sumti for abstraction focus"
             "ke'a|ce'u")
    (comment "Bound variables"
             "da|de|di")))

;; FIXME: soi... [se'u]?

(relative
 . (choice 
    (comment
     "Bridis within relative clauses can use {ke'a} to refer to the target\nIf there is no {ke'a}, x1 is assumed."
     (choice
      (comment "...which is defined as..."
               (seq "poi" bridi (elidable "ku'o")))
      (comment "...which I (subjectively) define as..."
               (seq "voi" bridi (elidable "ku'o")))
      (comment "...which, by the way, is..."
               (seq "noi" bridi (elidable "ku'o")))))

    (comment
     "{goi} = ...also known as... (used to assign assignables)
{pe} = ...which is associated with...
{ne} = ...which (by the way) is associated with...
{po} = ...which is owned by...
{po'e} = ...which is part of...
{po'u} = ...which is...
{no'u} = ...which (by the way) is..."
     "goi|pe|ne|po|po'e|po'u|no'u")))
