
(/VERSIONCHECK 2) 

(DEFUN |MMLFORM;hasop?| (|expr| |op| $)
  (PROG (|e1|)
    (RETURN
     (SEQ
      (COND ((ATOM |expr|) 'NIL)
            ('T
             (SEQ (LETT |e1| (|SPADfirst| |expr|) |MMLFORM;hasop?|)
                  (EXIT (EQ |e1| |op|))))))))) 

(DEFUN |MMLFORM;coerce;OfS;2| (|expr| $)
  (PROG (|s|)
    (RETURN
     (SEQ
      (LETT |s|
            (|MMLFORM;postcondition|
             (|MMLFORM;formatExpr| (|MMLFORM;precondition| |expr| $)
              (QREFELT $ 8) $)
             $)
            |MMLFORM;coerce;OfS;2|)
      (EXIT |s|))))) 

(PUT '|MMLFORM;sayExpr| '|SPADreplace| '|sayMathML|) 

(DEFUN |MMLFORM;sayExpr| (|s| $) (|sayMathML| |s|)) 

(DEFUN |MMLFORM;coerceS;OfS;4| (|expr| $)
  (PROG (|s|)
    (RETURN
     (SEQ
      (LETT |s|
            (|MMLFORM;postcondition|
             (|MMLFORM;formatExpr| (|MMLFORM;precondition| |expr| $)
              (QREFELT $ 8) $)
             $)
            |MMLFORM;coerceS;OfS;4|)
      (|MMLFORM;sayExpr|
       "<math xmlns=\"http://www.w3.org/1998/Math/MathML\" mathsize=\"big\" display=\"block\">"
       $)
      (|MMLFORM;displayElt| |s| $) (|MMLFORM;sayExpr| "</math>" $)
      (EXIT |s|))))) 

(DEFUN |MMLFORM;coerceL;OfS;5| (|expr| $)
  (PROG (|s|)
    (RETURN
     (SEQ
      (LETT |s|
            (|MMLFORM;postcondition|
             (|MMLFORM;formatExpr| (|MMLFORM;precondition| |expr| $)
              (QREFELT $ 8) $)
             $)
            |MMLFORM;coerceL;OfS;5|)
      (|MMLFORM;sayExpr|
       "<math xmlns=\"http://www.w3.org/1998/Math/MathML\" mathsize=\"big\" display=\"block\">"
       $)
      (|MMLFORM;sayExpr| |s| $) (|MMLFORM;sayExpr| "</math>" $) (EXIT |s|))))) 

(DEFUN |MMLFORM;display;SV;6| (|mathml| $)
  (SEQ
   (|MMLFORM;sayExpr|
    "<math xmlns=\"http://www.w3.org/1998/Math/MathML\" mathsize=\"big\" display=\"block\">"
    $)
   (|MMLFORM;sayExpr| |mathml| $) (|MMLFORM;sayExpr| "</math>" $)
   (EXIT (SPADCALL (QREFELT $ 27))))) 

(DEFUN |MMLFORM;exprex;OfS;7| (|expr| $)
  (PROG (|s| |s1| #1=#:G1887 |a| |nargs| |args| |sop| |op| |le|)
    (RETURN
     (SEQ
      (LETT |expr| (|MMLFORM;precondition| |expr| $)
            . #2=(|MMLFORM;exprex;OfS;7|))
      (COND
       ((OR (ATOM |expr|) (EQUAL (|MMLFORM;stringify| |expr| $) "NOTHING"))
        (EXIT
         (SPADCALL (LIST "{" (|MMLFORM;stringify| |expr| $) "}")
                   (QREFELT $ 30)))))
      (LETT |le| |expr| . #2#) (LETT |op| (|SPADfirst| |le|) . #2#)
      (LETT |sop| (SPADCALL |op| (QREFELT $ 31)) . #2#)
      (LETT |args| (CDR |le|) . #2#) (LETT |nargs| (LENGTH |args|) . #2#)
      (LETT |s| (SPADCALL (LIST "{" |sop|) (QREFELT $ 30)) . #2#)
      (COND
       ((< 0 |nargs|)
        (SEQ (LETT |a| NIL . #2#) (LETT #1# |args| . #2#) G190
             (COND
              ((OR (ATOM #1#) (PROGN (LETT |a| (CAR #1#) . #2#) NIL))
               (GO G191)))
             (SEQ (LETT |s1| (SPADCALL |a| (QREFELT $ 31)) . #2#)
                  (EXIT
                   (LETT |s| (SPADCALL (LIST |s| |s1|) (QREFELT $ 30)) . #2#)))
             (LETT #1# (CDR #1#) . #2#) (GO G190) G191 (EXIT NIL))))
      (EXIT (LETT |s| (SPADCALL (LIST |s| "}") (QREFELT $ 30)) . #2#)))))) 

(DEFUN |MMLFORM;displayElt| (|mathML| $)
  (PROG (|u| |enT| |enE| |name| |length| |end|)
    (RETURN
     (SEQ (LETT |end| (QCSIZE |mathML|) . #1=(|MMLFORM;displayElt|))
          (LETT |length| 60 . #1#)
          (LETT |name| (|MMLFORM;eltName| 1 |mathML| $) . #1#)
          (LETT |enE|
                (|MMLFORM;eltLimit| |name| (+ 2 (QCSIZE |name|)) |mathML| $)
                . #1#)
          (COND
           ((< |enE| |length|)
            (SEQ (LETT |u| (SPADCALL 1 |enE| (QREFELT $ 34)) . #1#)
                 (EXIT (|sayTeX| (SPADCALL |mathML| |u| (QREFELT $ 35))))))
           ('T
            (SEQ (LETT |enT| (|MMLFORM;tagEnd| |name| 1 |mathML| $) . #1#)
                 (LETT |u| (SPADCALL 1 |enT| (QREFELT $ 34)) . #1#)
                 (|sayTeX| (SPADCALL |mathML| |u| (QREFELT $ 35)))
                 (LETT |u|
                       (SPADCALL (+ |enT| 1) (- (- |enE| (QCSIZE |name|)) 3)
                                 (QREFELT $ 34))
                       . #1#)
                 (|MMLFORM;displayElt| (SPADCALL |mathML| |u| (QREFELT $ 35))
                  $)
                 (LETT |u|
                       (SPADCALL (- (- |enE| (QCSIZE |name|)) 2) |enE|
                                 (QREFELT $ 34))
                       . #1#)
                 (EXIT (|sayTeX| (SPADCALL |mathML| |u| (QREFELT $ 35)))))))
          (COND
           ((< |enE| |end|)
            (SEQ (LETT |u| (SPADCALL (+ |enE| 1) |end| (QREFELT $ 34)) . #1#)
                 (EXIT
                  (|MMLFORM;displayElt| (SPADCALL |mathML| |u| (QREFELT $ 35))
                   $)))))
          (EXIT (SPADCALL (QREFELT $ 27))))))) 

(DEFUN |MMLFORM;eltName| (|pos| |mathML| $)
  (PROG (|name| |u| |i|)
    (RETURN
     (SEQ (LETT |i| (+ |pos| 1) . #1=(|MMLFORM;eltName|))
          (SEQ G190
               (COND
                ((NULL
                  (SPADCALL (SPADCALL |mathML| |i| (QREFELT $ 37))
                            (|spadConstant| $ 39) (QREFELT $ 41)))
                 (GO G191)))
               (SEQ (EXIT (LETT |i| (+ |i| 1) . #1#))) NIL (GO G190) G191
               (EXIT NIL))
          (LETT |u| (SPADCALL (+ |pos| 1) (- |i| 1) (QREFELT $ 34)) . #1#)
          (EXIT (LETT |name| (SPADCALL |mathML| |u| (QREFELT $ 35)) . #1#)))))) 

(DEFUN |MMLFORM;eltLimit| (|name| |pos| |mathML| $)
  (PROG (|pI| |level| |endI| |startI| |endS| |startS|)
    (RETURN
     (SEQ (LETT |pI| |pos| . #1=(|MMLFORM;eltLimit|))
          (LETT |startS| (SPADCALL (LIST "<" |name|) (QREFELT $ 30)) . #1#)
          (LETT |endS| (SPADCALL (LIST "</" |name| ">") (QREFELT $ 30)) . #1#)
          (LETT |level| 1 . #1#)
          (SEQ G190 (COND ((NULL (< 0 |level|)) (GO G191)))
               (SEQ
                (LETT |startI| (SPADCALL |startS| |mathML| |pI| (QREFELT $ 42))
                      . #1#)
                (LETT |endI| (SPADCALL |endS| |mathML| |pI| (QREFELT $ 42))
                      . #1#)
                (EXIT
                 (COND
                  ((OR (EQL |startI| 0) (NULL (< |startI| |endI|)))
                   (SEQ (LETT |level| (- |level| 1) . #1#)
                        (EXIT
                         (LETT |pI| (|MMLFORM;tagEnd| |name| |endI| |mathML| $)
                               . #1#))))
                  ('T
                   (SEQ (LETT |level| (+ |level| 1) . #1#)
                        (EXIT
                         (LETT |pI|
                               (|MMLFORM;tagEnd| |name| |startI| |mathML| $)
                               . #1#)))))))
               NIL (GO G190) G191 (EXIT NIL))
          (EXIT |pI|))))) 

(DEFUN |MMLFORM;tagEnd| (|name| |pos| |mathML| $)
  (PROG (|u| |pI|)
    (RETURN
     (SEQ (LETT |pI| |pos| . #1=(|MMLFORM;tagEnd|))
          (SEQ G190
               (COND
                ((NULL
                  (COND
                   ((SPADCALL (SPADCALL |mathML| |pI| (QREFELT $ 37))
                              (SPADCALL ">" (QREFELT $ 43)) (QREFELT $ 44))
                    'NIL)
                   ('T 'T)))
                 (GO G191)))
               (SEQ (EXIT (LETT |pI| (+ |pI| 1) . #1#))) NIL (GO G190) G191
               (EXIT NIL))
          (LETT |u| (SPADCALL |pos| |pI| (QREFELT $ 34)) . #1#) (EXIT |pI|))))) 

(DEFUN |MMLFORM;atomize| (|expr| $)
  (PROG (|le| #1=#:G1912 |a| |letmp|)
    (RETURN
     (SEQ (LETT |le| NIL . #2=(|MMLFORM;atomize|))
          (COND
           ((OR (ATOM |expr|) (EQUAL (|MMLFORM;stringify| |expr| $) "NOTHING"))
            (EXIT
             (LETT |le| (APPEND |le| (SPADCALL |expr| (QREFELT $ 46)))
                   . #2#))))
          (LETT |letmp| |expr| . #2#)
          (SEQ (LETT |a| NIL . #2#) (LETT #1# |letmp| . #2#) G190
               (COND
                ((OR (ATOM #1#) (PROGN (LETT |a| (CAR #1#) . #2#) NIL))
                 (GO G191)))
               (SEQ
                (EXIT
                 (LETT |le| (APPEND |le| (|MMLFORM;atomize| |a| $)) . #2#)))
               (LETT #1# (CDR #1#) . #2#) (GO G190) G191 (EXIT NIL))
          (EXIT |le|))))) 

(DEFUN |MMLFORM;ungroup| (|str| $)
  (PROG (|u| |u2| |u1| |rrow| |lrow| |len|)
    (RETURN
     (SEQ (LETT |len| (QCSIZE |str|) . #1=(|MMLFORM;ungroup|))
          (EXIT
           (COND ((< |len| 14) |str|)
                 ('T
                  (SEQ (LETT |lrow| "<mrow>" . #1#)
                       (LETT |rrow| "</mrow>" . #1#)
                       (LETT |u1| (SPADCALL 1 6 (QREFELT $ 34)) . #1#)
                       (LETT |u2| (SPADCALL (- |len| 6) |len| (QREFELT $ 34))
                             . #1#)
                       (COND
                        ((EQUAL (SPADCALL |str| |u1| (QREFELT $ 35)) |lrow|)
                         (COND
                          ((EQUAL (SPADCALL |str| |u2| (QREFELT $ 35)) |rrow|)
                           (SEQ
                            (LETT |u| (SPADCALL 7 (- |len| 7) (QREFELT $ 34))
                                  . #1#)
                            (EXIT
                             (LETT |str| (SPADCALL |str| |u| (QREFELT $ 35))
                                   . #1#)))))))
                       (EXIT |str|))))))))) 

(DEFUN |MMLFORM;postcondition| (|str| $)
  (PROG (|uend| |ustart| |pos| |plusminus| |len|)
    (RETURN
     (SEQ (LETT |len| (QCSIZE |str|) . #1=(|MMLFORM;postcondition|))
          (LETT |plusminus| "<mo>+</mo><mo>-</mo>" . #1#)
          (LETT |pos| (SPADCALL |plusminus| |str| 1 (QREFELT $ 42)) . #1#)
          (COND
           ((< 0 |pos|)
            (SEQ (LETT |ustart| (SPADCALL 1 (- |pos| 1) (QREFELT $ 34)) . #1#)
                 (LETT |uend| (SPADCALL (+ |pos| 20) |len| (QREFELT $ 34))
                       . #1#)
                 (LETT |str|
                       (SPADCALL
                        (LIST (SPADCALL |str| |ustart| (QREFELT $ 35))
                              "<mo>-</mo>"
                              (SPADCALL |str| |uend| (QREFELT $ 35)))
                        (QREFELT $ 30))
                       . #1#)
                 (EXIT
                  (COND
                   ((< |pos| (- |len| 18))
                    (LETT |str| (|MMLFORM;postcondition| |str| $) . #1#)))))))
          (EXIT |str|))))) 

(PUT '|MMLFORM;stringify| '|SPADreplace| '|mathObject2String|) 

(DEFUN |MMLFORM;stringify| (|expr| $) (|mathObject2String| |expr|)) 

(DEFUN |MMLFORM;optionalWrap| (|expr| $)
  (PROG (|tmp|)
    (RETURN
     (SEQ
      (LETT |tmp| (|MMLFORM;formatExpr| |expr| (QREFELT $ 8) $)
            |MMLFORM;optionalWrap|)
      (COND ((OR (EQUAL |tmp| "") (EQUAL |tmp| " ")) (EXIT "<none/>")))
      (EXIT (SPADCALL (LIST "<mrow>" |tmp| "</mrow>") (QREFELT $ 30))))))) 

(DEFUN |MMLFORM;group| (|str| $)
  (SPADCALL (LIST "<mrow>" |str| "</mrow>") (QREFELT $ 30))) 

(DEFUN |MMLFORM;addBraces| (|str| $)
  (SPADCALL (LIST "<mo>{</mo>" |str| "<mo>}</mo>") (QREFELT $ 30))) 

(DEFUN |MMLFORM;addBrackets| (|str| $)
  (SPADCALL (LIST "<mo>[</mo>" |str| "<mo>]</mo>") (QREFELT $ 30))) 

(DEFUN |MMLFORM;parenthesize| (|str| $)
  (SPADCALL (LIST "<mo>(</mo>" |str| "<mo>)</mo>") (QREFELT $ 30))) 

(PUT '|MMLFORM;precondition| '|SPADreplace| '|outputTran|) 

(DEFUN |MMLFORM;precondition| (|expr| $) (|outputTran| |expr|)) 

(DEFUN |MMLFORM;formatSpecial| (|op| |args| |prec| $)
  (PROG (|tmp| |base| |tmp3| |tmp2| |tmp1| |n| #1=#:G1983 |u| #2=#:G1982
         |prescript|)
    (RETURN
     (SEQ (LETT |prescript| 'NIL . #3=(|MMLFORM;formatSpecial|))
          (EXIT
           (COND ((EQUAL |op| '|theMap|) "<mtext>theMap(...)</mtext>")
                 ((EQUAL |op| 'AGGLST)
                  (|MMLFORM;formatNary| '|,| "" 0 |args| |prec| $))
                 ((EQUAL |op| 'AGGSET)
                  (|MMLFORM;formatNary| '|;| "" 0 |args| |prec| $))
                 ((EQUAL |op| 'TAG)
                  (|MMLFORM;group|
                   (SPADCALL
                    (LIST (|MMLFORM;formatExpr| (|SPADfirst| |args|) |prec| $)
                          "<mo>&#x02192;</mo>"
                          (|MMLFORM;formatExpr|
                           (SPADCALL |args| (QREFELT $ 47)) |prec| $))
                    (QREFELT $ 30))
                   $))
                 ((EQUAL |op| 'SLASH)
                  (|MMLFORM;group|
                   (SPADCALL
                    (LIST (|MMLFORM;formatExpr| (|SPADfirst| |args|) |prec| $)
                          "<mo>/</mo>"
                          (|MMLFORM;formatExpr|
                           (SPADCALL |args| (QREFELT $ 47)) |prec| $))
                    (QREFELT $ 30))
                   $))
                 ((EQUAL |op| 'VCONCAT)
                  (|MMLFORM;group|
                   (SPADCALL
                    (LIST "<mtable><mtr>"
                          (SPADCALL
                           (PROGN
                            (LETT #2# NIL . #3#)
                            (SEQ (LETT |u| NIL . #3#) (LETT #1# |args| . #3#)
                                 G190
                                 (COND
                                  ((OR (ATOM #1#)
                                       (PROGN (LETT |u| (CAR #1#) . #3#) NIL))
                                   (GO G191)))
                                 (SEQ
                                  (EXIT
                                   (LETT #2#
                                         (CONS
                                          (SPADCALL
                                           (LIST "<mtd>"
                                                 (|MMLFORM;formatExpr| |u|
                                                  (QREFELT $ 8) $)
                                                 "</mtd>")
                                           (QREFELT $ 30))
                                          #2#)
                                         . #3#)))
                                 (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                                 (EXIT (NREVERSE0 #2#))))
                           (QREFELT $ 30))
                          "</mtr></mtable>")
                    (QREFELT $ 30))
                   $))
                 ((EQUAL |op| 'CONCATB)
                  (|MMLFORM;formatNary| 'STRSEP " " 0 |args| (QREFELT $ 8) $))
                 ((EQUAL |op| 'CONCAT)
                  (|MMLFORM;formatNary| 'STRSEP "" 0 |args| (QREFELT $ 8) $))
                 ((EQUAL |op| 'QUOTE)
                  (|MMLFORM;group|
                   (STRCONC "<mo>'</mo>"
                            (|MMLFORM;formatExpr| (|SPADfirst| |args|)
                             (QREFELT $ 8) $))
                   $))
                 ((EQUAL |op| 'BRACKET)
                  (|MMLFORM;group|
                   (|MMLFORM;addBrackets|
                    (|MMLFORM;ungroup|
                     (|MMLFORM;formatExpr| (|SPADfirst| |args|) (QREFELT $ 8)
                      $)
                     $)
                    $)
                   $))
                 ((EQUAL |op| 'BRACE)
                  (|MMLFORM;group|
                   (|MMLFORM;addBraces|
                    (|MMLFORM;ungroup|
                     (|MMLFORM;formatExpr| (|SPADfirst| |args|) (QREFELT $ 8)
                      $)
                     $)
                    $)
                   $))
                 ((EQUAL |op| 'PAREN)
                  (|MMLFORM;group|
                   (|MMLFORM;parenthesize|
                    (|MMLFORM;ungroup|
                     (|MMLFORM;formatExpr| (|SPADfirst| |args|) (QREFELT $ 8)
                      $)
                     $)
                    $)
                   $))
                 ((EQUAL |op| 'PRIME) (|MMLFORM;formatPrime| |args| |prec| $))
                 ((EQUAL |op| 'OVERBAR)
                  (COND ((NULL |args|) "")
                        (#4='T
                         (|MMLFORM;group|
                          (SPADCALL
                           (LIST "<mover accent='true'><mrow>"
                                 (|MMLFORM;formatExpr| (|SPADfirst| |args|)
                                  (QREFELT $ 8) $)
                                 "</mrow><mo stretchy='true'>&#x000AF;</mo></mover>")
                           (QREFELT $ 30))
                          $))))
                 ((EQUAL |op| 'ROOT)
                  (COND ((NULL |args|) "")
                        (#4#
                         (SEQ
                          (LETT |tmp|
                                (|MMLFORM;group|
                                 (|MMLFORM;formatExpr| (|SPADfirst| |args|)
                                  (QREFELT $ 8) $)
                                 $)
                                . #3#)
                          (EXIT
                           (COND
                            ((NULL (CDR |args|))
                             (SPADCALL (LIST "<msqrt>" |tmp| "</msqrt>")
                                       (QREFELT $ 30)))
                            (#4#
                             (|MMLFORM;group|
                              (SPADCALL
                               (LIST "<mroot><mrow>" |tmp| "</mrow>"
                                     (|MMLFORM;formatExpr|
                                      (|SPADfirst| (CDR |args|)) (QREFELT $ 8)
                                      $)
                                     "</mroot>")
                               (QREFELT $ 30))
                              $))))))))
                 ((EQUAL |op| 'SEGMENT)
                  (SEQ
                   (LETT |tmp|
                         (SPADCALL
                          (LIST
                           (|MMLFORM;formatExpr| (|SPADfirst| |args|)
                            (QREFELT $ 8) $)
                           "<mo>..</mo>")
                          (QREFELT $ 30))
                         . #3#)
                   (EXIT
                    (|MMLFORM;group|
                     (COND ((NULL (CDR |args|)) |tmp|)
                           (#4#
                            (SPADCALL
                             (LIST |tmp|
                                   (|MMLFORM;formatExpr|
                                    (|SPADfirst| (CDR |args|)) (QREFELT $ 8)
                                    $))
                             (QREFELT $ 30))))
                     $))))
                 ((EQUAL |op| 'SUB)
                  (|MMLFORM;group|
                   (SPADCALL
                    (LIST "<msub>"
                          (|MMLFORM;formatExpr| (|SPADfirst| |args|)
                           (QREFELT $ 8) $)
                          (|MMLFORM;formatSpecial| 'AGGLST (CDR |args|)
                           (QREFELT $ 8) $)
                          "</msub>")
                    (QREFELT $ 30))
                   $))
                 ((EQUAL |op| 'SUPERSUB)
                  (SEQ
                   (LETT |base|
                         (SPADCALL
                          (LIST "<mrow>"
                                (|MMLFORM;formatExpr| (|SPADfirst| |args|)
                                 (QREFELT $ 8) $)
                                "</mrow>")
                          (QREFELT $ 30))
                         . #3#)
                   (LETT |args| (CDR |args|) . #3#)
                   (LETT |n| (LENGTH |args|) . #3#)
                   (EXIT
                    (COND
                     ((< 4 |n|)
                      (|error| "multiscript object has more than 4 scripts"))
                     (#4#
                      (SEQ
                       (LETT |tmp1|
                             (|MMLFORM;optionalWrap|
                              (SPADCALL |args| 1 (QREFELT $ 48)) $)
                             . #3#)
                       (EXIT
                        (COND
                         ((EQL |n| 1)
                          (SPADCALL (LIST "<msub>" |base| |tmp1| "</msub>")
                                    (QREFELT $ 30)))
                         (#4#
                          (SEQ
                           (LETT |tmp2|
                                 (|MMLFORM;optionalWrap|
                                  (SPADCALL |args| 2 (QREFELT $ 48)) $)
                                 . #3#)
                           (EXIT
                            (COND
                             ((EQL |n| 2)
                              (SPADCALL
                               (LIST "<msubsup>" |base| |tmp1| |tmp2|
                                     "</msubsup>")
                               (QREFELT $ 30)))
                             (#4#
                              (SEQ
                               (LETT |tmp3|
                                     (|MMLFORM;optionalWrap|
                                      (SPADCALL |args| 3 (QREFELT $ 48)) $)
                                     . #3#)
                               (LETT |base|
                                     (SPADCALL
                                      (LIST "<mmultiscripts>" |base| |tmp1|
                                            |tmp2| "<mprescripts/>" |tmp3|)
                                      (QREFELT $ 30))
                                     . #3#)
                               (EXIT
                                (COND
                                 ((EQL |n| 3)
                                  (SPADCALL
                                   (LIST |base| "<none/></mmultiscripts>")
                                   (QREFELT $ 30)))
                                 (#4#
                                  (SPADCALL
                                   (LIST |base|
                                         (|MMLFORM;optionalWrap|
                                          (SPADCALL |args| 4 (QREFELT $ 48)) $)
                                         "</mmultiscripts>")
                                   (QREFELT $ 30)))))))))))))))))))
                 ((EQUAL |op| 'SC)
                  (COND ((NULL |args|) "")
                        (#4#
                         (SEQ
                          (LETT |tmp|
                                (|MMLFORM;formatNaryNoGroup| 'STRSEP
                                 "</mtd></mtr><mtr><mtd>" 800 |args|
                                 (QREFELT $ 8) $)
                                . #3#)
                          (EXIT
                           (|MMLFORM;group|
                            (SPADCALL
                             (LIST "<mtable><mtr><mtd>" |tmp|
                                   "</mtd></mtr></mtable>")
                             (QREFELT $ 30))
                            $))))))
                 ((EQUAL |op| 'MATRIX) (|MMLFORM;formatMatrix| (CDR |args|) $))
                 ((EQUAL |op| 'BOX)
                  (COND ((NULL |args|) "")
                        (#4#
                         (SEQ
                          (LETT |tmp|
                                (|MMLFORM;formatNaryNoGroup| 'STRSEP "" 0
                                 |args| (QREFELT $ 8) $)
                                . #3#)
                          (EXIT
                           (|MMLFORM;group|
                            (SPADCALL
                             (LIST "<mtable frame=\"solid\"><mtr><mtd>" |tmp|
                                   "</mtd></mtr></mtable>")
                             (QREFELT $ 30))
                            $))))))
                 ((EQUAL |op| 'EQUATNUM)
                  (SPADCALL
                   (LIST "<mtable><mtr><mtd>"
                         (|MMLFORM;formatExpr|
                          (SPADCALL |args| 1 (QREFELT $ 48)) (QREFELT $ 8) $)
                         "</mtd><mtd style=\"padding-left: 50px;\">"
                         (|MMLFORM;formatExpr|
                          (SPADCALL |args| 2 (QREFELT $ 48)) (QREFELT $ 8) $)
                         "</mtd></mtr></mtable>")
                   (QREFELT $ 30)))
                 ((EQUAL |op| 'BINOMIAL)
                  (SPADCALL
                   (LIST "<mrow><mo stretchy=\"true\">(</mo>"
                         "<mfrac linethickness=\"0\">"
                         (|MMLFORM;formatExpr|
                          (SPADCALL |args| 1 (QREFELT $ 48)) (QREFELT $ 8) $)
                         (|MMLFORM;formatExpr|
                          (SPADCALL |args| 2 (QREFELT $ 48)) (QREFELT $ 8) $)
                         "</mfrac><mo>)</mo></mrow>")
                   (QREFELT $ 30)))
                 ((EQUAL |op| 'NOTHING) "<none/>")
                 ((EQUAL |op| 'ZAG)
                  (SPADCALL
                   (LIST
                    "<mtable><mtr><mtd style=\"border-right: solid 1px black;"
                    " border-bottom: solid 1px black; padding-right: 2px;"
                    " padding-left: 2px;\">"
                    (|MMLFORM;formatExpr| (|SPADfirst| |args|) (QREFELT $ 8) $)
                    "</mtd></mtr><mtr><mtd style=\"border-left: solid 1px black;"
                    " padding-left: 2px; padding-right: 2px;\">"
                    (|MMLFORM;formatExpr| (|SPADfirst| (CDR |args|))
                     (QREFELT $ 8) $)
                    "</mtd></mtr></mtable>")
                   (QREFELT $ 30)))
                 (#4#
                  (SPADCALL
                   (LIST "<mtext>not done yet for: "
                         (SPADCALL |op| (QREFELT $ 50)) "</mtext>")
                   (QREFELT $ 30))))))))) 

(DEFUN |MMLFORM;formatPrime| (|args| |prec| $)
  (PROG (|arg2| |s| |commaTest| #1=#:G1991 |i| |commaS|)
    (RETURN
     (SEQ
      (LETT |arg2| (SPADCALL |args| (QREFELT $ 47))
            . #2=(|MMLFORM;formatPrime|))
      (COND
       ((STRINGP |arg2|)
        (SEQ (LETT |commaS| |arg2| . #2#) (LETT |commaTest| "," . #2#)
             (EXIT
              (COND
               ((< 0 (SPADCALL |commaTest| |commaS| 1 (QREFELT $ 42)))
                (SEQ (LETT |s| "<mo>&#x02032;</mo>" . #2#)
                     (SEQ (LETT |i| 2 . #2#) (LETT #1# (QCSIZE |commaS|) . #2#)
                          G190 (COND ((QSGREATERP |i| #1#) (GO G191)))
                          (SEQ
                           (LETT |commaTest|
                                 (SPADCALL |commaTest| "," (QREFELT $ 51))
                                 . #2#)
                           (EXIT
                            (LETT |s|
                                  (SPADCALL |s| "<mo>&#x02032;</mo>"
                                            (QREFELT $ 51))
                                  . #2#)))
                          (LETT |i| (QSADD1 |i|) . #2#) (GO G190) G191
                          (EXIT NIL))
                     (EXIT
                      (COND
                       ((EQUAL |commaS| |commaTest|)
                        (LETT |arg2| (SPADCALL |s| (QREFELT $ 52))
                              . #2#)))))))))))
      (EXIT
       (|MMLFORM;formatSpecial| 'SUPERSUB
        (LIST (|SPADfirst| |args|) " " |arg2|) |prec| $)))))) 

(DEFUN |MMLFORM;formatPlex| (|op| |args| |prec| $)
  (PROG (|s| |t1| |t2| |body| |ops| |n| |opPrec| |p|)
    (RETURN
     (SEQ
      (LETT |p| (SPADCALL |op| (QREFELT $ 16) (QREFELT $ 54))
            . #1=(|MMLFORM;formatPlex|))
      (EXIT
       (COND ((< |p| 1) (|error| "unknown plex op"))
             (#2='T
              (SEQ
               (LETT |opPrec| (SPADCALL (QREFELT $ 17) |p| (QREFELT $ 56))
                     . #1#)
               (LETT |n| (LENGTH |args|) . #1#)
               (COND
                ((NULL (EQL |n| 2))
                 (COND
                  ((NULL (EQL |n| 3))
                   (EXIT (|error| "wrong number of arguments for plex"))))))
               (LETT |ops|
                     (COND
                      ((EQUAL |op| 'SIGMA)
                       (COND ((EQL |n| 2) "&Sum;")
                             (#2#
                              (|error| "wrong number of arguments for plex"))))
                      ((EQUAL |op| 'SIGMA2)
                       (COND ((EQL |n| 3) "&Sum;")
                             (#2#
                              (|error| "wrong number of arguments for plex"))))
                      ((EQUAL |op| 'PI)
                       (COND ((EQL |n| 2) "&Pi;")
                             (#2#
                              (|error| "wrong number of arguments for plex"))))
                      ((EQUAL |op| 'PI2)
                       (COND ((EQL |n| 3) "&Pi;")
                             (#2#
                              (|error| "wrong number of arguments for plex"))))
                      ((EQUAL |op| 'INTSIGN)
                       (COND ((EQL |n| 3) "&int;")
                             (#2#
                              (|error| "wrong number of arguments for plex"))))
                      ((EQUAL |op| 'INDEFINTEGRAL)
                       (|error| "INDEFINTEGRAL not handled"))
                      (#2#
                       (|error|
                        (SPADCALL
                         (SPADCALL "Unexpected plex op:"
                                   (SPADCALL |op| (QREFELT $ 50))
                                   (QREFELT $ 51))
                         (QREFELT $ 57)))))
                     . #1#)
               (LETT |body|
                     (COND
                      ((EQUAL |op| 'INTSIGN)
                       (|MMLFORM;formatExpr| (SPADCALL |args| 3 (QREFELT $ 48))
                        (QREFELT $ 8) $))
                      (#2#
                       (|MMLFORM;formatExpr|
                        (SPADCALL |args| |n| (QREFELT $ 48)) |opPrec| $)))
                     . #1#)
               (LETT |t2|
                     (COND
                      ((EQL |n| 3)
                       (|MMLFORM;formatExpr| (SPADCALL |args| 2 (QREFELT $ 48))
                        (QREFELT $ 8) $))
                      (#2# "<none/>"))
                     . #1#)
               (LETT |t1|
                     (|MMLFORM;formatExpr| (SPADCALL |args| 1 (QREFELT $ 48))
                      (QREFELT $ 8) $)
                     . #1#)
               (LETT |s|
                     (SPADCALL
                      (LIST "<munderover><mo>" |ops| "</mo>" |t1| |t2|
                            "</munderover>" |body|)
                      (QREFELT $ 30))
                     . #1#)
               (COND
                ((< |opPrec| |prec|)
                 (LETT |s| (|MMLFORM;parenthesize| |s| $) . #1#)))
               (EXIT (|MMLFORM;group| |s| $)))))))))) 

(DEFUN |MMLFORM;formatMatrix| (|args| $)
  (|MMLFORM;group|
   (|MMLFORM;addBrackets|
    (SPADCALL
     (LIST "<mtable><mtr><mtd>"
           (|MMLFORM;formatNaryNoGroup| 'STRSEP "</mtd></mtr><mtr><mtd>" 0
            |args| (QREFELT $ 8) $)
           "</mtd></mtr></mtable>")
     (QREFELT $ 30))
    $)
   $)) 

(DEFUN |MMLFORM;formatFunction| (|op| |args| |prec| $)
  (PROG (|ops|)
    (RETURN
     (SEQ
      (LETT |ops| (|MMLFORM;formatExpr| |op| (QREFELT $ 8) $)
            |MMLFORM;formatFunction|)
      (EXIT
       (|MMLFORM;group|
        (SPADCALL
         (LIST "<mo>" |ops| "</mo>"
               (|MMLFORM;parenthesize|
                (|MMLFORM;formatNary| '|,| "" 0 |args| (QREFELT $ 8) $) $))
         (QREFELT $ 30))
        $)))))) 

(DEFUN |MMLFORM;formatNullary| (|op| $)
  (COND ((EQUAL |op| 'NOTHING) "")
        ('T
         (|MMLFORM;group|
          (SPADCALL
           (LIST "<mo>" (SPADCALL |op| (QREFELT $ 50))
                 "</mo><mo>(</mo><mo>)</mo>")
           (QREFELT $ 30))
          $)))) 

(DEFUN |MMLFORM;formatUnary| (|op| |arg| |prec| $)
  (PROG (|s| |opPrec| |p|)
    (RETURN
     (SEQ
      (LETT |p| (SPADCALL |op| (QREFELT $ 9) (QREFELT $ 54))
            . #1=(|MMLFORM;formatUnary|))
      (EXIT
       (COND ((< |p| 1) (|error| "unknown unary op"))
             (#2='T
              (SEQ
               (LETT |opPrec| (SPADCALL (QREFELT $ 10) |p| (QREFELT $ 56))
                     . #1#)
               (LETT |s|
                     (SPADCALL
                      (LIST "<mo>" (SPADCALL |op| (QREFELT $ 50)) "</mo>"
                            (|MMLFORM;formatExpr| |arg| |opPrec| $))
                      (QREFELT $ 30))
                     . #1#)
               (EXIT
                (COND
                 ((< |opPrec| |prec|)
                  (|MMLFORM;group| (|MMLFORM;parenthesize| |s| $) $))
                 ((EQUAL |op| '-) |s|) (#2# (|MMLFORM;group| |s| $)))))))))))) 

(DEFUN |MMLFORM;formatBinary| (|op| |args| |prec| $)
  (PROG (|s| |ops| |s2| |s1| |opPrec| |p|)
    (RETURN
     (SEQ
      (LETT |p| (SPADCALL |op| (QREFELT $ 11) (QREFELT $ 54))
            . #1=(|MMLFORM;formatBinary|))
      (EXIT
       (COND ((< |p| 1) (|error| "unknown binary op"))
             (#2='T
              (SEQ
               (LETT |opPrec| (SPADCALL (QREFELT $ 12) |p| (QREFELT $ 56))
                     . #1#)
               (LETT |s1|
                     (|MMLFORM;formatExpr| (|SPADfirst| |args|) |opPrec| $)
                     . #1#)
               (LETT |s2|
                     (|MMLFORM;formatExpr| (|SPADfirst| (CDR |args|)) |opPrec|
                      $)
                     . #1#)
               (LETT |s|
                     (COND
                      ((EQUAL |op| '^)
                       (SPADCALL
                        (LIST "<msup><mrow>" |s1| "</mrow><mrow>" |s2|
                              "</mrow></msup>")
                        (QREFELT $ 30)))
                      ((EQUAL |op| '/)
                       (SPADCALL
                        (LIST "<mfrac><mrow>" |s1| "</mrow><mrow>" |s2|
                              "</mrow></mfrac>")
                        (QREFELT $ 30)))
                      (#2#
                       (COND
                        ((EQUAL |op| 'OVER)
                         (SPADCALL
                          (LIST "<mfrac><mrow>" |s1| "</mrow><mrow>" |s2|
                                "</mrow></mfrac>")
                          (QREFELT $ 30)))
                        (#2#
                         (SEQ
                          (LETT |ops|
                                (COND ((EQUAL |op| 'LET) ":=")
                                      ((EQUAL |op| '<) "&lt;")
                                      ((EQUAL |op| '<=) "&lt;=")
                                      (#2# (SPADCALL |op| (QREFELT $ 50))))
                                . #1#)
                          (EXIT
                           (SPADCALL
                            (LIST "<mrow>" |s1| "</mrow><mo>" |ops|
                                  "</mo><mrow>" |s2| "</mrow>")
                            (QREFELT $ 30))))))))
                     . #1#)
               (EXIT
                (|MMLFORM;group|
                 (COND
                  ((OR (OR (EQUAL |op| '/) (EQUAL |op| 'OVER))
                       (NULL (< |opPrec| |prec|)))
                   |s|)
                  ('T (|MMLFORM;parenthesize| |s| $)))
                 $)))))))))) 

(DEFUN |MMLFORM;formatNary| (|op| |sep| |opprec| |args| |prec| $)
  (|MMLFORM;group|
   (|MMLFORM;formatNaryNoGroup| |op| |sep| |opprec| |args| |prec| $) $)) 

(DEFUN |MMLFORM;formatNaryNoGroup| (|op| |sep| |opprec| |args| |prec| $)
  (PROG (|s| |l| #1=#:G2027 |a| |opPrec| |ops| |p|)
    (RETURN
     (SEQ
      (COND ((NULL |args|) "")
            (#2='T
             (SEQ
              (LETT |p| (SPADCALL |op| (QREFELT $ 13) (QREFELT $ 54))
                    . #3=(|MMLFORM;formatNaryNoGroup|))
              (EXIT
               (COND ((< |p| 1) (|error| "unknown nary op"))
                     (#2#
                      (SEQ
                       (LETT |ops|
                             (COND ((EQUAL |op| 'STRSEP) |sep|)
                                   ((EQUAL |op| '*) "<mo>&#x02062;</mo>")
                                   (#2#
                                    (COND ((EQUAL |op| 'ROW) "</mtd><mtd>")
                                          ((EQUAL |op| 'TENSOR)
                                           "<mo>&#x02297;</mo>")
                                          (#2#
                                           (SPADCALL
                                            (LIST "<mo>"
                                                  (SPADCALL |op|
                                                            (QREFELT $ 50))
                                                  "</mo>")
                                            (QREFELT $ 30))))))
                             . #3#)
                       (LETT |l| NIL . #3#)
                       (LETT |opPrec|
                             (COND ((EQUAL |op| 'STRSEP) |opprec|)
                                   (#2#
                                    (SPADCALL (QREFELT $ 14) |p|
                                              (QREFELT $ 56))))
                             . #3#)
                       (SEQ (LETT |a| NIL . #3#) (LETT #1# |args| . #3#) G190
                            (COND
                             ((OR (ATOM #1#)
                                  (PROGN (LETT |a| (CAR #1#) . #3#) NIL))
                              (GO G191)))
                            (SEQ
                             (EXIT
                              (LETT |l|
                                    (CONS |ops|
                                          (CONS
                                           (|MMLFORM;formatExpr| |a| |opPrec|
                                            $)
                                           |l|))
                                    . #3#)))
                            (LETT #1# (CDR #1#) . #3#) (GO G190) G191
                            (EXIT NIL))
                       (LETT |s| (SPADCALL (REVERSE (CDR |l|)) (QREFELT $ 30))
                             . #3#)
                       (EXIT
                        (COND
                         ((< |opPrec| |prec|) (|MMLFORM;parenthesize| |s| $))
                         (#2# |s|)))))))))))))) 

(DEFUN |MMLFORM;formatExpr| (|expr| |prec| $)
  (PROG (|op| |nargs| |args| |opf| |l| |i| |nstr| |str| |len| |intSplitLen|)
    (RETURN
     (SEQ (LETT |intSplitLen| 20 . #1=(|MMLFORM;formatExpr|))
          (EXIT
           (COND
            ((ATOM |expr|)
             (SEQ (LETT |str| (|MMLFORM;stringify| |expr| $) . #1#)
                  (LETT |len| (QCSIZE |str|) . #1#)
                  (EXIT
                   (COND
                    ((FIXP |expr|)
                     (SEQ (LETT |i| |expr| . #1#)
                          (EXIT
                           (COND
                            ((OR (< |i| 0) (< 9 |i|))
                             (|MMLFORM;group|
                              (SEQ (LETT |nstr| "" . #1#)
                                   (SEQ G190
                                        (COND
                                         ((NULL
                                           (< |intSplitLen|
                                              (LETT |len| (QCSIZE |str|)
                                                    . #1#)))
                                          (GO G191)))
                                        (SEQ
                                         (LETT |nstr|
                                               (SPADCALL
                                                (LIST |nstr| " "
                                                      (SPADCALL |str|
                                                                (SPADCALL 1
                                                                          |intSplitLen|
                                                                          (QREFELT
                                                                           $
                                                                           34))
                                                                (QREFELT $
                                                                         35)))
                                                (QREFELT $ 30))
                                               . #1#)
                                         (EXIT
                                          (LETT |str|
                                                (SPADCALL |str|
                                                          (SPADCALL
                                                           (+ |intSplitLen| 1)
                                                           (QREFELT $ 58))
                                                          (QREFELT $ 35))
                                                . #1#)))
                                        NIL (GO G190) G191 (EXIT NIL))
                                   (EXIT
                                    (COND
                                     ((SPADCALL |nstr| (QREFELT $ 59))
                                      (SPADCALL (LIST "<mn>" |str| "</mn>")
                                                (QREFELT $ 30)))
                                     (#2='T
                                      (SEQ
                                       (LETT |nstr|
                                             (COND
                                              ((SPADCALL |str| (QREFELT $ 59))
                                               |nstr|)
                                              (#2#
                                               (SPADCALL
                                                (LIST |nstr| " " |str|)
                                                (QREFELT $ 30))))
                                             . #1#)
                                       (EXIT
                                        (SPADCALL
                                         (LIST "<mn>"
                                               (SPADCALL |nstr|
                                                         (SPADCALL 2
                                                                   (QREFELT $
                                                                            58))
                                                         (QREFELT $ 35))
                                               "</mn>")
                                         (QREFELT $ 30))))))))
                              $))
                            ('T
                             (SPADCALL (LIST "<mn>" |str| "</mn>")
                                       (QREFELT $ 30)))))))
                    ((EQUAL |str| "%pi") "<mi>&#x003C0;</mi>")
                    ((EQUAL |str| "%e") "<mi>&#x02147;</mi>")
                    ((EQUAL |str| "%i") "<mi>&#x02148;</mi>")
                    (#2#
                     (SEQ
                      (COND
                       ((< 0 |len|)
                        (COND
                         ((SPADCALL (SPADCALL |str| 1 (QREFELT $ 37))
                                    (SPADCALL "%" (QREFELT $ 43))
                                    (QREFELT $ 44))
                          (EXIT
                           (SPADCALL (LIST "<mi>" |str| "</mi>")
                                     (QREFELT $ 30)))))))
                      (COND
                       ((< 1 |len|)
                        (COND
                         ((SPADCALL (SPADCALL |str| 1 (QREFELT $ 37))
                                    (QREFELT $ 60))
                          (EXIT
                           (SPADCALL (LIST "<mn>" |str| "</mn>")
                                     (QREFELT $ 30)))))))
                      (COND
                       ((< 0 |len|)
                        (COND
                         ((SPADCALL (SPADCALL |str| 1 (QREFELT $ 37))
                                    (SPADCALL "\"" (QREFELT $ 43))
                                    (QREFELT $ 44))
                          (EXIT
                           (SPADCALL (LIST "<mtext>" |str| "</mtext>")
                                     (QREFELT $ 30)))))))
                      (COND
                       ((EQL |len| 1)
                        (COND
                         ((SPADCALL (SPADCALL |str| 1 (QREFELT $ 37))
                                    (SPADCALL " " (QREFELT $ 43))
                                    (QREFELT $ 44))
                          (EXIT " ")))))
                      (COND
                       ((SYMBOLP |expr|)
                        (SEQ (LETT |op| |expr| . #1#)
                             (LETT |i|
                                   (SPADCALL |op| (QREFELT $ 19)
                                             (QREFELT $ 54))
                                   . #1#)
                             (EXIT
                              (COND
                               ((< 0 |i|)
                                (SPADCALL (QREFELT $ 20) |i|
                                          (QREFELT $ 62))))))))
                      (LETT |i|
                            (SPADCALL (SPADCALL " " (QREFELT $ 43)) |str|
                                      (QREFELT $ 63))
                            . #1#)
                      (EXIT
                       (COND
                        ((< 0 |i|)
                         (SPADCALL (LIST "<mtext>" |str| "</mtext>")
                                   (QREFELT $ 30)))
                        (#2#
                         (SPADCALL (LIST "<mi>" |str| "</mi>")
                                   (QREFELT $ 30)))))))))))
            (#2#
             (SEQ (LETT |l| |expr| . #1#)
                  (EXIT
                   (COND ((NULL |l|) (QREFELT $ 6))
                         (#2#
                          (SEQ (LETT |opf| (|SPADfirst| |l|) . #1#)
                               (LETT |args| (CDR |l|) . #1#)
                               (LETT |nargs| (LENGTH |args|) . #1#)
                               (EXIT
                                (COND
                                 ((SYMBOLP |opf|)
                                  (SEQ (LETT |op| |opf| . #1#)
                                       (EXIT
                                        (COND
                                         ((SPADCALL |op| (QREFELT $ 18)
                                                    (QREFELT $ 64))
                                          (|MMLFORM;formatSpecial| |op| |args|
                                           |prec| $))
                                         ((SPADCALL |op| (QREFELT $ 16)
                                                    (QREFELT $ 64))
                                          (|MMLFORM;formatPlex| |op| |args|
                                           |prec| $))
                                         ((EQL 0 |nargs|)
                                          (|MMLFORM;formatNullary| |op| $))
                                         (#2#
                                          (SEQ
                                           (COND
                                            ((EQL 1 |nargs|)
                                             (COND
                                              ((SPADCALL |op| (QREFELT $ 9)
                                                         (QREFELT $ 64))
                                               (EXIT
                                                (|MMLFORM;formatUnary| |op|
                                                 (|SPADfirst| |args|) |prec|
                                                 $))))))
                                           (COND
                                            ((EQL 2 |nargs|)
                                             (COND
                                              ((SPADCALL |op| (QREFELT $ 11)
                                                         (QREFELT $ 64))
                                               (EXIT
                                                (|MMLFORM;formatBinary| |op|
                                                 |args| |prec| $))))))
                                           (EXIT
                                            (COND
                                             ((SPADCALL |op| (QREFELT $ 15)
                                                        (QREFELT $ 64))
                                              (|MMLFORM;formatNaryNoGroup| |op|
                                               "" 0 |args| |prec| $))
                                             ((SPADCALL |op| (QREFELT $ 13)
                                                        (QREFELT $ 64))
                                              (|MMLFORM;formatNary| |op| "" 0
                                               |args| |prec| $))
                                             (#2#
                                              (|MMLFORM;formatFunction|
                                               (|SPADfirst| |l|) |args| |prec|
                                               $))))))))))
                                 (#2#
                                  (|MMLFORM;formatFunction| (|SPADfirst| |l|)
                                   |args| |prec| $)))))))))))))))) 

(DEFUN |MathMLFormat| #1=()
  (PROG #1#
    (RETURN
     (PROG (#2=#:G2059)
       (RETURN
        (COND
         ((LETT #2# (HGET |$ConstructorCache| '|MathMLFormat|)
                . #3=(|MathMLFormat|))
          (|CDRwithIncrement| (CDAR #2#)))
         ('T
          (UNWIND-PROTECT
              (PROG1
                  (CDDAR
                   (HPUT |$ConstructorCache| '|MathMLFormat|
                         (LIST (CONS NIL (CONS 1 (|MathMLFormat;|))))))
                (LETT #2# T . #3#))
            (COND
             ((NOT #2#) (HREM |$ConstructorCache| '|MathMLFormat|))))))))))) 

(DEFUN |MathMLFormat;| ()
  (PROG (|dv$| $ |pv$|)
    (RETURN
     (PROGN
      (LETT |dv$| '(|MathMLFormat|) . #1=(|MathMLFormat|))
      (LETT $ (GETREFV 66) . #1#)
      (QSETREFV $ 0 |dv$|)
      (QSETREFV $ 3 (LETT |pv$| (|buildPredVector| 0 0 NIL) . #1#))
      (|haddProp| |$ConstructorCache| '|MathMLFormat| NIL (CONS 1 $))
      (|stuffDomainSlots| $)
      (SETF |pv$| (QREFELT $ 3))
      (QSETREFV $ 6 " \\  ")
      (QSETREFV $ 7 1000000)
      (QSETREFV $ 8 0)
      (QSETREFV $ 9 '(-))
      (QSETREFV $ 10 '(710))
      (QSETREFV $ 11 '(+-> |\|| ^ / = ~= < <= > >= OVER LET))
      (QSETREFV $ 12 (LIST 0 0 900 700 400 400 400 400 400 400 700 125))
      (QSETREFV $ 13 '(- + * |,| |;| ROW STRSEP TENSOR))
      (QSETREFV $ 14 (LIST 700 700 800 110 110 0 0 850))
      (QSETREFV $ 15 '(ROW))
      (QSETREFV $ 16 '(SIGMA SIGMA2 PI PI2 INTSIGN INDEFINTEGRAL))
      (QSETREFV $ 17 '(750 750 750 750 700 700))
      (QSETREFV $ 18
                '(MATRIX BRACKET BRACE CONCATB VCONCAT AGGLST CONCAT OVERBAR
                  ROOT SUB TAG SUPERSUB ZAG AGGSET SC PAREN SEGMENT QUOTE
                  |theMap| SLASH PRIME BOX EQUATNUM BINOMIAL NOTHING))
      (QSETREFV $ 19
                '(|cos| |cot| |csc| |log| |sec| |sin| |tan| |cosh| |coth|
                  |csch| |sech| |sinh| |tanh| |acos| |asin| |atan| |erf| |...|
                  $ |infinity| |Gamma|))
      (QSETREFV $ 20
                (LIST "<mo>cos</mo>" "<mo>cot</mo>" "<mo>csc</mo>"
                      "<mo>log</mo>" "<mo>sec</mo>" "<mo>sin</mo>"
                      "<mo>tan</mo>" "<mo>cosh</mo>" "<mo>coth</mo>"
                      "<mo>csch</mo>" "<mo>sech</mo>" "<mo>sinh</mo>"
                      "<mo>tanh</mo>" "<mo>arccos</mo>" "<mo>arcsin</mo>"
                      "<mo>arctan</mo>" "<mo>erf</mo>" "<mo>&#x2026;</mo>"
                      "<mo>$</mo>" "<mo>&#x221E;</mo>" "<mo>&#x0413;</mo>"))
      $)))) 

(MAKEPROP '|MathMLFormat| '|infovec|
          (LIST
           '#(NIL NIL NIL NIL NIL NIL '|blank| '|maxPrec| '|minPrec|
              '|unaryOps| '|unaryPrecs| '|binaryOps| '|binaryPrecs| '|naryOps|
              '|naryPrecs| '|naryNGOps| '|plexOps| '|plexPrecs| '|specialOps|
              '|specialStrings| '|specialStringsInMML| (|String|)
              (|OutputForm|) |MMLFORM;coerce;OfS;2| |MMLFORM;coerceS;OfS;4|
              |MMLFORM;coerceL;OfS;5| (|Void|) (0 . |void|)
              |MMLFORM;display;SV;6| (|List| $) (4 . |concat|)
              |MMLFORM;exprex;OfS;7| (|Integer|) (|UniversalSegment| 32)
              (9 . |segment|) (15 . |elt|) (|Character|) (21 . |elt|)
              (|CharacterClass|) (27 . |lowerCase|) (|Boolean|)
              (31 . |member?|) (37 . |position|) (44 . |char|) (49 . =)
              (|List| 22) (55 . |list|) (60 . |second|) (65 . |elt|) (|Symbol|)
              (71 . |string|) (76 . |elt|) (82 . |message|) (|List| 49)
              (87 . |position|) (|List| 32) (93 . |elt|) (99 . |coerce|)
              (104 . |segment|) (109 . |empty?|) (114 . |digit?|) (|List| 21)
              (119 . |elt|) (125 . |position|) (131 . |member?|)
              (|SingleInteger|))
           '#(~= 137 |latex| 143 |hash| 148 |exprex| 153 |display| 158
              |coerceS| 163 |coerceL| 168 |coerce| 173 = 183)
           'NIL
           (CONS (|makeByteWordVec2| 1 '(0 0 0))
                 (CONS '#(|SetCategory&| |BasicType&| NIL)
                       (CONS
                        '#((|SetCategory|) (|BasicType|) (|CoercibleTo| 22))
                        (|makeByteWordVec2| 65
                                            '(0 26 0 27 1 21 0 29 30 2 33 0 32
                                              32 34 2 21 0 0 33 35 2 21 36 0 32
                                              37 0 38 0 39 2 38 40 36 0 41 3 21
                                              32 0 0 32 42 1 36 0 21 43 2 36 40
                                              0 0 44 1 45 0 22 46 1 45 22 0 47
                                              2 45 22 0 32 48 1 49 21 0 50 2 21
                                              0 0 0 51 1 22 0 21 52 2 53 32 49
                                              0 54 2 55 32 0 32 56 1 21 22 0 57
                                              1 33 0 32 58 1 21 40 0 59 1 36 40
                                              0 60 2 61 21 0 32 62 2 21 32 36 0
                                              63 2 53 40 49 0 64 2 0 40 0 0 1 1
                                              0 21 0 1 1 0 65 0 1 1 0 21 22 31
                                              1 0 26 21 28 1 0 21 22 24 1 0 21
                                              22 25 1 0 21 22 23 1 0 22 0 1 2 0
                                              40 0 0 1)))))
           '|lookupComplete|)) 

(MAKEPROP '|MathMLFormat| 'NILADIC T) 
