From 0386c2be2d8b42e84c677896ecfc85c7e5771fb7 Mon Sep 17 00:00:00 2001
From: Maximilian Gruber <maximilian.gruber@ptb.de>
Date: Tue, 2 Jul 2024 09:45:08 +0200
Subject: [PATCH] add mathml relaxng schema files for offline validation

---
 app/report/mathml3/algebra-logic.rnc          |   84 +
 app/report/mathml3/algebra-logic.rng          |  425 +++
 app/report/mathml3/basic-content-elements.rnc |   49 +
 app/report/mathml3/basic-content-elements.rng |  147 +
 app/report/mathml3/calculus_veccalc.rnc       |   49 +
 app/report/mathml3/calculus_veccalc.rng       |  143 +
 app/report/mathml3/constants.rnc              |   54 +
 app/report/mathml3/constants.rng              |  165 +
 app/report/mathml3/errors.rnc                 |   30 +
 app/report/mathml3/errors.rng                 |   57 +
 app/report/mathml3/linear_algebra.rnc         |   44 +
 app/report/mathml3/linear_algebra.rng         |  138 +
 app/report/mathml3/mathml-p.rnc               |    2 +
 app/report/mathml3/mathml3-cds-pragmatic.rnc  |  425 +++
 app/report/mathml3/mathml3-cds-pragmatic.rng  | 2909 +++++++++++++++++
 app/report/mathml3/mathml3-cds.rnc            |   67 +
 app/report/mathml3/mathml3-cds.rng            |  119 +
 app/report/mathml3/mathml3-common.rnc         |   84 +
 app/report/mathml3/mathml3-common.rng         |  257 ++
 app/report/mathml3/mathml3-content.rnc        |  373 +++
 app/report/mathml3/mathml3-content.rng        | 1544 +++++++++
 app/report/mathml3/mathml3-deprecated.rnc     |   44 +
 app/report/mathml3/mathml3-deprecated.rng     |  111 +
 app/report/mathml3/mathml3-pragmatic.rnc      |   96 +
 app/report/mathml3/mathml3-pragmatic.rng      |  290 ++
 app/report/mathml3/mathml3-presentation.rnc   |  543 +++
 app/report/mathml3/mathml3-presentation.rng   | 2324 +++++++++++++
 app/report/mathml3/mathml3-strict-content.rnc |   60 +
 app/report/mathml3/mathml3-strict-content.rng |  205 ++
 app/report/mathml3/mathml3-strict.rnc         |   81 +
 app/report/mathml3/mathml3-strict.rng         |  267 ++
 app/report/mathml3/mathml3.rnc                |   21 +
 app/report/mathml3/mathml3.rng                |   23 +
 app/report/mathml3/ms.rnc                     |   21 +
 app/report/mathml3/relations.rnc              |   43 +
 app/report/mathml3/relations.rng              |  125 +
 app/report/mathml3/sequences_series.rnc       |   31 +
 app/report/mathml3/sequences_series.rng       |   63 +
 app/report/mathml3/sets.rnc                   |   52 +
 app/report/mathml3/sets.rng                   |  168 +
 app/report/mathml3/specfun.rnc                |   79 +
 app/report/mathml3/specfun.rng                |  275 ++
 app/report/mathml3/statistics.rnc             |   39 +
 app/report/mathml3/statistics.rng             |   95 +
 44 files changed, 12221 insertions(+)
 create mode 100644 app/report/mathml3/algebra-logic.rnc
 create mode 100644 app/report/mathml3/algebra-logic.rng
 create mode 100644 app/report/mathml3/basic-content-elements.rnc
 create mode 100644 app/report/mathml3/basic-content-elements.rng
 create mode 100644 app/report/mathml3/calculus_veccalc.rnc
 create mode 100644 app/report/mathml3/calculus_veccalc.rng
 create mode 100644 app/report/mathml3/constants.rnc
 create mode 100644 app/report/mathml3/constants.rng
 create mode 100644 app/report/mathml3/errors.rnc
 create mode 100644 app/report/mathml3/errors.rng
 create mode 100644 app/report/mathml3/linear_algebra.rnc
 create mode 100644 app/report/mathml3/linear_algebra.rng
 create mode 100644 app/report/mathml3/mathml-p.rnc
 create mode 100644 app/report/mathml3/mathml3-cds-pragmatic.rnc
 create mode 100644 app/report/mathml3/mathml3-cds-pragmatic.rng
 create mode 100644 app/report/mathml3/mathml3-cds.rnc
 create mode 100644 app/report/mathml3/mathml3-cds.rng
 create mode 100644 app/report/mathml3/mathml3-common.rnc
 create mode 100644 app/report/mathml3/mathml3-common.rng
 create mode 100644 app/report/mathml3/mathml3-content.rnc
 create mode 100644 app/report/mathml3/mathml3-content.rng
 create mode 100644 app/report/mathml3/mathml3-deprecated.rnc
 create mode 100644 app/report/mathml3/mathml3-deprecated.rng
 create mode 100644 app/report/mathml3/mathml3-pragmatic.rnc
 create mode 100644 app/report/mathml3/mathml3-pragmatic.rng
 create mode 100644 app/report/mathml3/mathml3-presentation.rnc
 create mode 100644 app/report/mathml3/mathml3-presentation.rng
 create mode 100644 app/report/mathml3/mathml3-strict-content.rnc
 create mode 100644 app/report/mathml3/mathml3-strict-content.rng
 create mode 100644 app/report/mathml3/mathml3-strict.rnc
 create mode 100644 app/report/mathml3/mathml3-strict.rng
 create mode 100644 app/report/mathml3/mathml3.rnc
 create mode 100644 app/report/mathml3/mathml3.rng
 create mode 100644 app/report/mathml3/ms.rnc
 create mode 100644 app/report/mathml3/relations.rnc
 create mode 100644 app/report/mathml3/relations.rng
 create mode 100644 app/report/mathml3/sequences_series.rnc
 create mode 100644 app/report/mathml3/sequences_series.rng
 create mode 100644 app/report/mathml3/sets.rnc
 create mode 100644 app/report/mathml3/sets.rng
 create mode 100644 app/report/mathml3/specfun.rnc
 create mode 100644 app/report/mathml3/specfun.rng
 create mode 100644 app/report/mathml3/statistics.rnc
 create mode 100644 app/report/mathml3/statistics.rng

diff --git a/app/report/mathml3/algebra-logic.rnc b/app/report/mathml3/algebra-logic.rnc
new file mode 100644
index 0000000..b79f720
--- /dev/null
+++ b/app/report/mathml3/algebra-logic.rnc
@@ -0,0 +1,84 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2007 World Wide Web Consortium
+#        (Massachusetts Institute of Technology, Institut National de
+#         Recherche en Informatique et en Automatique, Keio University).
+#         All Rights Reserved.
+#
+#     Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+#     and its accompanying documentation for any purpose and without fee is
+#     hereby granted in perpetuity, provided that the above copyright notice
+#     and this paragraph appear in all copies.  The copyright holders make
+#     no representation about the suitability of the Schema for any purpose.
+#
+#     This file contains the arity checking rules for the symbols
+#     from the content dictionary algebra-logic
+#     It is provided "as is" without expressed or implied warranty.
+#
+#     Revision:   $Id: algebra-logic.rnc,v 1.1 2007/12/11 15:38:51 dcarlis Exp $
+
+cd.token.unary.class |= factorial.token | unary_minus.token | not.token | abs.token | conjugate.token | arg.token | real.token | imaginary.token | floor.token | ceiling.token
+cd.token.binary.class |= quotient.token | divide.token | minus.token | power.token | rem.token | root.token | implies.token
+cd.token.nary.class |= max.token | min.token | plus.token | times.token | gcd.token | and.token | or.token | xor.token | lcm.token
+cd.binder.class |= forall.token | exists.token
+
+# the element definitions for the token elements
+quotient.content = Token.type, attribute  type  {MathMLtype}?
+quotient.token = element quotient {quotient.content}
+factorial.content = Token.type
+factorial.token = element factorial {factorial.content}
+divide.content = Token.type, attribute  type  {MathMLtype}?
+divide.token = element divide {divide.content}
+max.content = Token.type, attribute type {MathMLtype}?
+max.token = element max {max.content}
+min.content = Token.type, attribute type {MathMLtype}?
+min.token = element min {min.content}
+minus.content = Token.type, attribute type {MathMLtype}?
+minus.token = element minus {minus.content}
+unary_minus.content = Token.type, attribute type {MathMLtype}?
+unary_minus.token = element minus {unary_minus.content}
+#ednote(rnc:unary_minus) rename minus to unary_minus
+plus.content = Token.type, attribute type {MathMLtype}?
+plus.token = element plus {plus.content}
+power.content = Token.type, attribute type {MathMLtype}?
+power.token = element power {power.content}
+rem.content = Token.type, attribute type {MathMLtype}?
+rem.token = element rem {rem.content}
+times.content = Token.type, attribute type {MathMLtype}?
+times.token = element times {times.content}
+root.content = Token.type, attribute  type  {MathMLtype}?
+root.token = element root {root.content}
+gcd.content = Token.type, attribute type {MathMLtype}?
+gcd.token = element gcd {gcd.content}
+and.content = Token.type, attribute type {MathMLtype}?
+and.token = element and {and.content}
+or.content = Token.type, attribute type {MathMLtype}?
+or.token = element or {or.content}
+xor.content = Token.type, attribute type {MathMLtype}?
+xor.token = element xor {xor.content}
+not.content = Token.type, attribute type {MathMLtype}?
+not.token = element not {not.content}
+implies.content = Token.type, attribute type {MathMLtype}?
+implies.token = element implies {implies.content}
+forall.content = Token.type, attribute type {MathMLtype}?
+forall.token = element forall {forall.content}
+exists.content = Token.type, attribute type {MathMLtype}?
+exists.token = element exists {exists.content}
+abs.content = Token.type, attribute type {MathMLtype}?
+abs.token = element abs {abs.content}
+conjugate.content = Token.type
+conjugate.token = element conjugate {conjugate.content}
+arg.content = Token.type, attribute type {MathMLtype}?
+arg.token = element arg {arg.content}
+real.content = Token.type, attribute type {MathMLtype}?
+real.token = element real {real.content}
+imaginary.content = Token.type, attribute type {MathMLtype}?
+imaginary.token = element imaginary {imaginary.content}
+lcm.content = Token.type, attribute type {MathMLtype}?
+lcm.token = element lcm {lcm.content}
+floor.content = Token.type, attribute type {MathMLtype}?
+floor.token = element floor {floor.content}
+ceiling.content = Token.type, attribute type {MathMLtype}?
+ceiling.token = element ceiling {ceiling.content}
diff --git a/app/report/mathml3/algebra-logic.rng b/app/report/mathml3/algebra-logic.rng
new file mode 100644
index 0000000..535835b
--- /dev/null
+++ b/app/report/mathml3/algebra-logic.rng
@@ -0,0 +1,425 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <!--
+        This is the Mathematical Markup Language (MathML) 3.0, an XML
+        application for describing mathematical notation and capturing
+        both its structure and content.
+    
+        Copyright 1998-2007 World Wide Web Consortium
+           (Massachusetts Institute of Technology, Institut National de
+            Recherche en Informatique et en Automatique, Keio University).
+            All Rights Reserved.
+    
+        Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+        and its accompanying documentation for any purpose and without fee is
+        hereby granted in perpetuity, provided that the above copyright notice
+        and this paragraph appear in all copies.  The copyright holders make
+        no representation about the suitability of the Schema for any purpose.
+    
+        This file contains the arity checking rules for the symbols
+        from the content dictionary algebra-logic
+        It is provided "as is" without expressed or implied warranty.
+    
+        Revision:   $Id: algebra-logic.rng,v 1.1 2007/12/11 15:59:27 dcarlis Exp $
+  -->
+  <define name="cd.token.unary.class" combine="choice">
+    <choice>
+      <ref name="factorial.token"/>
+      <ref name="unary_minus.token"/>
+      <ref name="not.token"/>
+      <ref name="abs.token"/>
+      <ref name="conjugate.token"/>
+      <ref name="arg.token"/>
+      <ref name="real.token"/>
+      <ref name="imaginary.token"/>
+      <ref name="floor.token"/>
+      <ref name="ceiling.token"/>
+    </choice>
+  </define>
+  <define name="cd.token.binary.class" combine="choice">
+    <choice>
+      <ref name="quotient.token"/>
+      <ref name="divide.token"/>
+      <ref name="minus.token"/>
+      <ref name="power.token"/>
+      <ref name="rem.token"/>
+      <ref name="root.token"/>
+      <ref name="implies.token"/>
+    </choice>
+  </define>
+  <define name="cd.token.nary.class" combine="choice">
+    <choice>
+      <ref name="max.token"/>
+      <ref name="min.token"/>
+      <ref name="plus.token"/>
+      <ref name="times.token"/>
+      <ref name="gcd.token"/>
+      <ref name="and.token"/>
+      <ref name="or.token"/>
+      <ref name="xor.token"/>
+      <ref name="lcm.token"/>
+    </choice>
+  </define>
+  <define name="cd.binder.class" combine="choice">
+    <choice>
+      <ref name="forall.token"/>
+      <ref name="exists.token"/>
+    </choice>
+  </define>
+  <!-- the element definitions for the token elements -->
+  <define name="quotient.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="quotient.token">
+    <element name="quotient">
+      <ref name="quotient.content"/>
+    </element>
+  </define>
+  <define name="factorial.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="factorial.token">
+    <element name="factorial">
+      <ref name="factorial.content"/>
+    </element>
+  </define>
+  <define name="divide.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="divide.token">
+    <element name="divide">
+      <ref name="divide.content"/>
+    </element>
+  </define>
+  <define name="max.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="max.token">
+    <element name="max">
+      <ref name="max.content"/>
+    </element>
+  </define>
+  <define name="min.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="min.token">
+    <element name="min">
+      <ref name="min.content"/>
+    </element>
+  </define>
+  <define name="minus.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="minus.token">
+    <element name="minus">
+      <ref name="minus.content"/>
+    </element>
+  </define>
+  <define name="unary_minus.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="unary_minus.token">
+    <element name="minus">
+      <ref name="unary_minus.content"/>
+    </element>
+  </define>
+  <!-- ednote(rnc:unary_minus) rename minus to unary_minus -->
+  <define name="plus.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="plus.token">
+    <element name="plus">
+      <ref name="plus.content"/>
+    </element>
+  </define>
+  <define name="power.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="power.token">
+    <element name="power">
+      <ref name="power.content"/>
+    </element>
+  </define>
+  <define name="rem.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="rem.token">
+    <element name="rem">
+      <ref name="rem.content"/>
+    </element>
+  </define>
+  <define name="times.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="times.token">
+    <element name="times">
+      <ref name="times.content"/>
+    </element>
+  </define>
+  <define name="root.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="root.token">
+    <element name="root">
+      <ref name="root.content"/>
+    </element>
+  </define>
+  <define name="gcd.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="gcd.token">
+    <element name="gcd">
+      <ref name="gcd.content"/>
+    </element>
+  </define>
+  <define name="and.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="and.token">
+    <element name="and">
+      <ref name="and.content"/>
+    </element>
+  </define>
+  <define name="or.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="or.token">
+    <element name="or">
+      <ref name="or.content"/>
+    </element>
+  </define>
+  <define name="xor.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="xor.token">
+    <element name="xor">
+      <ref name="xor.content"/>
+    </element>
+  </define>
+  <define name="not.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="not.token">
+    <element name="not">
+      <ref name="not.content"/>
+    </element>
+  </define>
+  <define name="implies.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="implies.token">
+    <element name="implies">
+      <ref name="implies.content"/>
+    </element>
+  </define>
+  <define name="forall.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="forall.token">
+    <element name="forall">
+      <ref name="forall.content"/>
+    </element>
+  </define>
+  <define name="exists.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="exists.token">
+    <element name="exists">
+      <ref name="exists.content"/>
+    </element>
+  </define>
+  <define name="abs.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="abs.token">
+    <element name="abs">
+      <ref name="abs.content"/>
+    </element>
+  </define>
+  <define name="conjugate.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="conjugate.token">
+    <element name="conjugate">
+      <ref name="conjugate.content"/>
+    </element>
+  </define>
+  <define name="arg.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="arg.token">
+    <element name="arg">
+      <ref name="arg.content"/>
+    </element>
+  </define>
+  <define name="real.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="real.token">
+    <element name="real">
+      <ref name="real.content"/>
+    </element>
+  </define>
+  <define name="imaginary.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="imaginary.token">
+    <element name="imaginary">
+      <ref name="imaginary.content"/>
+    </element>
+  </define>
+  <define name="lcm.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="lcm.token">
+    <element name="lcm">
+      <ref name="lcm.content"/>
+    </element>
+  </define>
+  <define name="floor.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="floor.token">
+    <element name="floor">
+      <ref name="floor.content"/>
+    </element>
+  </define>
+  <define name="ceiling.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="ceiling.token">
+    <element name="ceiling">
+      <ref name="ceiling.content"/>
+    </element>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/basic-content-elements.rnc b/app/report/mathml3/basic-content-elements.rnc
new file mode 100644
index 0000000..b047d89
--- /dev/null
+++ b/app/report/mathml3/basic-content-elements.rnc
@@ -0,0 +1,49 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2007 World Wide Web Consortium
+#        (Massachusetts Institute of Technology, Institut National de
+#         Recherche en Informatique et en Automatique, Keio University).
+#         All Rights Reserved.
+#
+#     Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+#     and its accompanying documentation for any purpose and without fee is
+#     hereby granted in perpetuity, provided that the above copyright notice
+#     and this paragraph appear in all copies.  The copyright holders make
+#     no representation about the suitability of the Schema for any purpose.
+#
+#     This file contains the arity checking rules for the symbols
+#     from the content dictionary 
+#     It is provided "as is" without expressed or implied warranty.
+#
+#     Revision:   $Id: basic-content-elements.rnc,v 1.1 2007/12/11 15:38:51 dcarlis Exp $
+
+cd.token.unary.class |= inverse.token | ident.token | domain.token | codomain.token | image.token | otherwise.token
+cd.token.binary.class |= interval.token | piece.token
+cd.token.nary.class |= compose.token | piecewise.token
+cd.binder.class |= lambda.token
+
+# the element definitions for the token elements
+interval.content = Token.type, attribute closure {MathMLtype}?
+interval.token = element interval {interval.content}
+inverse.content = Token.type
+inverse.token = element inverse {inverse.content}
+lambda.content = Token.type
+lambda.token = element lambda {lambda.content}
+compose.content = Token.type
+compose.token = element compose {compose.content}
+ident.content = Token.type
+ident.token = element ident {ident.content}
+domain.content = Token.type
+domain.token = element domain {domain.content}
+codomain.content = Token.type
+codomain.token = element codomain {codomain.content}
+image.content = Token.type
+image.token = element image {image.content}
+piecewise.content = Token.type,ContExp*
+piecewise.token = element piecewise {piecewise.content}
+piece.content = Token.type
+piece.token = element piece {piece.content}
+otherwise.content = Token.type
+otherwise.token = element otherwise {otherwise.content}
\ No newline at end of file
diff --git a/app/report/mathml3/basic-content-elements.rng b/app/report/mathml3/basic-content-elements.rng
new file mode 100644
index 0000000..bcff3ce
--- /dev/null
+++ b/app/report/mathml3/basic-content-elements.rng
@@ -0,0 +1,147 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <!--
+        This is the Mathematical Markup Language (MathML) 3.0, an XML
+        application for describing mathematical notation and capturing
+        both its structure and content.
+    
+        Copyright 1998-2007 World Wide Web Consortium
+           (Massachusetts Institute of Technology, Institut National de
+            Recherche en Informatique et en Automatique, Keio University).
+            All Rights Reserved.
+    
+        Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+        and its accompanying documentation for any purpose and without fee is
+        hereby granted in perpetuity, provided that the above copyright notice
+        and this paragraph appear in all copies.  The copyright holders make
+        no representation about the suitability of the Schema for any purpose.
+    
+        This file contains the arity checking rules for the symbols
+        from the content dictionary 
+        It is provided "as is" without expressed or implied warranty.
+    
+        Revision:   $Id: basic-content-elements.rng,v 1.1 2007/12/11 15:59:27 dcarlis Exp $
+  -->
+  <define name="cd.token.unary.class" combine="choice">
+    <choice>
+      <ref name="inverse.token"/>
+      <ref name="ident.token"/>
+      <ref name="domain.token"/>
+      <ref name="codomain.token"/>
+      <ref name="image.token"/>
+      <ref name="otherwise.token"/>
+    </choice>
+  </define>
+  <define name="cd.token.binary.class" combine="choice">
+    <choice>
+      <ref name="interval.token"/>
+      <ref name="piece.token"/>
+    </choice>
+  </define>
+  <define name="cd.token.nary.class" combine="choice">
+    <choice>
+      <ref name="compose.token"/>
+      <ref name="piecewise.token"/>
+    </choice>
+  </define>
+  <define name="cd.binder.class" combine="choice">
+    <ref name="lambda.token"/>
+  </define>
+  <!-- the element definitions for the token elements -->
+  <define name="interval.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="closure">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="interval.token">
+    <element name="interval">
+      <ref name="interval.content"/>
+    </element>
+  </define>
+  <define name="inverse.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="inverse.token">
+    <element name="inverse">
+      <ref name="inverse.content"/>
+    </element>
+  </define>
+  <define name="lambda.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="lambda.token">
+    <element name="lambda">
+      <ref name="lambda.content"/>
+    </element>
+  </define>
+  <define name="compose.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="compose.token">
+    <element name="compose">
+      <ref name="compose.content"/>
+    </element>
+  </define>
+  <define name="ident.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="ident.token">
+    <element name="ident">
+      <ref name="ident.content"/>
+    </element>
+  </define>
+  <define name="domain.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="domain.token">
+    <element name="domain">
+      <ref name="domain.content"/>
+    </element>
+  </define>
+  <define name="codomain.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="codomain.token">
+    <element name="codomain">
+      <ref name="codomain.content"/>
+    </element>
+  </define>
+  <define name="image.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="image.token">
+    <element name="image">
+      <ref name="image.content"/>
+    </element>
+  </define>
+  <define name="piecewise.content">
+    <ref name="Token.type"/>
+    <zeroOrMore>
+      <ref name="ContExp"/>
+    </zeroOrMore>
+  </define>
+  <define name="piecewise.token">
+    <element name="piecewise">
+      <ref name="piecewise.content"/>
+    </element>
+  </define>
+  <define name="piece.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="piece.token">
+    <element name="piece">
+      <ref name="piece.content"/>
+    </element>
+  </define>
+  <define name="otherwise.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="otherwise.token">
+    <element name="otherwise">
+      <ref name="otherwise.content"/>
+    </element>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/calculus_veccalc.rnc b/app/report/mathml3/calculus_veccalc.rnc
new file mode 100644
index 0000000..f772849
--- /dev/null
+++ b/app/report/mathml3/calculus_veccalc.rnc
@@ -0,0 +1,49 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2007 World Wide Web Consortium
+#        (Massachusetts Institute of Technology, Institut National de
+#         Recherche en Informatique et en Automatique, Keio University).
+#         All Rights Reserved.
+#
+#     Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+#     and its accompanying documentation for any purpose and without fee is
+#     hereby granted in perpetuity, provided that the above copyright notice
+#     and this paragraph appear in all copies.  The copyright holders make
+#     no representation about the suitability of the Schema for any purpose.
+#
+#     This file contains the arity checking rules for the symbols
+#     from the content dictionary 
+#     It is provided "as is" without expressed or implied warranty.
+#
+#     Revision:   $Id: calculus_veccalc.rnc,v 1.1 2007/12/11 15:38:51 dcarlis Exp $
+
+cd.token.unary.class |= int.token | diff.token | grad.token | curl.token | laplacian.token
+cd.token.binary.class |= defint.token | defintset.token
+cd.token.nary.class |= partialdiff.token
+cd.binder.class |= intalg.token | Diff.token
+
+# the element definitions for the token elements
+int.content = Token.type
+int.token = element int {int.content}
+defint.content = Token.type
+defint.token = element defint {defint.content}
+defintset.content = Token.type
+defintset.token = element defintset {defintset.content}
+intalg.content = Token.type
+intalg.token = element intalg {intalg.content}
+diff.content = Token.type
+diff.token = element diff {diff.content}
+Diff.content = Token.type
+Diff.token = element Diff {Diff.content}
+partialdiff.content = Token.type, attribute type {MathMLtype}?
+partialdiff.token = element partialdiff {partialdiff.content}
+divergence.content = Token.type
+divergence.token = element divergence {divergence.content}
+grad.content = Token.type
+grad.token = element grad {grad.content}
+curl.content = Token.type
+curl.token = element curl {curl.content}
+laplacian.content = Token.type
+laplacian.token = element laplacian {laplacian.content}
\ No newline at end of file
diff --git a/app/report/mathml3/calculus_veccalc.rng b/app/report/mathml3/calculus_veccalc.rng
new file mode 100644
index 0000000..99c3cd9
--- /dev/null
+++ b/app/report/mathml3/calculus_veccalc.rng
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <!--
+        This is the Mathematical Markup Language (MathML) 3.0, an XML
+        application for describing mathematical notation and capturing
+        both its structure and content.
+    
+        Copyright 1998-2007 World Wide Web Consortium
+           (Massachusetts Institute of Technology, Institut National de
+            Recherche en Informatique et en Automatique, Keio University).
+            All Rights Reserved.
+    
+        Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+        and its accompanying documentation for any purpose and without fee is
+        hereby granted in perpetuity, provided that the above copyright notice
+        and this paragraph appear in all copies.  The copyright holders make
+        no representation about the suitability of the Schema for any purpose.
+    
+        This file contains the arity checking rules for the symbols
+        from the content dictionary 
+        It is provided "as is" without expressed or implied warranty.
+    
+        Revision:   $Id: calculus_veccalc.rng,v 1.1 2007/12/11 15:59:27 dcarlis Exp $
+  -->
+  <define name="cd.token.unary.class" combine="choice">
+    <choice>
+      <ref name="int.token"/>
+      <ref name="diff.token"/>
+      <ref name="grad.token"/>
+      <ref name="curl.token"/>
+      <ref name="laplacian.token"/>
+    </choice>
+  </define>
+  <define name="cd.token.binary.class" combine="choice">
+    <choice>
+      <ref name="defint.token"/>
+      <ref name="defintset.token"/>
+    </choice>
+  </define>
+  <define name="cd.token.nary.class" combine="choice">
+    <ref name="partialdiff.token"/>
+  </define>
+  <define name="cd.binder.class" combine="choice">
+    <choice>
+      <ref name="intalg.token"/>
+      <ref name="Diff.token"/>
+    </choice>
+  </define>
+  <!-- the element definitions for the token elements -->
+  <define name="int.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="int.token">
+    <element name="int">
+      <ref name="int.content"/>
+    </element>
+  </define>
+  <define name="defint.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="defint.token">
+    <element name="defint">
+      <ref name="defint.content"/>
+    </element>
+  </define>
+  <define name="defintset.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="defintset.token">
+    <element name="defintset">
+      <ref name="defintset.content"/>
+    </element>
+  </define>
+  <define name="intalg.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="intalg.token">
+    <element name="intalg">
+      <ref name="intalg.content"/>
+    </element>
+  </define>
+  <define name="diff.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="diff.token">
+    <element name="diff">
+      <ref name="diff.content"/>
+    </element>
+  </define>
+  <define name="Diff.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="Diff.token">
+    <element name="Diff">
+      <ref name="Diff.content"/>
+    </element>
+  </define>
+  <define name="partialdiff.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="partialdiff.token">
+    <element name="partialdiff">
+      <ref name="partialdiff.content"/>
+    </element>
+  </define>
+  <define name="divergence.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="divergence.token">
+    <element name="divergence">
+      <ref name="divergence.content"/>
+    </element>
+  </define>
+  <define name="grad.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="grad.token">
+    <element name="grad">
+      <ref name="grad.content"/>
+    </element>
+  </define>
+  <define name="curl.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="curl.token">
+    <element name="curl">
+      <ref name="curl.content"/>
+    </element>
+  </define>
+  <define name="laplacian.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="laplacian.token">
+    <element name="laplacian">
+      <ref name="laplacian.content"/>
+    </element>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/constants.rnc b/app/report/mathml3/constants.rnc
new file mode 100644
index 0000000..bdb705b
--- /dev/null
+++ b/app/report/mathml3/constants.rnc
@@ -0,0 +1,54 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2007 World Wide Web Consortium
+#        (Massachusetts Institute of Technology, Institut National de
+#         Recherche en Informatique et en Automatique, Keio University).
+#         All Rights Reserved.
+#
+#     Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+#     and its accompanying documentation for any purpose and without fee is
+#     hereby granted in perpetuity, provided that the above copyright notice
+#     and this paragraph appear in all copies.  The copyright holders make
+#     no representation about the suitability of the Schema for any purpose.
+#
+#     This file contains the arity checking rules for the symbols
+#     from the content dictionary 
+#     It is provided "as is" without expressed or implied warranty.
+#
+#     Revision:   $Id: constants.rnc,v 1.1 2007/12/11 15:38:51 dcarlis Exp $
+
+cd.token.class |= integers.token | reals.token | rationals.token | naturalnumbers.token | complexes.token | primes.token | exponentiale.token | imaginaryi.token | notanumber.token | true.token | false.token | emptyset.token | pi.token | eulergamma.token | infinity.token
+
+# the element definitions for the token elements
+integers.content = Token.type
+integers.token = element integers {integers.content}
+reals.content = Token.type
+reals.token = element reals {reals.content}
+rationals.content = Token.type
+rationals.token = element rationals {rationals.content}
+naturalnumbers.content = Token.type
+naturalnumbers.token = element naturalnumbers {naturalnumbers.content}
+complexes.content = Token.type
+complexes.token = element complexes {complexes.content}
+primes.content = Token.type
+primes.token = element primes {primes.content}
+exponentiale.content = Token.type
+exponentiale.token = element exponentiale {exponentiale.content}
+imaginaryi.content = Token.type
+imaginaryi.token = element imaginaryi {imaginaryi.content}
+notanumber.content = Token.type
+notanumber.token = element notanumber {notanumber.content}
+true.content = Token.type
+true.token = element true {true.content}
+false.content = Token.type
+false.token = element false {false.content}
+emptyset.content = Token.type
+emptyset.token = element emptyset {emptyset.content}
+pi.content = Token.type
+pi.token = element pi {pi.content}
+eulergamma.content = Token.type
+eulergamma.token = element eulergamma {eulergamma.content}
+infinity.content = Token.type
+infinity.token = element infinity {infinity.content}
\ No newline at end of file
diff --git a/app/report/mathml3/constants.rng b/app/report/mathml3/constants.rng
new file mode 100644
index 0000000..dfc9385
--- /dev/null
+++ b/app/report/mathml3/constants.rng
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <!--
+        This is the Mathematical Markup Language (MathML) 3.0, an XML
+        application for describing mathematical notation and capturing
+        both its structure and content.
+    
+        Copyright 1998-2007 World Wide Web Consortium
+           (Massachusetts Institute of Technology, Institut National de
+            Recherche en Informatique et en Automatique, Keio University).
+            All Rights Reserved.
+    
+        Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+        and its accompanying documentation for any purpose and without fee is
+        hereby granted in perpetuity, provided that the above copyright notice
+        and this paragraph appear in all copies.  The copyright holders make
+        no representation about the suitability of the Schema for any purpose.
+    
+        This file contains the arity checking rules for the symbols
+        from the content dictionary 
+        It is provided "as is" without expressed or implied warranty.
+    
+        Revision:   $Id: constants.rng,v 1.1 2007/12/11 15:59:27 dcarlis Exp $
+  -->
+  <define name="cd.token.class" combine="choice">
+    <choice>
+      <ref name="integers.token"/>
+      <ref name="reals.token"/>
+      <ref name="rationals.token"/>
+      <ref name="naturalnumbers.token"/>
+      <ref name="complexes.token"/>
+      <ref name="primes.token"/>
+      <ref name="exponentiale.token"/>
+      <ref name="imaginaryi.token"/>
+      <ref name="notanumber.token"/>
+      <ref name="true.token"/>
+      <ref name="false.token"/>
+      <ref name="emptyset.token"/>
+      <ref name="pi.token"/>
+      <ref name="eulergamma.token"/>
+      <ref name="infinity.token"/>
+    </choice>
+  </define>
+  <!-- the element definitions for the token elements -->
+  <define name="integers.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="integers.token">
+    <element name="integers">
+      <ref name="integers.content"/>
+    </element>
+  </define>
+  <define name="reals.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="reals.token">
+    <element name="reals">
+      <ref name="reals.content"/>
+    </element>
+  </define>
+  <define name="rationals.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="rationals.token">
+    <element name="rationals">
+      <ref name="rationals.content"/>
+    </element>
+  </define>
+  <define name="naturalnumbers.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="naturalnumbers.token">
+    <element name="naturalnumbers">
+      <ref name="naturalnumbers.content"/>
+    </element>
+  </define>
+  <define name="complexes.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="complexes.token">
+    <element name="complexes">
+      <ref name="complexes.content"/>
+    </element>
+  </define>
+  <define name="primes.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="primes.token">
+    <element name="primes">
+      <ref name="primes.content"/>
+    </element>
+  </define>
+  <define name="exponentiale.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="exponentiale.token">
+    <element name="exponentiale">
+      <ref name="exponentiale.content"/>
+    </element>
+  </define>
+  <define name="imaginaryi.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="imaginaryi.token">
+    <element name="imaginaryi">
+      <ref name="imaginaryi.content"/>
+    </element>
+  </define>
+  <define name="notanumber.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="notanumber.token">
+    <element name="notanumber">
+      <ref name="notanumber.content"/>
+    </element>
+  </define>
+  <define name="true.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="true.token">
+    <element name="true">
+      <ref name="true.content"/>
+    </element>
+  </define>
+  <define name="false.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="false.token">
+    <element name="false">
+      <ref name="false.content"/>
+    </element>
+  </define>
+  <define name="emptyset.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="emptyset.token">
+    <element name="emptyset">
+      <ref name="emptyset.content"/>
+    </element>
+  </define>
+  <define name="pi.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="pi.token">
+    <element name="pi">
+      <ref name="pi.content"/>
+    </element>
+  </define>
+  <define name="eulergamma.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="eulergamma.token">
+    <element name="eulergamma">
+      <ref name="eulergamma.content"/>
+    </element>
+  </define>
+  <define name="infinity.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="infinity.token">
+    <element name="infinity">
+      <ref name="infinity.content"/>
+    </element>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/errors.rnc b/app/report/mathml3/errors.rnc
new file mode 100644
index 0000000..fd6c121
--- /dev/null
+++ b/app/report/mathml3/errors.rnc
@@ -0,0 +1,30 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2007 World Wide Web Consortium
+#        (Massachusetts Institute of Technology, Institut National de
+#         Recherche en Informatique et en Automatique, Keio University).
+#         All Rights Reserved.
+#
+#     Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+#     and its accompanying documentation for any purpose and without fee is
+#     hereby granted in perpetuity, provided that the above copyright notice
+#     and this paragraph appear in all copies.  The copyright holders make
+#     no representation about the suitability of the Schema for any purpose.
+#
+#     This file contains the arity checking rules for the symbols
+#     from the content dictionary 
+#     It is provided "as is" without expressed or implied warranty.
+#
+#     Revision:   $Id: errors.rnc,v 1.1 2007/12/11 15:38:51 dcarlis Exp $
+
+cd.error.class |= unhandled_symbol.token | unexpected_symbol.token | unsupported_CD.token
+
+# the element definitions for the token elements
+unhandled_symbol.content = Token.type
+unhandled_symbol.token = element unhandled_symbol {unhandled_symbol.content}
+unexpected_symbol.content = Token.type
+unexpected_symbol.token = element unexpected_symbol {unexpected_symbol.content}
+unsupported_CD.content = Token.type
+unsupported_CD.token = element unsupported_CD {unsupported_CD.content}
\ No newline at end of file
diff --git a/app/report/mathml3/errors.rng b/app/report/mathml3/errors.rng
new file mode 100644
index 0000000..bf6d888
--- /dev/null
+++ b/app/report/mathml3/errors.rng
@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <!--
+        This is the Mathematical Markup Language (MathML) 3.0, an XML
+        application for describing mathematical notation and capturing
+        both its structure and content.
+    
+        Copyright 1998-2007 World Wide Web Consortium
+           (Massachusetts Institute of Technology, Institut National de
+            Recherche en Informatique et en Automatique, Keio University).
+            All Rights Reserved.
+    
+        Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+        and its accompanying documentation for any purpose and without fee is
+        hereby granted in perpetuity, provided that the above copyright notice
+        and this paragraph appear in all copies.  The copyright holders make
+        no representation about the suitability of the Schema for any purpose.
+    
+        This file contains the arity checking rules for the symbols
+        from the content dictionary 
+        It is provided "as is" without expressed or implied warranty.
+    
+        Revision:   $Id: errors.rng,v 1.1 2007/12/11 15:59:27 dcarlis Exp $
+  -->
+  <define name="cd.error.class" combine="choice">
+    <choice>
+      <ref name="unhandled_symbol.token"/>
+      <ref name="unexpected_symbol.token"/>
+      <ref name="unsupported_CD.token"/>
+    </choice>
+  </define>
+  <!-- the element definitions for the token elements -->
+  <define name="unhandled_symbol.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="unhandled_symbol.token">
+    <element name="unhandled_symbol">
+      <ref name="unhandled_symbol.content"/>
+    </element>
+  </define>
+  <define name="unexpected_symbol.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="unexpected_symbol.token">
+    <element name="unexpected_symbol">
+      <ref name="unexpected_symbol.content"/>
+    </element>
+  </define>
+  <define name="unsupported_CD.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="unsupported_CD.token">
+    <element name="unsupported_CD">
+      <ref name="unsupported_CD.content"/>
+    </element>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/linear_algebra.rnc b/app/report/mathml3/linear_algebra.rnc
new file mode 100644
index 0000000..aea9937
--- /dev/null
+++ b/app/report/mathml3/linear_algebra.rnc
@@ -0,0 +1,44 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2007 World Wide Web Consortium
+#        (Massachusetts Institute of Technology, Institut National de
+#         Recherche en Informatique et en Automatique, Keio University).
+#         All Rights Reserved.
+#
+#     Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+#     and its accompanying documentation for any purpose and without fee is
+#     hereby granted in perpetuity, provided that the above copyright notice
+#     and this paragraph appear in all copies.  The copyright holders make
+#     no representation about the suitability of the Schema for any purpose.
+#
+#     This file contains the arity checking rules for the symbols
+#     from the content dictionary 
+#     It is provided "as is" without expressed or implied warranty.
+#
+#     Revision:   $Id: linear_algebra.rnc,v 1.1 2007/12/11 15:38:52 dcarlis Exp $
+
+cd.token.unary.class |= determinant.token | transpose.token
+cd.token.binary.class |= selector.token | vectorproduct.token | outerproduct.token
+cd.token.nary.class |= vector.token | matrix.token | matrixrow.token | scalarproduct.token
+
+# the element definitions for the token elements
+vector.content = Token.type, attribute  type  {MathMLtype}?,ContExp*
+vector.token = element vector {vector.content}
+matrix.content = Token.type, attribute type {MathMLtype}?,ContExp*
+matrix.token = element matrix {matrix.content}
+matrixrow.content = Token.type,ContExp*
+matrixrow.token = element matrixrow {matrixrow.content}
+determinant.content = Token.type
+determinant.token = element determinant {determinant.content}
+transpose.content = Token.type
+transpose.token = element transpose {transpose.content}
+selector.content = Token.type
+selector.token = element selector {selector.content}
+vectorproduct.content = Token.type
+vectorproduct.token = element vectorproduct {vectorproduct.content}
+scalarproduct.content = Token.type
+scalarproduct.token = element scalarproduct {scalarproduct.content}
+outerproduct.content = Token.type
+outerproduct.token = element outerproduct {outerproduct.content}
\ No newline at end of file
diff --git a/app/report/mathml3/linear_algebra.rng b/app/report/mathml3/linear_algebra.rng
new file mode 100644
index 0000000..e35744a
--- /dev/null
+++ b/app/report/mathml3/linear_algebra.rng
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <!--
+        This is the Mathematical Markup Language (MathML) 3.0, an XML
+        application for describing mathematical notation and capturing
+        both its structure and content.
+    
+        Copyright 1998-2007 World Wide Web Consortium
+           (Massachusetts Institute of Technology, Institut National de
+            Recherche en Informatique et en Automatique, Keio University).
+            All Rights Reserved.
+    
+        Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+        and its accompanying documentation for any purpose and without fee is
+        hereby granted in perpetuity, provided that the above copyright notice
+        and this paragraph appear in all copies.  The copyright holders make
+        no representation about the suitability of the Schema for any purpose.
+    
+        This file contains the arity checking rules for the symbols
+        from the content dictionary 
+        It is provided "as is" without expressed or implied warranty.
+    
+        Revision:   $Id: linear_algebra.rng,v 1.1 2007/12/11 15:59:27 dcarlis Exp $
+  -->
+  <define name="cd.token.unary.class" combine="choice">
+    <choice>
+      <ref name="determinant.token"/>
+      <ref name="transpose.token"/>
+    </choice>
+  </define>
+  <define name="cd.token.binary.class" combine="choice">
+    <choice>
+      <ref name="selector.token"/>
+      <ref name="vectorproduct.token"/>
+      <ref name="outerproduct.token"/>
+    </choice>
+  </define>
+  <define name="cd.token.nary.class" combine="choice">
+    <choice>
+      <ref name="vector.token"/>
+      <ref name="matrix.token"/>
+      <ref name="matrixrow.token"/>
+      <ref name="scalarproduct.token"/>
+    </choice>
+  </define>
+  <!-- the element definitions for the token elements -->
+  <define name="vector.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+    <zeroOrMore>
+      <ref name="ContExp"/>
+    </zeroOrMore>
+  </define>
+  <define name="vector.token">
+    <element name="vector">
+      <ref name="vector.content"/>
+    </element>
+  </define>
+  <define name="matrix.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+    <zeroOrMore>
+      <ref name="ContExp"/>
+    </zeroOrMore>
+  </define>
+  <define name="matrix.token">
+    <element name="matrix">
+      <ref name="matrix.content"/>
+    </element>
+  </define>
+  <define name="matrixrow.content">
+    <ref name="Token.type"/>
+    <zeroOrMore>
+      <ref name="ContExp"/>
+    </zeroOrMore>
+  </define>
+  <define name="matrixrow.token">
+    <element name="matrixrow">
+      <ref name="matrixrow.content"/>
+    </element>
+  </define>
+  <define name="determinant.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="determinant.token">
+    <element name="determinant">
+      <ref name="determinant.content"/>
+    </element>
+  </define>
+  <define name="transpose.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="transpose.token">
+    <element name="transpose">
+      <ref name="transpose.content"/>
+    </element>
+  </define>
+  <define name="selector.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="selector.token">
+    <element name="selector">
+      <ref name="selector.content"/>
+    </element>
+  </define>
+  <define name="vectorproduct.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="vectorproduct.token">
+    <element name="vectorproduct">
+      <ref name="vectorproduct.content"/>
+    </element>
+  </define>
+  <define name="scalarproduct.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="scalarproduct.token">
+    <element name="scalarproduct">
+      <ref name="scalarproduct.content"/>
+    </element>
+  </define>
+  <define name="outerproduct.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="outerproduct.token">
+    <element name="outerproduct">
+      <ref name="outerproduct.content"/>
+    </element>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/mathml-p.rnc b/app/report/mathml3/mathml-p.rnc
new file mode 100644
index 0000000..4d344e8
--- /dev/null
+++ b/app/report/mathml3/mathml-p.rnc
@@ -0,0 +1,2 @@
+include "mathml3-common.rnc"
+include mathml3-presentation.rnc"
diff --git a/app/report/mathml3/mathml3-cds-pragmatic.rnc b/app/report/mathml3/mathml3-cds-pragmatic.rnc
new file mode 100644
index 0000000..74c61f6
--- /dev/null
+++ b/app/report/mathml3/mathml3-cds-pragmatic.rnc
@@ -0,0 +1,425 @@
+default namespace m = 'http://www.w3.org/1998/Math/MathML'
+opel.application |= lcm_arith1_elt
+lcm_arith1_elt |= element m:lcm {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.binder |= lcm_arith1_elt
+opel.application |= gcd_arith1_elt
+gcd_arith1_elt |= element m:gcd {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.binder |= gcd_arith1_elt
+opel.application |= plus_arith1_elt
+plus_arith1_elt |= element m:plus {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+
+opel.application |= minus_arith1_elt
+minus_arith1_elt |= element m:minus {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= times_arith1_elt
+times_arith1_elt |= element m:times {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= divide_arith1_elt
+divide_arith1_elt |= element m:divide {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= power_arith1_elt
+power_arith1_elt |= element m:power {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= abs_arith1_elt
+abs_arith1_elt |= element m:abs {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= root_arith1_elt
+root_arith1_elt |= element m:root {MathML.Common.attrib,Definition.attrib?,attribute type {"real" | "complex" | "principal_branch" | MathMLType}?}
+opel.application |= sum_arith1_elt
+sum_arith1_elt |= element m:sum {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= sum_arith1_elt
+opel.application |= product_arith1_elt
+product_arith1_elt |= element m:product {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= product_arith1_elt
+opel.application |= diff_calculus1_elt
+diff_calculus1_elt |= element m:diff {MathML.Common.attrib,Definition.attrib?,attribute type {"function" | "algebraic"}?}
+opel.binder |= diff_calculus1_elt
+opel.application |= partialdiff_calculus1_elt
+partialdiff_calculus1_elt |= element m:partialdiff {MathML.Common.attrib,Definition.attrib?,attribute type {"function" | "algebraic"}?}
+opel.application |= int_calculus1_elt
+int_calculus1_elt |= element m:int {MathML.Common.attrib,Definition.attrib?}
+opel.application |= defint_calculus1_elt
+defint_calculus1_elt |= element m:defint {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= diff_calculus3_elt
+diff_calculus3_elt |= element m:diff {MathML.Common.attrib,Definition.attrib?,attribute type {"function" | "algebraic"}?}
+opel.binder |= diff_calculus3_elt
+opel.binder |= partialdiff_calculus3_elt
+partialdiff_calculus3_elt |= element m:partialdiff {MathML.Common.attrib,Definition.attrib?,attribute type {"function" | "algebraic"}?}
+opel.binder |= int_calculus3_elt
+int_calculus3_elt |= element m:int {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= defint_calculus3_elt
+defint_calculus3_elt |= element m:defint {MathML.Common.attrib,Definition.attrib?}
+
+opel.application |= real_complex1_elt
+real_complex1_elt |= element m:real {MathML.Common.attrib,Definition.attrib?}
+opel.application |= imaginary_complex1_elt
+imaginary_complex1_elt |= element m:imaginary {MathML.Common.attrib,Definition.attrib?}
+
+opel.application |= argument_complex1_elt
+argument_complex1_elt |= element m:arg {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= conjugate_complex1_elt
+conjugate_complex1_elt |= element m:conjugate {MathML.Common.attrib,Definition.attrib?}
+opel.application |= domain_fns1_elt
+domain_fns1_elt |= element m:domain {MathML.Common.attrib,Definition.attrib?}
+opel.application |= range_fns1_elt
+range_fns1_elt |= element m:codomain {MathML.Common.attrib,Definition.attrib?}
+opel.application |= image_fns1_elt
+image_fns1_elt |= element m:image {MathML.Common.attrib,Definition.attrib?}
+opel.application |= identity_fns1_elt
+identity_fns1_elt |= element m:ident {MathML.Common.attrib,Definition.attrib?}
+opel.application |= inverse_fns1_elt
+inverse_fns1_elt |= element m:inverse {MathML.Common.attrib,Definition.attrib?}
+opel.application |= left_compose_fns1_elt
+left_compose_fns1_elt |= element m:compose {MathML.Common.attrib,Definition.attrib?}
+opel.application |= compose_fns1_elt
+compose_fns1_elt |= element m:compose {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= lambda_fns1_elt
+lambda_fns1_elt |= element m:lambda {MathML.Common.attrib,Definition.attrib?,ContExp*}
+lambda_fns1_elt |= element m:lambda {MathML.Common.attrib,Definition.attrib?,bvar*,qualifier?,ContExp*}
+container |= lambda_fns1_elt
+opel.application |= condition_fns1_elt
+condition_fns1_elt |= element m:lambda {MathML.Common.attrib,Definition.attrib?,ContExp*}
+condition_fns1_elt |= element m:lambda {MathML.Common.attrib,Definition.attrib?,bvar*,qualifier?,ContExp*}
+container |= condition_fns1_elt
+opel.application |= factorof_integer1_elt
+factorof_integer1_elt |= element m:factorof {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= factorial_integer1_elt
+factorial_integer1_elt |= element m:factorial {MathML.Common.attrib,Definition.attrib?}
+opel.application |= quotient_integer1_elt
+quotient_integer1_elt |= element m:quotient {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= remainder_integer1_elt
+remainder_integer1_elt |= element m:rem {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= interval_interval1_elt
+interval_interval1_elt |= element m:interval {MathML.Common.attrib,Definition.attrib?,attribute type {"closed" | "open" | "open-closed" | "closed-open" | "integer"}?,attribute type {MathMLType}?,ContExp*}
+interval_interval1_elt |= element m:interval {MathML.Common.attrib,Definition.attrib?,attribute type {"closed" | "open" | "open-closed" | "closed-open" | "integer"}?,attribute type {MathMLType}?,bvar*,qualifier?,ContExp*}
+container |= interval_interval1_elt
+opel.application |= interval_oo_interval1_elt
+interval_oo_interval1_elt |= element m:interval {MathML.Common.attrib,Definition.attrib?,attribute closure {"open"},ContExp*}
+opel.application |= interval_cc_interval1_elt
+interval_cc_interval1_elt |= element m:interval {MathML.Common.attrib,Definition.attrib?,attribute closure {"closed"},ContExp*}
+opel.application |= interval_oc_interval1_elt
+interval_oc_interval1_elt |= element m:interval {MathML.Common.attrib,Definition.attrib?,attribute closure {"open-closed"},ContExp,ContExp}
+opel.application |= interval_co_interval1_elt
+interval_co_interval1_elt |= element m:interval {MathML.Common.attrib,Definition.attrib?,attribute closure {"closed-open"},ContExp,ContExp}
+opel.application |= limit_limit1_elt
+limit_limit1_elt |= element m:limit {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= limit_limit1_elt
+
+opel.constant |= above_limit1_elt
+above_limit1_elt |= element m:above {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= below_limit1_elt
+below_limit1_elt |= element m:below {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= null_limit1_elt
+null_limit1_elt |= element m:null {MathML.Common.attrib,Definition.attrib?}
+opel.application |= tendsto_limit1_elt
+tendsto_limit1_elt |= element m:tendsto {MathML.Common.attrib,Definition.attrib?,attribute type {"above" | "below" | "two-sided" | MathMLType}?}
+opel.application |= vectorproduct_linalg1_elt
+vectorproduct_linalg1_elt |= element m:vectorproduct {MathML.Common.attrib,Definition.attrib?}
+opel.application |= scalarproduct_linalg1_elt
+scalarproduct_linalg1_elt |= element m:scalarproduct {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= scalarproduct_linalg1_elt
+opel.application |= outerproduct_linalg1_elt
+outerproduct_linalg1_elt |= element m:outerproduct {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= outerproduct_linalg1_elt
+opel.application |= transpose_linalg1_elt
+transpose_linalg1_elt |= element m:transpose {MathML.Common.attrib,Definition.attrib?}
+opel.application |= determinant_linalg1_elt
+determinant_linalg1_elt |= element m:determinant {MathML.Common.attrib,Definition.attrib?}
+opel.application |= vector_selector_linalg1_elt
+vector_selector_linalg1_elt |= element m:selector {MathML.Common.attrib,Definition.attrib?}
+
+opel.application |= vector_linalg2_elt
+vector_linalg2_elt |= element m:vector {MathML.Common.attrib,Definition.attrib?,attribute type {"row"|MathMLType}?,ContExp*}
+vector_linalg2_elt |= element m:vector {MathML.Common.attrib,Definition.attrib?,attribute type {"row"|MathMLType}?,bvar*,qualifier?,ContExp*}
+container |= vector_linalg2_elt
+opel.application |= matrixrow_linalg2_elt
+matrixrow_linalg2_elt |= element m:matrixrow {MathML.Common.attrib,Definition.attrib?,ContExp*}
+matrixrow_linalg2_elt |= element m:matrixrow {MathML.Common.attrib,Definition.attrib?,bvar*,qualifier?,ContExp*}
+container |= matrixrow_linalg2_elt
+opel.application |= matrix_linalg2_elt
+matrix_linalg2_elt |= element m:matrix {MathML.Common.attrib,Definition.attrib?,attribute type {"real" | "complex" | "integer" | "symbolic" | MathMLType}?,ContExp*}
+matrix_linalg2_elt |= element m:matrix {MathML.Common.attrib,Definition.attrib?,attribute type {"real" | "complex" | "integer" | "symbolic" | MathMLType}?,bvar*,qualifier?,ContExp*}
+container |= matrix_linalg2_elt
+opel.application |= vector_linalg3_elt
+vector_linalg3_elt |= element m:vector {MathML.Common.attrib,Definition.attrib?,attribute type {"column" | MathMLType}?,ContExp*}
+vector_linalg3_elt |= element m:vector {MathML.Common.attrib,Definition.attrib?,attribute type {"column" | MathMLType}?,bvar*,qualifier?,ContExp*}
+container |= vector_linalg3_elt
+opel.application |= matrixcolumn_linalg3_elt
+matrixcolumn_linalg3_elt |= element m:matrixcolumn {MathML.Common.attrib,Definition.attrib?}
+opel.application |= matrix_linalg3_elt
+matrix_linalg3_elt |= element m:matrix {MathML.Common.attrib,Definition.attrib?}
+opel.application |= vector_linalg6_elt
+vector_linalg6_elt |= element m:vector {MathML.Common.attrib,Definition.attrib?,attribute type {"row"|MathMLType}?,ContExp*}
+vector_linalg6_elt |= element m:vector {MathML.Common.attrib,Definition.attrib?,attribute type {"row"|MathMLType}?,bvar*,qualifier?,ContExp*}
+container |= vector_linalg6_elt
+opel.application |= matrix_linalg6_elt
+matrix_linalg6_elt |= element m:matrix {MathML.Common.attrib,Definition.attrib?,attribute type {"real" | "complex" | "integer" | "symbolic" | MathMLType}?,ContExp*}
+matrix_linalg6_elt |= element m:matrix {MathML.Common.attrib,Definition.attrib?,attribute type {"real" | "complex" | "integer" | "symbolic" | MathMLType}?,bvar*,qualifier?,ContExp*}
+container |= matrix_linalg6_elt
+opel.application |= list_list1_elt
+list_list1_elt |= element m:list {MathML.Common.attrib,Definition.attrib?,attribute order {"lexicographic" | "numeric"}?,ContExp*}
+list_list1_elt |= element m:list {MathML.Common.attrib,Definition.attrib?,attribute order {"lexicographic" | "numeric"}?,bvar*,qualifier?,ContExp*}
+container |= list_list1_elt
+opel.application |= list_selector_list2_elt
+list_selector_list2_elt |= element m:selector {MathML.Common.attrib,Definition.attrib?}
+opel.application |= equivalent_logic1_elt
+equivalent_logic1_elt |= element m:equivalent {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= equivalent_logic1_elt
+opel.application |= not_logic1_elt
+not_logic1_elt |= element m:not {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= and_logic1_elt
+and_logic1_elt |= element m:and {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.binder |= and_logic1_elt
+opel.application |= xor_logic1_elt
+xor_logic1_elt |= element m:xor {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.binder |= xor_logic1_elt
+opel.application |= or_logic1_elt
+or_logic1_elt |= element m:or {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.binder |= or_logic1_elt
+opel.application |= implies_logic1_elt
+implies_logic1_elt |= element m:implies {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.constant |= true_logic1_elt
+true_logic1_elt |= element m:true {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= false_logic1_elt
+false_logic1_elt |= element m:false {MathML.Common.attrib,Definition.attrib?}
+opel.semantic-attribution |= type_mathmltypes_elt
+type_mathmltypes_elt |= element m:type {MathML.Common.attrib,Definition.attrib?}
+
+opel.application |= min_minmax1_elt
+min_minmax1_elt |= element m:min {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.binder |= min_minmax1_elt
+opel.application |= max_minmax1_elt
+max_minmax1_elt |= element m:max {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.binder |= max_minmax1_elt
+opel.application |= cartesian_product_multiset1_elt
+cartesian_product_multiset1_elt |= element m:cartesianproduct {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.binder |= cartesian_product_multiset1_elt
+opel.constant |= emptyset_multiset1_elt
+emptyset_multiset1_elt |= element m:emptyset {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.application |= map_multiset1_elt
+map_multiset1_elt |= element m:map {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.application |= size_multiset1_elt
+size_multiset1_elt |= element m:card {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.application |= suchthat_multiset1_elt
+suchthat_multiset1_elt |= element m:suchthat {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.application |= multiset_multiset1_elt
+multiset_multiset1_elt |= element m:multiset {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"},ContExp*}
+multiset_multiset1_elt |= element m:multiset {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"},bvar*,qualifier?,ContExp*}
+container |= multiset_multiset1_elt
+opel.application |= intersect_multiset1_elt
+intersect_multiset1_elt |= element m:intersect {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.binder |= intersect_multiset1_elt
+opel.application |= union_multiset1_elt
+union_multiset1_elt |= element m:union {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.binder |= union_multiset1_elt
+opel.application |= setdiff_multiset1_elt
+setdiff_multiset1_elt |= element m:setdiff {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.application |= subset_multiset1_elt
+subset_multiset1_elt |= element m:subset {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.binder |= subset_multiset1_elt
+opel.application |= in_multiset1_elt
+in_multiset1_elt |= element m:in {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.application |= notin_multiset1_elt
+notin_multiset1_elt |= element m:notin {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.application |= prsubset_multiset1_elt
+prsubset_multiset1_elt |= element m:prsubset {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.binder |= prsubset_multiset1_elt
+opel.application |= notsubset_multiset1_elt
+notsubset_multiset1_elt |= element m:notsubset {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+opel.application |= notprsubset_multiset1_elt
+notprsubset_multiset1_elt |= element m:notprsubset {MathML.Common.attrib,Definition.attrib?,attribute type {"multiset"}}
+
+opel.application |= rational_nums1_elt
+rational_nums1_elt |= element m:rational {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= infinity_nums1_elt
+infinity_nums1_elt |= element m:infinity {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= e_nums1_elt
+e_nums1_elt |= element m:exponentiale {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= i_nums1_elt
+i_nums1_elt |= element m:imaginaryi {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= pi_nums1_elt
+pi_nums1_elt |= element m:pi {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= gamma_nums1_elt
+gamma_nums1_elt |= element m:eulergamma {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= NaN_nums1_elt
+NaN_nums1_elt |= element m:notanumber {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= omtype_omtypes_elt
+omtype_omtypes_elt |= element m:omtype {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= integer_omtypes_elt
+integer_omtypes_elt |= element m:integer {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= float_omtypes_elt
+float_omtypes_elt |= element m:float {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= string_omtypes_elt
+string_omtypes_elt |= element m:string {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= bytearray_omtypes_elt
+bytearray_omtypes_elt |= element m:bytearray {MathML.Common.attrib,Definition.attrib?}
+opel.application |= piecewise_piece1_elt
+piecewise_piece1_elt |= element m:piecewise {MathML.Common.attrib,Definition.attrib?,ContExp*}
+piecewise_piece1_elt |= element m:piecewise {MathML.Common.attrib,Definition.attrib?,bvar*,qualifier?,ContExp*}
+container |= piecewise_piece1_elt
+opel.application |= piece_piece1_elt
+piece_piece1_elt |= element m:piece {MathML.Common.attrib,Definition.attrib?,ContExp*}
+piece_piece1_elt |= element m:piece {MathML.Common.attrib,Definition.attrib?,bvar*,qualifier?,ContExp*}
+container |= piece_piece1_elt
+opel.application |= otherwise_piece1_elt
+otherwise_piece1_elt |= element m:otherwise {MathML.Common.attrib,Definition.attrib?,ContExp*}
+otherwise_piece1_elt |= element m:otherwise {MathML.Common.attrib,Definition.attrib?,bvar*,qualifier?,ContExp*}
+container |= otherwise_piece1_elt
+opel.binder |= forall_quant1_elt
+forall_quant1_elt |= element m:forall {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.binder |= exists_quant1_elt
+exists_quant1_elt |= element m:exists {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= eq_relation1_elt
+eq_relation1_elt |= element m:eq {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= eq_relation1_elt
+opel.application |= lt_relation1_elt
+lt_relation1_elt |= element m:lt {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= lt_relation1_elt
+opel.application |= gt_relation1_elt
+gt_relation1_elt |= element m:gt {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= gt_relation1_elt
+opel.application |= neq_relation1_elt
+neq_relation1_elt |= element m:neq {MathML.Common.attrib,Definition.attrib?}
+opel.application |= leq_relation1_elt
+leq_relation1_elt |= element m:leq {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= leq_relation1_elt
+opel.application |= geq_relation1_elt
+geq_relation1_elt |= element m:geq {MathML.Common.attrib,Definition.attrib?}
+opel.binder |= geq_relation1_elt
+opel.application |= approx_relation1_elt
+approx_relation1_elt |= element m:approx {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.binder |= approx_relation1_elt
+opel.application |= ceiling_rounding1_elt
+ceiling_rounding1_elt |= element m:ceiling {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= floor_rounding1_elt
+floor_rounding1_elt |= element m:floor {MathML.Common.attrib,Definition.attrib?,attribute type {MathMLType}?}
+opel.application |= trunc_rounding1_elt
+trunc_rounding1_elt |= element m:trunc {MathML.Common.attrib,Definition.attrib?}
+opel.application |= round_rounding1_elt
+round_rounding1_elt |= element m:round {MathML.Common.attrib,Definition.attrib?}
+opel.application |= mean_s_data1_elt
+mean_s_data1_elt |= element m:mean {MathML.Common.attrib,Definition.attrib?}
+opel.application |= sdev_s_data1_elt
+sdev_s_data1_elt |= element m:sdev {MathML.Common.attrib,Definition.attrib?}
+opel.application |= variance_s_data1_elt
+variance_s_data1_elt |= element m:variance {MathML.Common.attrib,Definition.attrib?}
+opel.application |= mode_s_data1_elt
+mode_s_data1_elt |= element m:mode {MathML.Common.attrib,Definition.attrib?}
+opel.application |= median_s_data1_elt
+median_s_data1_elt |= element m:median {MathML.Common.attrib,Definition.attrib?}
+opel.application |= moment_s_data1_elt
+moment_s_data1_elt |= element m:moment {MathML.Common.attrib,Definition.attrib?}
+opel.application |= mean_s_dist1_elt
+mean_s_dist1_elt |= element m:mean {MathML.Common.attrib,Definition.attrib?}
+opel.application |= sdev_s_dist1_elt
+sdev_s_dist1_elt |= element m:sdev {MathML.Common.attrib,Definition.attrib?}
+opel.application |= variance_s_dist1_elt
+variance_s_dist1_elt |= element m:variance {MathML.Common.attrib,Definition.attrib?}
+opel.application |= moment_s_dist1_elt
+moment_s_dist1_elt |= element m:moment {MathML.Common.attrib,Definition.attrib?}
+opel.application |= cartesian_product_set1_elt
+cartesian_product_set1_elt |= element m:cartesianproduct {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.binder |= cartesian_product_set1_elt
+opel.constant |= emptyset_set1_elt
+emptyset_set1_elt |= element m:emptyset {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.application |= map_set1_elt
+map_set1_elt |= element m:map {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.application |= size_set1_elt
+size_set1_elt |= element m:card {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.application |= suchthat_set1_elt
+suchthat_set1_elt |= element m:suchthat {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.application |= set_set1_elt
+set_set1_elt |= element m:set {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?,ContExp*}
+set_set1_elt |= element m:set {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?,bvar*,qualifier?,ContExp*}
+container |= set_set1_elt
+opel.application |= intersect_set1_elt
+intersect_set1_elt |= element m:intersect {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.binder |= intersect_set1_elt
+opel.application |= union_set1_elt
+union_set1_elt |= element m:union {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.binder |= union_set1_elt
+opel.application |= setdiff_set1_elt
+setdiff_set1_elt |= element m:setdiff {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.application |= subset_set1_elt
+subset_set1_elt |= element m:subset {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.binder |= subset_set1_elt
+opel.application |= in_set1_elt
+in_set1_elt |= element m:in {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.application |= notin_set1_elt
+notin_set1_elt |= element m:notin {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.application |= prsubset_set1_elt
+prsubset_set1_elt |= element m:prsubset {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.binder |= prsubset_set1_elt
+opel.application |= notsubset_set1_elt
+notsubset_set1_elt |= element m:notsubset {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.application |= notprsubset_set1_elt
+notprsubset_set1_elt |= element m:notprsubset {MathML.Common.attrib,Definition.attrib?,attribute type {"normal" | "multiset"}?}
+opel.constant |= P_setname1_elt
+P_setname1_elt |= element m:primes {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= N_setname1_elt
+N_setname1_elt |= element m:naturalnumbers {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= Z_setname1_elt
+Z_setname1_elt |= element m:integers {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= rationials_setname1_elt
+rationials_setname1_elt |= element m:rationals {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= R_setname1_elt
+R_setname1_elt |= element m:reals {MathML.Common.attrib,Definition.attrib?}
+opel.constant |= complexes_setname1_elt
+complexes_setname1_elt |= element m:complexes {MathML.Common.attrib,Definition.attrib?}
+opel.application |= log_transc1_elt
+log_transc1_elt |= element m:log {MathML.Common.attrib,Definition.attrib?}
+opel.application |= ln_transc1_elt
+ln_transc1_elt |= element m:ln {MathML.Common.attrib,Definition.attrib?}
+opel.application |= exp_transc1_elt
+exp_transc1_elt |= element m:exp {MathML.Common.attrib,Definition.attrib?}
+opel.application |= sin_transc1_elt
+sin_transc1_elt |= element m:sin {MathML.Common.attrib,Definition.attrib?}
+opel.application |= cos_transc1_elt
+cos_transc1_elt |= element m:cos {MathML.Common.attrib,Definition.attrib?}
+opel.application |= tan_transc1_elt
+tan_transc1_elt |= element m:tan {MathML.Common.attrib,Definition.attrib?}
+opel.application |= sec_transc1_elt
+sec_transc1_elt |= element m:sec {MathML.Common.attrib,Definition.attrib?}
+opel.application |= csc_transc1_elt
+csc_transc1_elt |= element m:csc {MathML.Common.attrib,Definition.attrib?}
+opel.application |= cot_transc1_elt
+cot_transc1_elt |= element m:cot {MathML.Common.attrib,Definition.attrib?}
+opel.application |= sinh_transc1_elt
+sinh_transc1_elt |= element m:sinh {MathML.Common.attrib,Definition.attrib?}
+opel.application |= cosh_transc1_elt
+cosh_transc1_elt |= element m:cosh {MathML.Common.attrib,Definition.attrib?}
+opel.application |= tanh_transc1_elt
+tanh_transc1_elt |= element m:tanh {MathML.Common.attrib,Definition.attrib?}
+opel.application |= sech_transc1_elt
+sech_transc1_elt |= element m:sech {MathML.Common.attrib,Definition.attrib?}
+opel.application |= csch_transc1_elt
+csch_transc1_elt |= element m:csch {MathML.Common.attrib,Definition.attrib?}
+opel.application |= coth_transc1_elt
+coth_transc1_elt |= element m:coth {MathML.Common.attrib,Definition.attrib?}
+opel.application |= arcsin_transc1_elt
+arcsin_transc1_elt |= element m:arcsin {MathML.Common.attrib,Definition.attrib?}
+opel.application |= arccos_transc1_elt
+arccos_transc1_elt |= element m:arccos {MathML.Common.attrib,Definition.attrib?}
+opel.application |= arctan_transc1_elt
+arctan_transc1_elt |= element m:arctan {MathML.Common.attrib,Definition.attrib?}
+opel.application |= arcsec_transc1_elt
+arcsec_transc1_elt |= element m:arcsec {MathML.Common.attrib,Definition.attrib?}
+opel.application |= arccsc_transc1_elt
+arccsc_transc1_elt |= element m:arccsc {MathML.Common.attrib,Definition.attrib?}
+opel.application |= arccot_transc1_elt
+arccot_transc1_elt |= element m:arccot {MathML.Common.attrib,Definition.attrib?}
+opel.application |= arcsinh_transc1_elt
+arcsinh_transc1_elt |= element m:arcsinh {MathML.Common.attrib,Definition.attrib?}
+opel.application |= arccosh_transc1_elt
+arccosh_transc1_elt |= element m:arccosh {MathML.Common.attrib,Definition.attrib?}
+opel.application |= arctanh_transc1_elt
+arctanh_transc1_elt |= element m:arctanh {MathML.Common.attrib,Definition.attrib?}
+opel.application |= arcsech_transc1_elt
+arcsech_transc1_elt |= element m:arcsech {MathML.Common.attrib,Definition.attrib?}
+opel.application |= arccsch_transc1_elt
+arccsch_transc1_elt |= element m:arccsch {MathML.Common.attrib,Definition.attrib?}
+opel.application |= arccoth_transc1_elt
+arccoth_transc1_elt |= element m:arccoth {MathML.Common.attrib,Definition.attrib?}
+opel.application |= divergence_veccalc1_elt
+divergence_veccalc1_elt |= element m:divergence {MathML.Common.attrib,Definition.attrib?}
+opel.application |= grad_veccalc1_elt
+grad_veccalc1_elt |= element m:grad {MathML.Common.attrib,Definition.attrib?}
+opel.application |= curl_veccalc1_elt
+curl_veccalc1_elt |= element m:curl {MathML.Common.attrib,Definition.attrib?}
+opel.application |= Laplacian_veccalc1_elt
+Laplacian_veccalc1_elt |= element m:laplacian {MathML.Common.attrib,Definition.attrib?}
diff --git a/app/report/mathml3/mathml3-cds-pragmatic.rng b/app/report/mathml3/mathml3-cds-pragmatic.rng
new file mode 100644
index 0000000..551a2f7
--- /dev/null
+++ b/app/report/mathml3/mathml3-cds-pragmatic.rng
@@ -0,0 +1,2909 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0">
+  <define name="opel.application" combine="choice">
+    <ref name="lcm_arith1_elt"/>
+  </define>
+  <define name="lcm_arith1_elt" combine="choice">
+    <element name="m:lcm">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="lcm_arith1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="gcd_arith1_elt"/>
+  </define>
+  <define name="gcd_arith1_elt" combine="choice">
+    <element name="m:gcd">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="gcd_arith1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="plus_arith1_elt"/>
+  </define>
+  <define name="plus_arith1_elt" combine="choice">
+    <element name="m:plus">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="minus_arith1_elt"/>
+  </define>
+  <define name="minus_arith1_elt" combine="choice">
+    <element name="m:minus">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="times_arith1_elt"/>
+  </define>
+  <define name="times_arith1_elt" combine="choice">
+    <element name="m:times">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="divide_arith1_elt"/>
+  </define>
+  <define name="divide_arith1_elt" combine="choice">
+    <element name="m:divide">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="power_arith1_elt"/>
+  </define>
+  <define name="power_arith1_elt" combine="choice">
+    <element name="m:power">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="abs_arith1_elt"/>
+  </define>
+  <define name="abs_arith1_elt" combine="choice">
+    <element name="m:abs">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="root_arith1_elt"/>
+  </define>
+  <define name="root_arith1_elt" combine="choice">
+    <element name="m:root">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>real</value>
+            <value>complex</value>
+            <value>principal_branch</value>
+            <ref name="MathMLType"/>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="sum_arith1_elt"/>
+  </define>
+  <define name="sum_arith1_elt" combine="choice">
+    <element name="m:sum">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="sum_arith1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="product_arith1_elt"/>
+  </define>
+  <define name="product_arith1_elt" combine="choice">
+    <element name="m:product">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="product_arith1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="diff_calculus1_elt"/>
+  </define>
+  <define name="diff_calculus1_elt" combine="choice">
+    <element name="m:diff">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>function</value>
+            <value>algebraic</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="diff_calculus1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="partialdiff_calculus1_elt"/>
+  </define>
+  <define name="partialdiff_calculus1_elt" combine="choice">
+    <element name="m:partialdiff">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>function</value>
+            <value>algebraic</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="int_calculus1_elt"/>
+  </define>
+  <define name="int_calculus1_elt" combine="choice">
+    <element name="m:int">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="defint_calculus1_elt"/>
+  </define>
+  <define name="defint_calculus1_elt" combine="choice">
+    <element name="m:defint">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="diff_calculus3_elt"/>
+  </define>
+  <define name="diff_calculus3_elt" combine="choice">
+    <element name="m:diff">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>function</value>
+            <value>algebraic</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="diff_calculus3_elt"/>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="partialdiff_calculus3_elt"/>
+  </define>
+  <define name="partialdiff_calculus3_elt" combine="choice">
+    <element name="m:partialdiff">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>function</value>
+            <value>algebraic</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="int_calculus3_elt"/>
+  </define>
+  <define name="int_calculus3_elt" combine="choice">
+    <element name="m:int">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="defint_calculus3_elt"/>
+  </define>
+  <define name="defint_calculus3_elt" combine="choice">
+    <element name="m:defint">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="real_complex1_elt"/>
+  </define>
+  <define name="real_complex1_elt" combine="choice">
+    <element name="m:real">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="imaginary_complex1_elt"/>
+  </define>
+  <define name="imaginary_complex1_elt" combine="choice">
+    <element name="m:imaginary">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="argument_complex1_elt"/>
+  </define>
+  <define name="argument_complex1_elt" combine="choice">
+    <element name="m:arg">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="conjugate_complex1_elt"/>
+  </define>
+  <define name="conjugate_complex1_elt" combine="choice">
+    <element name="m:conjugate">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="domain_fns1_elt"/>
+  </define>
+  <define name="domain_fns1_elt" combine="choice">
+    <element name="m:domain">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="range_fns1_elt"/>
+  </define>
+  <define name="range_fns1_elt" combine="choice">
+    <element name="m:codomain">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="image_fns1_elt"/>
+  </define>
+  <define name="image_fns1_elt" combine="choice">
+    <element name="m:image">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="identity_fns1_elt"/>
+  </define>
+  <define name="identity_fns1_elt" combine="choice">
+    <element name="m:ident">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="inverse_fns1_elt"/>
+  </define>
+  <define name="inverse_fns1_elt" combine="choice">
+    <element name="m:inverse">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="left_compose_fns1_elt"/>
+  </define>
+  <define name="left_compose_fns1_elt" combine="choice">
+    <element name="m:compose">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="compose_fns1_elt"/>
+  </define>
+  <define name="compose_fns1_elt" combine="choice">
+    <element name="m:compose">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="lambda_fns1_elt"/>
+  </define>
+  <define name="lambda_fns1_elt" combine="choice">
+    <element name="m:lambda">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="lambda_fns1_elt" combine="choice">
+    <element name="m:lambda">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="lambda_fns1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="condition_fns1_elt"/>
+  </define>
+  <define name="condition_fns1_elt" combine="choice">
+    <element name="m:lambda">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="condition_fns1_elt" combine="choice">
+    <element name="m:lambda">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="condition_fns1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="factorof_integer1_elt"/>
+  </define>
+  <define name="factorof_integer1_elt" combine="choice">
+    <element name="m:factorof">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="factorial_integer1_elt"/>
+  </define>
+  <define name="factorial_integer1_elt" combine="choice">
+    <element name="m:factorial">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="quotient_integer1_elt"/>
+  </define>
+  <define name="quotient_integer1_elt" combine="choice">
+    <element name="m:quotient">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="remainder_integer1_elt"/>
+  </define>
+  <define name="remainder_integer1_elt" combine="choice">
+    <element name="m:rem">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="interval_interval1_elt"/>
+  </define>
+  <define name="interval_interval1_elt" combine="choice">
+    <element name="m:interval">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>closed</value>
+            <value>open</value>
+            <value>open-closed</value>
+            <value>closed-open</value>
+            <value>integer</value>
+          </choice>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="interval_interval1_elt" combine="choice">
+    <element name="m:interval">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>closed</value>
+            <value>open</value>
+            <value>open-closed</value>
+            <value>closed-open</value>
+            <value>integer</value>
+          </choice>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="interval_interval1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="interval_oo_interval1_elt"/>
+  </define>
+  <define name="interval_oo_interval1_elt" combine="choice">
+    <element name="m:interval">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="closure">
+        <value>open</value>
+      </attribute>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="interval_cc_interval1_elt"/>
+  </define>
+  <define name="interval_cc_interval1_elt" combine="choice">
+    <element name="m:interval">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="closure">
+        <value>closed</value>
+      </attribute>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="interval_oc_interval1_elt"/>
+  </define>
+  <define name="interval_oc_interval1_elt" combine="choice">
+    <element name="m:interval">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="closure">
+        <value>open-closed</value>
+      </attribute>
+      <ref name="ContExp"/>
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="interval_co_interval1_elt"/>
+  </define>
+  <define name="interval_co_interval1_elt" combine="choice">
+    <element name="m:interval">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="closure">
+        <value>closed-open</value>
+      </attribute>
+      <ref name="ContExp"/>
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="limit_limit1_elt"/>
+  </define>
+  <define name="limit_limit1_elt" combine="choice">
+    <element name="m:limit">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="limit_limit1_elt"/>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="above_limit1_elt"/>
+  </define>
+  <define name="above_limit1_elt" combine="choice">
+    <element name="m:above">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="below_limit1_elt"/>
+  </define>
+  <define name="below_limit1_elt" combine="choice">
+    <element name="m:below">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="null_limit1_elt"/>
+  </define>
+  <define name="null_limit1_elt" combine="choice">
+    <element name="m:null">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="tendsto_limit1_elt"/>
+  </define>
+  <define name="tendsto_limit1_elt" combine="choice">
+    <element name="m:tendsto">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>above</value>
+            <value>below</value>
+            <value>two-sided</value>
+            <ref name="MathMLType"/>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="vectorproduct_linalg1_elt"/>
+  </define>
+  <define name="vectorproduct_linalg1_elt" combine="choice">
+    <element name="m:vectorproduct">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="scalarproduct_linalg1_elt"/>
+  </define>
+  <define name="scalarproduct_linalg1_elt" combine="choice">
+    <element name="m:scalarproduct">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="scalarproduct_linalg1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="outerproduct_linalg1_elt"/>
+  </define>
+  <define name="outerproduct_linalg1_elt" combine="choice">
+    <element name="m:outerproduct">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="outerproduct_linalg1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="transpose_linalg1_elt"/>
+  </define>
+  <define name="transpose_linalg1_elt" combine="choice">
+    <element name="m:transpose">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="determinant_linalg1_elt"/>
+  </define>
+  <define name="determinant_linalg1_elt" combine="choice">
+    <element name="m:determinant">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="vector_selector_linalg1_elt"/>
+  </define>
+  <define name="vector_selector_linalg1_elt" combine="choice">
+    <element name="m:selector">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="vector_linalg2_elt"/>
+  </define>
+  <define name="vector_linalg2_elt" combine="choice">
+    <element name="m:vector">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>row</value>
+            <ref name="MathMLType"/>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="vector_linalg2_elt" combine="choice">
+    <element name="m:vector">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>row</value>
+            <ref name="MathMLType"/>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="vector_linalg2_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="matrixrow_linalg2_elt"/>
+  </define>
+  <define name="matrixrow_linalg2_elt" combine="choice">
+    <element name="m:matrixrow">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="matrixrow_linalg2_elt" combine="choice">
+    <element name="m:matrixrow">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="matrixrow_linalg2_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="matrix_linalg2_elt"/>
+  </define>
+  <define name="matrix_linalg2_elt" combine="choice">
+    <element name="m:matrix">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>real</value>
+            <value>complex</value>
+            <value>integer</value>
+            <value>symbolic</value>
+            <ref name="MathMLType"/>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="matrix_linalg2_elt" combine="choice">
+    <element name="m:matrix">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>real</value>
+            <value>complex</value>
+            <value>integer</value>
+            <value>symbolic</value>
+            <ref name="MathMLType"/>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="matrix_linalg2_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="vector_linalg3_elt"/>
+  </define>
+  <define name="vector_linalg3_elt" combine="choice">
+    <element name="m:vector">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>column</value>
+            <ref name="MathMLType"/>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="vector_linalg3_elt" combine="choice">
+    <element name="m:vector">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>column</value>
+            <ref name="MathMLType"/>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="vector_linalg3_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="matrixcolumn_linalg3_elt"/>
+  </define>
+  <define name="matrixcolumn_linalg3_elt" combine="choice">
+    <element name="m:matrixcolumn">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="matrix_linalg3_elt"/>
+  </define>
+  <define name="matrix_linalg3_elt" combine="choice">
+    <element name="m:matrix">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="vector_linalg6_elt"/>
+  </define>
+  <define name="vector_linalg6_elt" combine="choice">
+    <element name="m:vector">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>row</value>
+            <ref name="MathMLType"/>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="vector_linalg6_elt" combine="choice">
+    <element name="m:vector">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>row</value>
+            <ref name="MathMLType"/>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="vector_linalg6_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="matrix_linalg6_elt"/>
+  </define>
+  <define name="matrix_linalg6_elt" combine="choice">
+    <element name="m:matrix">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>real</value>
+            <value>complex</value>
+            <value>integer</value>
+            <value>symbolic</value>
+            <ref name="MathMLType"/>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="matrix_linalg6_elt" combine="choice">
+    <element name="m:matrix">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>real</value>
+            <value>complex</value>
+            <value>integer</value>
+            <value>symbolic</value>
+            <ref name="MathMLType"/>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="matrix_linalg6_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="list_list1_elt"/>
+  </define>
+  <define name="list_list1_elt" combine="choice">
+    <element name="m:list">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="order">
+          <choice>
+            <value>lexicographic</value>
+            <value>numeric</value>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="list_list1_elt" combine="choice">
+    <element name="m:list">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="order">
+          <choice>
+            <value>lexicographic</value>
+            <value>numeric</value>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="list_list1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="list_selector_list2_elt"/>
+  </define>
+  <define name="list_selector_list2_elt" combine="choice">
+    <element name="m:selector">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="equivalent_logic1_elt"/>
+  </define>
+  <define name="equivalent_logic1_elt" combine="choice">
+    <element name="m:equivalent">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="equivalent_logic1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="not_logic1_elt"/>
+  </define>
+  <define name="not_logic1_elt" combine="choice">
+    <element name="m:not">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="and_logic1_elt"/>
+  </define>
+  <define name="and_logic1_elt" combine="choice">
+    <element name="m:and">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="and_logic1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="xor_logic1_elt"/>
+  </define>
+  <define name="xor_logic1_elt" combine="choice">
+    <element name="m:xor">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="xor_logic1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="or_logic1_elt"/>
+  </define>
+  <define name="or_logic1_elt" combine="choice">
+    <element name="m:or">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="or_logic1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="implies_logic1_elt"/>
+  </define>
+  <define name="implies_logic1_elt" combine="choice">
+    <element name="m:implies">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="true_logic1_elt"/>
+  </define>
+  <define name="true_logic1_elt" combine="choice">
+    <element name="m:true">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="false_logic1_elt"/>
+  </define>
+  <define name="false_logic1_elt" combine="choice">
+    <element name="m:false">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.semantic-attribution" combine="choice">
+    <ref name="type_mathmltypes_elt"/>
+  </define>
+  <define name="type_mathmltypes_elt" combine="choice">
+    <element name="m:type">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="min_minmax1_elt"/>
+  </define>
+  <define name="min_minmax1_elt" combine="choice">
+    <element name="m:min">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="min_minmax1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="max_minmax1_elt"/>
+  </define>
+  <define name="max_minmax1_elt" combine="choice">
+    <element name="m:max">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="max_minmax1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="cartesian_product_multiset1_elt"/>
+  </define>
+  <define name="cartesian_product_multiset1_elt" combine="choice">
+    <element name="m:cartesianproduct">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="cartesian_product_multiset1_elt"/>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="emptyset_multiset1_elt"/>
+  </define>
+  <define name="emptyset_multiset1_elt" combine="choice">
+    <element name="m:emptyset">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="map_multiset1_elt"/>
+  </define>
+  <define name="map_multiset1_elt" combine="choice">
+    <element name="m:map">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="size_multiset1_elt"/>
+  </define>
+  <define name="size_multiset1_elt" combine="choice">
+    <element name="m:card">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="suchthat_multiset1_elt"/>
+  </define>
+  <define name="suchthat_multiset1_elt" combine="choice">
+    <element name="m:suchthat">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="multiset_multiset1_elt"/>
+  </define>
+  <define name="multiset_multiset1_elt" combine="choice">
+    <element name="m:multiset">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="multiset_multiset1_elt" combine="choice">
+    <element name="m:multiset">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="multiset_multiset1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="intersect_multiset1_elt"/>
+  </define>
+  <define name="intersect_multiset1_elt" combine="choice">
+    <element name="m:intersect">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="intersect_multiset1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="union_multiset1_elt"/>
+  </define>
+  <define name="union_multiset1_elt" combine="choice">
+    <element name="m:union">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="union_multiset1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="setdiff_multiset1_elt"/>
+  </define>
+  <define name="setdiff_multiset1_elt" combine="choice">
+    <element name="m:setdiff">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="subset_multiset1_elt"/>
+  </define>
+  <define name="subset_multiset1_elt" combine="choice">
+    <element name="m:subset">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="subset_multiset1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="in_multiset1_elt"/>
+  </define>
+  <define name="in_multiset1_elt" combine="choice">
+    <element name="m:in">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="notin_multiset1_elt"/>
+  </define>
+  <define name="notin_multiset1_elt" combine="choice">
+    <element name="m:notin">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="prsubset_multiset1_elt"/>
+  </define>
+  <define name="prsubset_multiset1_elt" combine="choice">
+    <element name="m:prsubset">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="prsubset_multiset1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="notsubset_multiset1_elt"/>
+  </define>
+  <define name="notsubset_multiset1_elt" combine="choice">
+    <element name="m:notsubset">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="notprsubset_multiset1_elt"/>
+  </define>
+  <define name="notprsubset_multiset1_elt" combine="choice">
+    <element name="m:notprsubset">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <attribute name="type">
+        <value>multiset</value>
+      </attribute>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="rational_nums1_elt"/>
+  </define>
+  <define name="rational_nums1_elt" combine="choice">
+    <element name="m:rational">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="infinity_nums1_elt"/>
+  </define>
+  <define name="infinity_nums1_elt" combine="choice">
+    <element name="m:infinity">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="e_nums1_elt"/>
+  </define>
+  <define name="e_nums1_elt" combine="choice">
+    <element name="m:exponentiale">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="i_nums1_elt"/>
+  </define>
+  <define name="i_nums1_elt" combine="choice">
+    <element name="m:imaginaryi">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="pi_nums1_elt"/>
+  </define>
+  <define name="pi_nums1_elt" combine="choice">
+    <element name="m:pi">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="gamma_nums1_elt"/>
+  </define>
+  <define name="gamma_nums1_elt" combine="choice">
+    <element name="m:eulergamma">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="NaN_nums1_elt"/>
+  </define>
+  <define name="NaN_nums1_elt" combine="choice">
+    <element name="m:notanumber">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="omtype_omtypes_elt"/>
+  </define>
+  <define name="omtype_omtypes_elt" combine="choice">
+    <element name="m:omtype">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="integer_omtypes_elt"/>
+  </define>
+  <define name="integer_omtypes_elt" combine="choice">
+    <element name="m:integer">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="float_omtypes_elt"/>
+  </define>
+  <define name="float_omtypes_elt" combine="choice">
+    <element name="m:float">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="string_omtypes_elt"/>
+  </define>
+  <define name="string_omtypes_elt" combine="choice">
+    <element name="m:string">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="bytearray_omtypes_elt"/>
+  </define>
+  <define name="bytearray_omtypes_elt" combine="choice">
+    <element name="m:bytearray">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="piecewise_piece1_elt"/>
+  </define>
+  <define name="piecewise_piece1_elt" combine="choice">
+    <element name="m:piecewise">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="piecewise_piece1_elt" combine="choice">
+    <element name="m:piecewise">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="piecewise_piece1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="piece_piece1_elt"/>
+  </define>
+  <define name="piece_piece1_elt" combine="choice">
+    <element name="m:piece">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="piece_piece1_elt" combine="choice">
+    <element name="m:piece">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="piece_piece1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="otherwise_piece1_elt"/>
+  </define>
+  <define name="otherwise_piece1_elt" combine="choice">
+    <element name="m:otherwise">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="otherwise_piece1_elt" combine="choice">
+    <element name="m:otherwise">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="otherwise_piece1_elt"/>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="forall_quant1_elt"/>
+  </define>
+  <define name="forall_quant1_elt" combine="choice">
+    <element name="m:forall">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="exists_quant1_elt"/>
+  </define>
+  <define name="exists_quant1_elt" combine="choice">
+    <element name="m:exists">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="eq_relation1_elt"/>
+  </define>
+  <define name="eq_relation1_elt" combine="choice">
+    <element name="m:eq">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="eq_relation1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="lt_relation1_elt"/>
+  </define>
+  <define name="lt_relation1_elt" combine="choice">
+    <element name="m:lt">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="lt_relation1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="gt_relation1_elt"/>
+  </define>
+  <define name="gt_relation1_elt" combine="choice">
+    <element name="m:gt">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="gt_relation1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="neq_relation1_elt"/>
+  </define>
+  <define name="neq_relation1_elt" combine="choice">
+    <element name="m:neq">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="leq_relation1_elt"/>
+  </define>
+  <define name="leq_relation1_elt" combine="choice">
+    <element name="m:leq">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="leq_relation1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="geq_relation1_elt"/>
+  </define>
+  <define name="geq_relation1_elt" combine="choice">
+    <element name="m:geq">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="geq_relation1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="approx_relation1_elt"/>
+  </define>
+  <define name="approx_relation1_elt" combine="choice">
+    <element name="m:approx">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="approx_relation1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="ceiling_rounding1_elt"/>
+  </define>
+  <define name="ceiling_rounding1_elt" combine="choice">
+    <element name="m:ceiling">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="floor_rounding1_elt"/>
+  </define>
+  <define name="floor_rounding1_elt" combine="choice">
+    <element name="m:floor">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="MathMLType"/>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="trunc_rounding1_elt"/>
+  </define>
+  <define name="trunc_rounding1_elt" combine="choice">
+    <element name="m:trunc">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="round_rounding1_elt"/>
+  </define>
+  <define name="round_rounding1_elt" combine="choice">
+    <element name="m:round">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="mean_s_data1_elt"/>
+  </define>
+  <define name="mean_s_data1_elt" combine="choice">
+    <element name="m:mean">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="sdev_s_data1_elt"/>
+  </define>
+  <define name="sdev_s_data1_elt" combine="choice">
+    <element name="m:sdev">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="variance_s_data1_elt"/>
+  </define>
+  <define name="variance_s_data1_elt" combine="choice">
+    <element name="m:variance">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="mode_s_data1_elt"/>
+  </define>
+  <define name="mode_s_data1_elt" combine="choice">
+    <element name="m:mode">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="median_s_data1_elt"/>
+  </define>
+  <define name="median_s_data1_elt" combine="choice">
+    <element name="m:median">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="moment_s_data1_elt"/>
+  </define>
+  <define name="moment_s_data1_elt" combine="choice">
+    <element name="m:moment">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="mean_s_dist1_elt"/>
+  </define>
+  <define name="mean_s_dist1_elt" combine="choice">
+    <element name="m:mean">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="sdev_s_dist1_elt"/>
+  </define>
+  <define name="sdev_s_dist1_elt" combine="choice">
+    <element name="m:sdev">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="variance_s_dist1_elt"/>
+  </define>
+  <define name="variance_s_dist1_elt" combine="choice">
+    <element name="m:variance">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="moment_s_dist1_elt"/>
+  </define>
+  <define name="moment_s_dist1_elt" combine="choice">
+    <element name="m:moment">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="cartesian_product_set1_elt"/>
+  </define>
+  <define name="cartesian_product_set1_elt" combine="choice">
+    <element name="m:cartesianproduct">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="cartesian_product_set1_elt"/>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="emptyset_set1_elt"/>
+  </define>
+  <define name="emptyset_set1_elt" combine="choice">
+    <element name="m:emptyset">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="map_set1_elt"/>
+  </define>
+  <define name="map_set1_elt" combine="choice">
+    <element name="m:map">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="size_set1_elt"/>
+  </define>
+  <define name="size_set1_elt" combine="choice">
+    <element name="m:card">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="suchthat_set1_elt"/>
+  </define>
+  <define name="suchthat_set1_elt" combine="choice">
+    <element name="m:suchthat">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="set_set1_elt"/>
+  </define>
+  <define name="set_set1_elt" combine="choice">
+    <element name="m:set">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="set_set1_elt" combine="choice">
+    <element name="m:set">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+      <zeroOrMore>
+        <ref name="bvar"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="qualifier"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="container" combine="choice">
+    <ref name="set_set1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="intersect_set1_elt"/>
+  </define>
+  <define name="intersect_set1_elt" combine="choice">
+    <element name="m:intersect">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="intersect_set1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="union_set1_elt"/>
+  </define>
+  <define name="union_set1_elt" combine="choice">
+    <element name="m:union">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="union_set1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="setdiff_set1_elt"/>
+  </define>
+  <define name="setdiff_set1_elt" combine="choice">
+    <element name="m:setdiff">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="subset_set1_elt"/>
+  </define>
+  <define name="subset_set1_elt" combine="choice">
+    <element name="m:subset">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="subset_set1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="in_set1_elt"/>
+  </define>
+  <define name="in_set1_elt" combine="choice">
+    <element name="m:in">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="notin_set1_elt"/>
+  </define>
+  <define name="notin_set1_elt" combine="choice">
+    <element name="m:notin">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="prsubset_set1_elt"/>
+  </define>
+  <define name="prsubset_set1_elt" combine="choice">
+    <element name="m:prsubset">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.binder" combine="choice">
+    <ref name="prsubset_set1_elt"/>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="notsubset_set1_elt"/>
+  </define>
+  <define name="notsubset_set1_elt" combine="choice">
+    <element name="m:notsubset">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="notprsubset_set1_elt"/>
+  </define>
+  <define name="notprsubset_set1_elt" combine="choice">
+    <element name="m:notprsubset">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <choice>
+            <value>normal</value>
+            <value>multiset</value>
+          </choice>
+        </attribute>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="P_setname1_elt"/>
+  </define>
+  <define name="P_setname1_elt" combine="choice">
+    <element name="m:primes">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="N_setname1_elt"/>
+  </define>
+  <define name="N_setname1_elt" combine="choice">
+    <element name="m:naturalnumbers">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="Z_setname1_elt"/>
+  </define>
+  <define name="Z_setname1_elt" combine="choice">
+    <element name="m:integers">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="rationials_setname1_elt"/>
+  </define>
+  <define name="rationials_setname1_elt" combine="choice">
+    <element name="m:rationals">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="R_setname1_elt"/>
+  </define>
+  <define name="R_setname1_elt" combine="choice">
+    <element name="m:reals">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.constant" combine="choice">
+    <ref name="complexes_setname1_elt"/>
+  </define>
+  <define name="complexes_setname1_elt" combine="choice">
+    <element name="m:complexes">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="log_transc1_elt"/>
+  </define>
+  <define name="log_transc1_elt" combine="choice">
+    <element name="m:log">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="ln_transc1_elt"/>
+  </define>
+  <define name="ln_transc1_elt" combine="choice">
+    <element name="m:ln">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="exp_transc1_elt"/>
+  </define>
+  <define name="exp_transc1_elt" combine="choice">
+    <element name="m:exp">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="sin_transc1_elt"/>
+  </define>
+  <define name="sin_transc1_elt" combine="choice">
+    <element name="m:sin">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="cos_transc1_elt"/>
+  </define>
+  <define name="cos_transc1_elt" combine="choice">
+    <element name="m:cos">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="tan_transc1_elt"/>
+  </define>
+  <define name="tan_transc1_elt" combine="choice">
+    <element name="m:tan">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="sec_transc1_elt"/>
+  </define>
+  <define name="sec_transc1_elt" combine="choice">
+    <element name="m:sec">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="csc_transc1_elt"/>
+  </define>
+  <define name="csc_transc1_elt" combine="choice">
+    <element name="m:csc">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="cot_transc1_elt"/>
+  </define>
+  <define name="cot_transc1_elt" combine="choice">
+    <element name="m:cot">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="sinh_transc1_elt"/>
+  </define>
+  <define name="sinh_transc1_elt" combine="choice">
+    <element name="m:sinh">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="cosh_transc1_elt"/>
+  </define>
+  <define name="cosh_transc1_elt" combine="choice">
+    <element name="m:cosh">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="tanh_transc1_elt"/>
+  </define>
+  <define name="tanh_transc1_elt" combine="choice">
+    <element name="m:tanh">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="sech_transc1_elt"/>
+  </define>
+  <define name="sech_transc1_elt" combine="choice">
+    <element name="m:sech">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="csch_transc1_elt"/>
+  </define>
+  <define name="csch_transc1_elt" combine="choice">
+    <element name="m:csch">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="coth_transc1_elt"/>
+  </define>
+  <define name="coth_transc1_elt" combine="choice">
+    <element name="m:coth">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="arcsin_transc1_elt"/>
+  </define>
+  <define name="arcsin_transc1_elt" combine="choice">
+    <element name="m:arcsin">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="arccos_transc1_elt"/>
+  </define>
+  <define name="arccos_transc1_elt" combine="choice">
+    <element name="m:arccos">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="arctan_transc1_elt"/>
+  </define>
+  <define name="arctan_transc1_elt" combine="choice">
+    <element name="m:arctan">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="arcsec_transc1_elt"/>
+  </define>
+  <define name="arcsec_transc1_elt" combine="choice">
+    <element name="m:arcsec">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="arccsc_transc1_elt"/>
+  </define>
+  <define name="arccsc_transc1_elt" combine="choice">
+    <element name="m:arccsc">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="arccot_transc1_elt"/>
+  </define>
+  <define name="arccot_transc1_elt" combine="choice">
+    <element name="m:arccot">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="arcsinh_transc1_elt"/>
+  </define>
+  <define name="arcsinh_transc1_elt" combine="choice">
+    <element name="m:arcsinh">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="arccosh_transc1_elt"/>
+  </define>
+  <define name="arccosh_transc1_elt" combine="choice">
+    <element name="m:arccosh">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="arctanh_transc1_elt"/>
+  </define>
+  <define name="arctanh_transc1_elt" combine="choice">
+    <element name="m:arctanh">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="arcsech_transc1_elt"/>
+  </define>
+  <define name="arcsech_transc1_elt" combine="choice">
+    <element name="m:arcsech">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="arccsch_transc1_elt"/>
+  </define>
+  <define name="arccsch_transc1_elt" combine="choice">
+    <element name="m:arccsch">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="arccoth_transc1_elt"/>
+  </define>
+  <define name="arccoth_transc1_elt" combine="choice">
+    <element name="m:arccoth">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="divergence_veccalc1_elt"/>
+  </define>
+  <define name="divergence_veccalc1_elt" combine="choice">
+    <element name="m:divergence">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="grad_veccalc1_elt"/>
+  </define>
+  <define name="grad_veccalc1_elt" combine="choice">
+    <element name="m:grad">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="curl_veccalc1_elt"/>
+  </define>
+  <define name="curl_veccalc1_elt" combine="choice">
+    <element name="m:curl">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="opel.application" combine="choice">
+    <ref name="Laplacian_veccalc1_elt"/>
+  </define>
+  <define name="Laplacian_veccalc1_elt" combine="choice">
+    <element name="m:laplacian">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="Definition.attrib"/>
+      </optional>
+    </element>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/mathml3-cds.rnc b/app/report/mathml3/mathml3-cds.rnc
new file mode 100644
index 0000000..4d92467
--- /dev/null
+++ b/app/report/mathml3/mathml3-cds.rnc
@@ -0,0 +1,67 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2008 W3C (MIT, ERCIM, Keio)
+# 
+#     Use and distribution of this code are permitted under the terms
+#     W3C Software Notice and License
+#     http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+#
+#
+#     Revision:   $Id: mathml3-cds.rnc,v 1.2 2008/11/15 22:00:48 dcarlis Exp $
+#
+#    Update to MathML3 and Relax NG: David Carlisle and Michael Kohlhase
+
+default namespace m = "http://www.w3.org/1998/Math/MathML"
+
+# some elements were containers in MathML2, so they get a separate treatment,
+# that can be extended in mathml3-pragmatic.rnc
+
+# we augment the content of an apply element
+apply.content |= (cd.token.unary.class,ContExp)|
+	                  (cd.token.binary.class,ContExp,ContExp)|
+			  (cd.token.nary.class,ContExp+)|
+			  cd.container.class
+
+# of the bind element 
+binder.class |= cd.token.binder.class
+
+# now we allow all tokens (except the binding symbols) to appear on their own
+ContExp |= cd.token.unary.class|cd.token.binary.class|cd.token.nary.class|cd.token.class
+
+#now we allow the containers as well. 
+ContExp |= cd.container.class
+
+# we set the default content type for tokens
+Token.type = Definition.attrib, MathML.Common.attrib
+
+# also set up MathMLtype, which is used in the CDs 
+#ednote(rnc:mathmltype) fudge it for now
+MathMLtype = xsd:string
+
+# simple arity checking for Tokens from the MathML3 CDs. 
+# we set up the categories to be extended by the CD-generated grammars
+cd.token.class =  notAllowed
+cd.token.unary.class = notAllowed
+cd.token.binary.class = notAllowed
+cd.token.nary.class = notAllowed
+cd.token.binder.class = notAllowed
+cd.token.key.class = notAllowed
+cd.token.error.class = notAllowed
+cd.container.class = notAllowed	
+
+# then we include the generated ones
+
+include "algebra-logic.rnc"
+include "basic-content-elements.rnc" 
+include "calculus_veccalc.rnc"
+include "constants.rnc" 
+include "errors.rnc" 
+include "linear_algebra.rnc" 
+include "relations.rnc" 
+include "sequences_series.rnc"
+include "sets.rnc" 
+include "specfun.rnc" 
+include "statistics.rnc"
+
diff --git a/app/report/mathml3/mathml3-cds.rng b/app/report/mathml3/mathml3-cds.rng
new file mode 100644
index 0000000..1a1b709
--- /dev/null
+++ b/app/report/mathml3/mathml3-cds.rng
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+      This is the Mathematical Markup Language (MathML) 3.0, an XML
+      application for describing mathematical notation and capturing
+      both its structure and content.
+  
+      Copyright 1998-2007 World Wide Web Consortium
+         (Massachusetts Institute of Technology, Institut National de
+          Recherche en Informatique et en Automatique, Keio University).
+          All Rights Reserved.
+  
+      Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+      and its accompanying documentation for any purpose and without fee is
+      hereby granted in perpetuity, provided that the above copyright notice
+      and this paragraph appear in all copies.  The copyright holders make
+      no representation about the suitability of the Schema for any purpose.
+  
+      This file contains the grammar driver for CD-based arity checking
+      It is provided "as is" without expressed or implied warranty.
+  
+      Revision:   $Id: mathml3-cds.rng,v 1.1 2007/12/11 15:59:27 dcarlis Exp $
+      Author: Michael Kohlhase http://kwarc.info/kohlhase
+-->
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <!--
+    some elements were containers in MathML2, so they get a separate treatment,
+    that can be extended in mathml3-pragmatic.rnc
+  -->
+  <!-- we augment the content of an apply element -->
+  <define name="apply.content" combine="choice">
+    <choice>
+      <group>
+        <ref name="cd.token.unary.class"/>
+        <ref name="ContExp"/>
+      </group>
+      <group>
+        <ref name="cd.token.binary.class"/>
+        <ref name="ContExp"/>
+        <ref name="ContExp"/>
+      </group>
+      <group>
+        <ref name="cd.token.nary.class"/>
+        <oneOrMore>
+          <ref name="ContExp"/>
+        </oneOrMore>
+      </group>
+      <ref name="cd.container.class"/>
+    </choice>
+  </define>
+  <!-- of the bind element -->
+  <define name="binder.class" combine="choice">
+    <ref name="cd.token.binder.class"/>
+  </define>
+  <!-- now we allow all tokens (except the binding symbols) to appear on their own -->
+  <define name="ContExp" combine="choice">
+    <choice>
+      <ref name="cd.token.unary.class"/>
+      <ref name="cd.token.binary.class"/>
+      <ref name="cd.token.nary.class"/>
+      <ref name="cd.token.class"/>
+    </choice>
+  </define>
+  <!-- now we allow the containers as well. -->
+  <define name="ContExp" combine="choice">
+    <ref name="cd.container.class"/>
+  </define>
+  <!-- we set the default content type for tokens -->
+  <define name="Token.type">
+    <ref name="Definition.attrib"/>
+    <ref name="MathML.Common.attrib"/>
+  </define>
+  <!--
+    also set up MathMLtype, which is used in the CDs 
+    ednote(rnc:mathmltype) fudge it for now
+  -->
+  <define name="MathMLtype">
+    <data type="string"/>
+  </define>
+  <!--
+    simple arity checking for Tokens from the MathML3 CDs. 
+    we set up the categories to be extended by the CD-generated grammars
+  -->
+  <define name="cd.token.class">
+    <notAllowed/>
+  </define>
+  <define name="cd.token.unary.class">
+    <notAllowed/>
+  </define>
+  <define name="cd.token.binary.class">
+    <notAllowed/>
+  </define>
+  <define name="cd.token.nary.class">
+    <notAllowed/>
+  </define>
+  <define name="cd.token.binder.class">
+    <notAllowed/>
+  </define>
+  <define name="cd.token.key.class">
+    <notAllowed/>
+  </define>
+  <define name="cd.token.error.class">
+    <notAllowed/>
+  </define>
+  <define name="cd.container.class">
+    <notAllowed/>
+  </define>
+  <!-- then we include the generated ones -->
+  <include href="algebra-logic.rng"/>
+  <include href="basic-content-elements.rng"/>
+  <include href="calculus_veccalc.rng"/>
+  <include href="constants.rng"/>
+  <include href="errors.rng"/>
+  <include href="linear_algebra.rng"/>
+  <include href="relations.rng"/>
+  <include href="sequences_series.rng"/>
+  <include href="sets.rng"/>
+  <include href="specfun.rng"/>
+  <include href="statistics.rng"/>
+</grammar>
diff --git a/app/report/mathml3/mathml3-common.rnc b/app/report/mathml3/mathml3-common.rnc
new file mode 100644
index 0000000..719f190
--- /dev/null
+++ b/app/report/mathml3/mathml3-common.rnc
@@ -0,0 +1,84 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
+# 
+#     Use and distribution of this code are permitted under the terms
+#     W3C Software Notice and License
+#     http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+
+default namespace m = "http://www.w3.org/1998/Math/MathML"
+namespace local = ""
+
+start = math
+
+math = element math {math.attributes,MathExpression*}
+MathExpression = semantics
+
+NonMathMLAtt = attribute (* - (local:*|m:*)) {xsd:string} 
+
+CommonDeprecatedAtt = attribute other {text}?
+
+CommonAtt = attribute id {xsd:ID}?,
+            attribute xref {text}?,
+            attribute class {xsd:NMTOKENS}?,
+            attribute style {xsd:string}?,
+            attribute href {xsd:anyURI}?,
+            CommonDeprecatedAtt,
+            NonMathMLAtt*
+
+
+math.attributes = CommonAtt,
+               attribute display {"block" | "inline"}?,
+               attribute maxwidth {length}?,
+               attribute overflow {"linebreak" | "scroll" | "elide" | "truncate" | "scale"}?,
+               attribute altimg {xsd:anyURI}?,
+               attribute altimg-width {length}?,
+               attribute altimg-height {length}?,
+               attribute altimg-valign {length | "top" | "middle" | "bottom"}?,
+               attribute alttext {text}?,
+               attribute cdgroup {xsd:anyURI}?,
+               math.deprecatedattributes
+
+# the mathml3-presentation schema  adds additional attributes
+# to the math element, all those valid on mstyle
+
+math.deprecatedattributes = attribute mode {xsd:string}?,
+                            attribute macros {xsd:string}?
+
+
+name = attribute name {xsd:NCName}
+cd = attribute cd {xsd:NCName}
+
+src = attribute src {xsd:anyURI}?
+
+annotation = element annotation {annotation.attributes,text}
+                     
+annotation-xml.model = (MathExpression|anyElement)*
+
+anyElement =  element (* - m:*) {(attribute * {text}|text| anyElement)*}
+
+annotation-xml = element annotation-xml {annotation.attributes,
+                                         annotation-xml.model}
+annotation.attributes = CommonAtt,
+	                cd?,
+                        name?,
+                        DefEncAtt,
+                        src?
+
+DefEncAtt = attribute encoding {xsd:string}?,
+            attribute definitionURL {xsd:anyURI}?
+
+semantics = element semantics {semantics.attributes,
+                               MathExpression, 
+                              (annotation|annotation-xml)*}
+semantics.attributes = CommonAtt,DefEncAtt,cd?,name?
+
+
+
+length = xsd:string {
+  pattern = '\s*((-?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(e[mx]|in|cm|mm|p[xtc]|%)?)|(negative)?((very){0,2}thi(n|ck)|medium)mathspace)\s*' 
+}
+
diff --git a/app/report/mathml3/mathml3-common.rng b/app/report/mathml3/mathml3-common.rng
new file mode 100644
index 0000000..f598d44
--- /dev/null
+++ b/app/report/mathml3/mathml3-common.rng
@@ -0,0 +1,257 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+      This is the Mathematical Markup Language (MathML) 3.0, an XML
+      application for describing mathematical notation and capturing
+      both its structure and content.
+  
+      Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
+  
+      Use and distribution of this code are permitted under the terms
+      W3C Software Notice and License
+      http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+<grammar ns="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <start>
+    <ref name="math"/>
+  </start>
+  <define name="math">
+    <element name="math">
+      <ref name="math.attributes"/>
+      <zeroOrMore>
+        <ref name="MathExpression"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="MathExpression">
+    <ref name="semantics"/>
+  </define>
+  <define name="NonMathMLAtt">
+    <attribute>
+      <anyName>
+        <except>
+          <nsName ns=""/>
+          <nsName/>
+        </except>
+      </anyName>
+      <data type="string"/>
+    </attribute>
+  </define>
+  <define name="CommonDeprecatedAtt">
+    <optional>
+      <attribute name="other"/>
+    </optional>
+  </define>
+  <define name="CommonAtt">
+    <optional>
+      <attribute name="id">
+        <data type="ID"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="xref"/>
+    </optional>
+    <optional>
+      <attribute name="class">
+        <data type="NMTOKENS"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="style">
+        <data type="string"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="href">
+        <data type="anyURI"/>
+      </attribute>
+    </optional>
+    <ref name="CommonDeprecatedAtt"/>
+    <zeroOrMore>
+      <ref name="NonMathMLAtt"/>
+    </zeroOrMore>
+  </define>
+  <define name="math.attributes">
+    <ref name="CommonAtt"/>
+    <optional>
+      <attribute name="display">
+        <choice>
+          <value>block</value>
+          <value>inline</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="maxwidth">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="overflow">
+        <choice>
+          <value>linebreak</value>
+          <value>scroll</value>
+          <value>elide</value>
+          <value>truncate</value>
+          <value>scale</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="altimg">
+        <data type="anyURI"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="altimg-width">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="altimg-height">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="altimg-valign">
+        <choice>
+          <ref name="length"/>
+          <value>top</value>
+          <value>middle</value>
+          <value>bottom</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="alttext"/>
+    </optional>
+    <optional>
+      <attribute name="cdgroup">
+        <data type="anyURI"/>
+      </attribute>
+    </optional>
+    <ref name="math.deprecatedattributes"/>
+  </define>
+  <!--
+    the mathml3-presentation schema  adds additional attributes
+    to the math element, all those valid on mstyle
+  -->
+  <define name="math.deprecatedattributes">
+    <optional>
+      <attribute name="mode">
+        <data type="string"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="macros">
+        <data type="string"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="name">
+    <attribute name="name">
+      <data type="NCName"/>
+    </attribute>
+  </define>
+  <define name="cd">
+    <attribute name="cd">
+      <data type="NCName"/>
+    </attribute>
+  </define>
+  <define name="src">
+    <optional>
+      <attribute name="src">
+        <data type="anyURI"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="annotation">
+    <element name="annotation">
+      <ref name="annotation.attributes"/>
+      <text/>
+    </element>
+  </define>
+  <define name="annotation-xml.model">
+    <zeroOrMore>
+      <choice>
+        <ref name="MathExpression"/>
+        <ref name="anyElement"/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="anyElement">
+    <element>
+      <anyName>
+        <except>
+          <nsName/>
+        </except>
+      </anyName>
+      <zeroOrMore>
+        <choice>
+          <attribute>
+            <anyName/>
+          </attribute>
+          <text/>
+          <ref name="anyElement"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="annotation-xml">
+    <element name="annotation-xml">
+      <ref name="annotation.attributes"/>
+      <ref name="annotation-xml.model"/>
+    </element>
+  </define>
+  <define name="annotation.attributes">
+    <ref name="CommonAtt"/>
+    <optional>
+      <ref name="cd"/>
+    </optional>
+    <optional>
+      <ref name="name"/>
+    </optional>
+    <ref name="DefEncAtt"/>
+    <optional>
+      <ref name="src"/>
+    </optional>
+  </define>
+  <define name="DefEncAtt">
+    <optional>
+      <attribute name="encoding">
+        <data type="string"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="definitionURL">
+        <data type="anyURI"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="semantics">
+    <element name="semantics">
+      <ref name="semantics.attributes"/>
+      <ref name="MathExpression"/>
+      <zeroOrMore>
+        <choice>
+          <ref name="annotation"/>
+          <ref name="annotation-xml"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="semantics.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="DefEncAtt"/>
+    <optional>
+      <ref name="cd"/>
+    </optional>
+    <optional>
+      <ref name="name"/>
+    </optional>
+  </define>
+  <define name="length">
+    <data type="string">
+      <param name="pattern">\s*((-?[0-9]*([0-9]\.?|\.[0-9])[0-9]*(e[mx]|in|cm|mm|p[xtc]|%)?)|(negative)?((very){0,2}thi(n|ck)|medium)mathspace)\s*</param>
+    </data>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/mathml3-content.rnc b/app/report/mathml3/mathml3-content.rnc
new file mode 100644
index 0000000..9603ed4
--- /dev/null
+++ b/app/report/mathml3/mathml3-content.rnc
@@ -0,0 +1,373 @@
+
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
+# 
+#     Use and distribution of this code are permitted under the terms
+#     W3C Software Notice and License
+#     http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+include "mathml3-strict-content.rnc"{
+  cn.content = (text | mglyph | sep | PresentationExpression)* 
+  cn.attributes = CommonAtt, DefEncAtt, attribute type {text}?, base?
+
+  ci.attributes = CommonAtt, DefEncAtt, ci.type?
+  ci.type = attribute type {text}
+  ci.content = (text | mglyph | PresentationExpression)* 
+
+  csymbol.attributes = CommonAtt, DefEncAtt, attribute type {text}?,cd?
+  csymbol.content = (text | mglyph | PresentationExpression)* 
+
+  bvar = element bvar {CommonAtt, ((ci | semantics-ci) & degree?)}
+
+  cbytes.attributes = CommonAtt, DefEncAtt
+
+  cs.attributes = CommonAtt, DefEncAtt
+
+  apply.content = ContExp+ | (ContExp, BvarQ, Qualifier*, ContExp*)
+
+  bind.content = apply.content
+}
+
+base = attribute base {text}
+
+
+sep = element sep {empty}
+PresentationExpression |= notAllowed
+
+
+DomainQ = (domainofapplication|condition|interval|(lowlimit,uplimit?))*
+domainofapplication = element domainofapplication {ContExp}
+condition = element condition {ContExp}
+uplimit = element uplimit {ContExp}
+lowlimit = element lowlimit {ContExp}
+
+Qualifier = DomainQ|degree|momentabout|logbase
+degree = element degree {ContExp}
+momentabout = element momentabout {ContExp}
+logbase = element logbase {ContExp}
+
+type = attribute type {text}
+order = attribute order {"numeric" | "lexicographic"}
+closure = attribute closure {text}
+
+
+ContExp |= piecewise
+
+
+piecewise = element piecewise {CommonAtt, DefEncAtt,(piece* & otherwise?)}
+
+piece = element piece {CommonAtt, DefEncAtt, ContExp, ContExp}
+
+otherwise = element otherwise {CommonAtt, DefEncAtt, ContExp}
+
+
+DeprecatedContExp = reln | fn | declare
+ContExp |= DeprecatedContExp
+
+reln = element reln {ContExp*}
+fn = element fn {ContExp}
+declare = element declare {attribute type {xsd:string}?,
+                           attribute scope {xsd:string}?,
+                           attribute nargs {xsd:nonNegativeInteger}?,
+                           attribute occurrence {"prefix"|"infix"|"function-model"}?,
+                           DefEncAtt, 
+                           ContExp+}
+
+
+interval.class = interval
+ContExp |= interval.class
+
+
+interval = element interval { CommonAtt, DefEncAtt,closure?, ContExp,ContExp}
+
+unary-functional.class = inverse | ident | domain | codomain | image | ln | log | moment
+ContExp |= unary-functional.class
+
+
+inverse = element inverse { CommonAtt, DefEncAtt, empty}
+ident = element ident { CommonAtt, DefEncAtt, empty}
+domain = element domain { CommonAtt, DefEncAtt, empty}
+codomain = element codomain { CommonAtt, DefEncAtt, empty}
+image = element image { CommonAtt, DefEncAtt, empty}
+ln = element ln { CommonAtt, DefEncAtt, empty}
+log = element log { CommonAtt, DefEncAtt, empty}
+moment = element moment { CommonAtt, DefEncAtt, empty}
+
+lambda.class = lambda
+ContExp |= lambda.class
+
+
+lambda = element lambda { CommonAtt, DefEncAtt, BvarQ, DomainQ, ContExp}
+
+nary-functional.class = compose
+ContExp |= nary-functional.class
+
+
+compose = element compose { CommonAtt, DefEncAtt, empty}
+
+binary-arith.class = quotient | divide | minus | power | rem | root
+ContExp |= binary-arith.class
+
+
+quotient = element quotient { CommonAtt, DefEncAtt, empty}
+divide = element divide { CommonAtt, DefEncAtt, empty}
+minus = element minus { CommonAtt, DefEncAtt, empty}
+power = element power { CommonAtt, DefEncAtt, empty}
+rem = element rem { CommonAtt, DefEncAtt, empty}
+root = element root { CommonAtt, DefEncAtt, empty}
+
+unary-arith.class = factorial | minus | root | abs | conjugate | arg | real | imaginary | floor | ceiling | exp
+ContExp |= unary-arith.class
+
+
+factorial = element factorial { CommonAtt, DefEncAtt, empty}
+abs = element abs { CommonAtt, DefEncAtt, empty}
+conjugate = element conjugate { CommonAtt, DefEncAtt, empty}
+arg = element arg { CommonAtt, DefEncAtt, empty}
+real = element real { CommonAtt, DefEncAtt, empty}
+imaginary = element imaginary { CommonAtt, DefEncAtt, empty}
+floor = element floor { CommonAtt, DefEncAtt, empty}
+ceiling = element ceiling { CommonAtt, DefEncAtt, empty}
+exp = element exp { CommonAtt, DefEncAtt, empty}
+
+nary-minmax.class = max | min
+ContExp |= nary-minmax.class
+
+
+max = element max { CommonAtt, DefEncAtt, empty}
+min = element min { CommonAtt, DefEncAtt, empty}
+
+nary-arith.class = plus | times | gcd | lcm
+ContExp |= nary-arith.class
+
+
+plus = element plus { CommonAtt, DefEncAtt, empty}
+times = element times { CommonAtt, DefEncAtt, empty}
+gcd = element gcd { CommonAtt, DefEncAtt, empty}
+lcm = element lcm { CommonAtt, DefEncAtt, empty}
+
+nary-logical.class = and | or | xor
+ContExp |= nary-logical.class
+
+
+and = element and { CommonAtt, DefEncAtt, empty}
+or = element or { CommonAtt, DefEncAtt, empty}
+xor = element xor { CommonAtt, DefEncAtt, empty}
+
+unary-logical.class = not
+ContExp |= unary-logical.class
+
+
+not = element not { CommonAtt, DefEncAtt, empty}
+
+binary-logical.class = implies | equivalent
+ContExp |= binary-logical.class
+
+
+implies = element implies { CommonAtt, DefEncAtt, empty}
+equivalent = element equivalent { CommonAtt, DefEncAtt, empty}
+
+quantifier.class = forall | exists
+ContExp |= quantifier.class
+
+
+forall = element forall { CommonAtt, DefEncAtt, empty}
+exists = element exists { CommonAtt, DefEncAtt, empty}
+
+nary-reln.class = eq | gt | lt | geq | leq
+ContExp |= nary-reln.class
+
+
+eq = element eq { CommonAtt, DefEncAtt, empty}
+gt = element gt { CommonAtt, DefEncAtt, empty}
+lt = element lt { CommonAtt, DefEncAtt, empty}
+geq = element geq { CommonAtt, DefEncAtt, empty}
+leq = element leq { CommonAtt, DefEncAtt, empty}
+
+binary-reln.class = neq | approx | factorof | tendsto
+ContExp |= binary-reln.class
+
+
+neq = element neq { CommonAtt, DefEncAtt, empty}
+approx = element approx { CommonAtt, DefEncAtt, empty}
+factorof = element factorof { CommonAtt, DefEncAtt, empty}
+tendsto = element tendsto { CommonAtt, DefEncAtt, type?, empty}
+
+int.class = int
+ContExp |= int.class
+
+
+int = element int { CommonAtt, DefEncAtt, empty}
+
+Differential-Operator.class = diff
+ContExp |= Differential-Operator.class
+
+
+diff = element diff { CommonAtt, DefEncAtt, empty}
+
+partialdiff.class = partialdiff
+ContExp |= partialdiff.class
+
+
+partialdiff = element partialdiff { CommonAtt, DefEncAtt, empty}
+
+unary-veccalc.class = divergence | grad | curl | laplacian
+ContExp |= unary-veccalc.class
+
+
+divergence = element divergence { CommonAtt, DefEncAtt, empty}
+grad = element grad { CommonAtt, DefEncAtt, empty}
+curl = element curl { CommonAtt, DefEncAtt, empty}
+laplacian = element laplacian { CommonAtt, DefEncAtt, empty}
+
+nary-setlist-constructor.class = set | \list
+ContExp |= nary-setlist-constructor.class
+
+
+set = element set { CommonAtt, DefEncAtt, type?, BvarQ*, DomainQ*, ContExp*}
+\list = element \list { CommonAtt, DefEncAtt, order?, BvarQ*, DomainQ*, ContExp*}
+
+nary-set.class = union | intersect | cartesianproduct
+ContExp |= nary-set.class
+
+
+union = element union { CommonAtt, DefEncAtt, empty}
+intersect = element intersect { CommonAtt, DefEncAtt, empty}
+cartesianproduct = element cartesianproduct { CommonAtt, DefEncAtt, empty}
+
+binary-set.class = in | notin | notsubset | notprsubset | setdiff
+ContExp |= binary-set.class
+
+
+in = element in { CommonAtt, DefEncAtt, empty}
+notin = element notin { CommonAtt, DefEncAtt, empty}
+notsubset = element notsubset { CommonAtt, DefEncAtt, empty}
+notprsubset = element notprsubset { CommonAtt, DefEncAtt, empty}
+setdiff = element setdiff { CommonAtt, DefEncAtt, empty}
+
+nary-set-reln.class = subset | prsubset
+ContExp |= nary-set-reln.class
+
+
+subset = element subset { CommonAtt, DefEncAtt, empty}
+prsubset = element prsubset { CommonAtt, DefEncAtt, empty}
+
+unary-set.class = card
+ContExp |= unary-set.class
+
+
+card = element card { CommonAtt, DefEncAtt, empty}
+
+sum.class = sum
+ContExp |= sum.class
+
+
+sum = element sum { CommonAtt, DefEncAtt, empty}
+
+product.class = product
+ContExp |= product.class
+
+
+product = element product { CommonAtt, DefEncAtt, empty}
+
+limit.class = limit
+ContExp |= limit.class
+
+
+limit = element limit { CommonAtt, DefEncAtt, empty}
+
+unary-elementary.class = sin | cos | tan | sec | csc | cot | sinh | cosh | tanh | sech | csch | coth | arcsin | arccos | arctan | arccosh | arccot | arccoth | arccsc | arccsch | arcsec | arcsech | arcsinh | arctanh
+ContExp |= unary-elementary.class
+
+
+sin = element sin { CommonAtt, DefEncAtt, empty}
+cos = element cos { CommonAtt, DefEncAtt, empty}
+tan = element tan { CommonAtt, DefEncAtt, empty}
+sec = element sec { CommonAtt, DefEncAtt, empty}
+csc = element csc { CommonAtt, DefEncAtt, empty}
+cot = element cot { CommonAtt, DefEncAtt, empty}
+sinh = element sinh { CommonAtt, DefEncAtt, empty}
+cosh = element cosh { CommonAtt, DefEncAtt, empty}
+tanh = element tanh { CommonAtt, DefEncAtt, empty}
+sech = element sech { CommonAtt, DefEncAtt, empty}
+csch = element csch { CommonAtt, DefEncAtt, empty}
+coth = element coth { CommonAtt, DefEncAtt, empty}
+arcsin = element arcsin { CommonAtt, DefEncAtt, empty}
+arccos = element arccos { CommonAtt, DefEncAtt, empty}
+arctan = element arctan { CommonAtt, DefEncAtt, empty}
+arccosh = element arccosh { CommonAtt, DefEncAtt, empty}
+arccot = element arccot { CommonAtt, DefEncAtt, empty}
+arccoth = element arccoth { CommonAtt, DefEncAtt, empty}
+arccsc = element arccsc { CommonAtt, DefEncAtt, empty}
+arccsch = element arccsch { CommonAtt, DefEncAtt, empty}
+arcsec = element arcsec { CommonAtt, DefEncAtt, empty}
+arcsech = element arcsech { CommonAtt, DefEncAtt, empty}
+arcsinh = element arcsinh { CommonAtt, DefEncAtt, empty}
+arctanh = element arctanh { CommonAtt, DefEncAtt, empty}
+
+nary-stats.class = mean | sdev | variance | median | mode
+ContExp |= nary-stats.class
+
+
+mean = element mean { CommonAtt, DefEncAtt, empty}
+sdev = element sdev { CommonAtt, DefEncAtt, empty}
+variance = element variance { CommonAtt, DefEncAtt, empty}
+median = element median { CommonAtt, DefEncAtt, empty}
+mode = element mode { CommonAtt, DefEncAtt, empty}
+
+nary-constructor.class = vector | matrix | matrixrow
+ContExp |= nary-constructor.class
+
+
+vector = element vector { CommonAtt, DefEncAtt, BvarQ, DomainQ, ContExp*}
+matrix = element matrix { CommonAtt, DefEncAtt, BvarQ, DomainQ, ContExp*}
+matrixrow = element matrixrow { CommonAtt, DefEncAtt, BvarQ, DomainQ, ContExp*}
+
+unary-linalg.class = determinant | transpose
+ContExp |= unary-linalg.class
+
+
+determinant = element determinant { CommonAtt, DefEncAtt, empty}
+transpose = element transpose { CommonAtt, DefEncAtt, empty}
+
+nary-linalg.class = selector
+ContExp |= nary-linalg.class
+
+
+selector = element selector { CommonAtt, DefEncAtt, empty}
+
+binary-linalg.class = vectorproduct | scalarproduct | outerproduct
+ContExp |= binary-linalg.class
+
+
+vectorproduct = element vectorproduct { CommonAtt, DefEncAtt, empty}
+scalarproduct = element scalarproduct { CommonAtt, DefEncAtt, empty}
+outerproduct = element outerproduct { CommonAtt, DefEncAtt, empty}
+
+constant-set.class = integers | reals | rationals | naturalnumbers | complexes | primes | emptyset
+ContExp |= constant-set.class
+
+
+integers = element integers { CommonAtt, DefEncAtt, empty}
+reals = element reals { CommonAtt, DefEncAtt, empty}
+rationals = element rationals { CommonAtt, DefEncAtt, empty}
+naturalnumbers = element naturalnumbers { CommonAtt, DefEncAtt, empty}
+complexes = element complexes { CommonAtt, DefEncAtt, empty}
+primes = element primes { CommonAtt, DefEncAtt, empty}
+emptyset = element emptyset { CommonAtt, DefEncAtt, empty}
+
+constant-arith.class = exponentiale | imaginaryi | notanumber | true | false | pi | eulergamma | infinity
+ContExp |= constant-arith.class
+
+
+exponentiale = element exponentiale { CommonAtt, DefEncAtt, empty}
+imaginaryi = element imaginaryi { CommonAtt, DefEncAtt, empty}
+notanumber = element notanumber { CommonAtt, DefEncAtt, empty}
+true = element true { CommonAtt, DefEncAtt, empty}
+false = element false { CommonAtt, DefEncAtt, empty}
+pi = element pi { CommonAtt, DefEncAtt, empty}
+eulergamma = element eulergamma { CommonAtt, DefEncAtt, empty}
+infinity = element infinity { CommonAtt, DefEncAtt, empty}
\ No newline at end of file
diff --git a/app/report/mathml3/mathml3-content.rng b/app/report/mathml3/mathml3-content.rng
new file mode 100644
index 0000000..a0a169a
--- /dev/null
+++ b/app/report/mathml3/mathml3-content.rng
@@ -0,0 +1,1544 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <!--
+        This is the Mathematical Markup Language (MathML) 3.0, an XML
+        application for describing mathematical notation and capturing
+        both its structure and content.
+    
+        Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
+    
+        Use and distribution of this code are permitted under the terms
+        W3C Software Notice and License
+        http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+  -->
+  <include href="mathml3-strict-content.rng">
+    <define name="cn.content">
+      <zeroOrMore>
+        <choice>
+          <text/>
+          <ref name="mglyph"/>
+          <ref name="sep"/>
+          <ref name="PresentationExpression"/>
+        </choice>
+      </zeroOrMore>
+    </define>
+    <define name="cn.attributes">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <optional>
+        <attribute name="type"/>
+      </optional>
+      <optional>
+        <ref name="base"/>
+      </optional>
+    </define>
+    <define name="ci.attributes">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <optional>
+        <ref name="ci.type"/>
+      </optional>
+    </define>
+    <define name="ci.type">
+      <attribute name="type"/>
+    </define>
+    <define name="ci.content">
+      <zeroOrMore>
+        <choice>
+          <text/>
+          <ref name="mglyph"/>
+          <ref name="PresentationExpression"/>
+        </choice>
+      </zeroOrMore>
+    </define>
+    <define name="csymbol.attributes">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <optional>
+        <attribute name="type"/>
+      </optional>
+      <optional>
+        <ref name="cd"/>
+      </optional>
+    </define>
+    <define name="csymbol.content">
+      <zeroOrMore>
+        <choice>
+          <text/>
+          <ref name="mglyph"/>
+          <ref name="PresentationExpression"/>
+        </choice>
+      </zeroOrMore>
+    </define>
+    <define name="bvar">
+      <element name="bvar">
+        <ref name="CommonAtt"/>
+        <interleave>
+          <choice>
+            <ref name="ci"/>
+            <ref name="semantics-ci"/>
+          </choice>
+          <optional>
+            <ref name="degree"/>
+          </optional>
+        </interleave>
+      </element>
+    </define>
+    <define name="cbytes.attributes">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+    </define>
+    <define name="cs.attributes">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+    </define>
+    <define name="apply.content">
+      <choice>
+        <oneOrMore>
+          <ref name="ContExp"/>
+        </oneOrMore>
+        <group>
+          <ref name="ContExp"/>
+          <ref name="BvarQ"/>
+          <zeroOrMore>
+            <ref name="Qualifier"/>
+          </zeroOrMore>
+          <zeroOrMore>
+            <ref name="ContExp"/>
+          </zeroOrMore>
+        </group>
+      </choice>
+    </define>
+    <define name="bind.content">
+      <ref name="apply.content"/>
+    </define>
+  </include>
+  <define name="base">
+    <attribute name="base"/>
+  </define>
+  <define name="sep">
+    <element name="sep">
+      <empty/>
+    </element>
+  </define>
+  <define name="PresentationExpression" combine="choice">
+    <notAllowed/>
+  </define>
+  <define name="DomainQ">
+    <zeroOrMore>
+      <choice>
+        <ref name="domainofapplication"/>
+        <ref name="condition"/>
+        <ref name="interval"/>
+        <group>
+          <ref name="lowlimit"/>
+          <optional>
+            <ref name="uplimit"/>
+          </optional>
+        </group>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="domainofapplication">
+    <element name="domainofapplication">
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="condition">
+    <element name="condition">
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="uplimit">
+    <element name="uplimit">
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="lowlimit">
+    <element name="lowlimit">
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="Qualifier">
+    <choice>
+      <ref name="DomainQ"/>
+      <ref name="degree"/>
+      <ref name="momentabout"/>
+      <ref name="logbase"/>
+    </choice>
+  </define>
+  <define name="degree">
+    <element name="degree">
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="momentabout">
+    <element name="momentabout">
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="logbase">
+    <element name="logbase">
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="type">
+    <attribute name="type"/>
+  </define>
+  <define name="order">
+    <attribute name="order">
+      <choice>
+        <value>numeric</value>
+        <value>lexicographic</value>
+      </choice>
+    </attribute>
+  </define>
+  <define name="closure">
+    <attribute name="closure"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="piecewise"/>
+  </define>
+  <define name="piecewise">
+    <element name="piecewise">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <interleave>
+        <zeroOrMore>
+          <ref name="piece"/>
+        </zeroOrMore>
+        <optional>
+          <ref name="otherwise"/>
+        </optional>
+      </interleave>
+    </element>
+  </define>
+  <define name="piece">
+    <element name="piece">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <ref name="ContExp"/>
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="otherwise">
+    <element name="otherwise">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="DeprecatedContExp">
+    <choice>
+      <ref name="reln"/>
+      <ref name="fn"/>
+      <ref name="declare"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="DeprecatedContExp"/>
+  </define>
+  <define name="reln">
+    <element name="reln">
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="fn">
+    <element name="fn">
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="declare">
+    <element name="declare">
+      <optional>
+        <attribute name="type">
+          <data type="string"/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="scope">
+          <data type="string"/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="nargs">
+          <data type="nonNegativeInteger"/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="occurrence">
+          <choice>
+            <value>prefix</value>
+            <value>infix</value>
+            <value>function-model</value>
+          </choice>
+        </attribute>
+      </optional>
+      <ref name="DefEncAtt"/>
+      <oneOrMore>
+        <ref name="ContExp"/>
+      </oneOrMore>
+    </element>
+  </define>
+  <define name="interval.class">
+    <ref name="interval"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="interval.class"/>
+  </define>
+  <define name="interval">
+    <element name="interval">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <optional>
+        <ref name="closure"/>
+      </optional>
+      <ref name="ContExp"/>
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="unary-functional.class">
+    <choice>
+      <ref name="inverse"/>
+      <ref name="ident"/>
+      <ref name="domain"/>
+      <ref name="codomain"/>
+      <ref name="image"/>
+      <ref name="ln"/>
+      <ref name="log"/>
+      <ref name="moment"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="unary-functional.class"/>
+  </define>
+  <define name="inverse">
+    <element name="inverse">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="ident">
+    <element name="ident">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="domain">
+    <element name="domain">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="codomain">
+    <element name="codomain">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="image">
+    <element name="image">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="ln">
+    <element name="ln">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="log">
+    <element name="log">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="moment">
+    <element name="moment">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="lambda.class">
+    <ref name="lambda"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="lambda.class"/>
+  </define>
+  <define name="lambda">
+    <element name="lambda">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <ref name="BvarQ"/>
+      <ref name="DomainQ"/>
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="nary-functional.class">
+    <ref name="compose"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="nary-functional.class"/>
+  </define>
+  <define name="compose">
+    <element name="compose">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="binary-arith.class">
+    <choice>
+      <ref name="quotient"/>
+      <ref name="divide"/>
+      <ref name="minus"/>
+      <ref name="power"/>
+      <ref name="rem"/>
+      <ref name="root"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="binary-arith.class"/>
+  </define>
+  <define name="quotient">
+    <element name="quotient">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="divide">
+    <element name="divide">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="minus">
+    <element name="minus">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="power">
+    <element name="power">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="rem">
+    <element name="rem">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="root">
+    <element name="root">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="unary-arith.class">
+    <choice>
+      <ref name="factorial"/>
+      <ref name="minus"/>
+      <ref name="root"/>
+      <ref name="abs"/>
+      <ref name="conjugate"/>
+      <ref name="arg"/>
+      <ref name="real"/>
+      <ref name="imaginary"/>
+      <ref name="floor"/>
+      <ref name="ceiling"/>
+      <ref name="exp"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="unary-arith.class"/>
+  </define>
+  <define name="factorial">
+    <element name="factorial">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="abs">
+    <element name="abs">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="conjugate">
+    <element name="conjugate">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arg">
+    <element name="arg">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="real">
+    <element name="real">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="imaginary">
+    <element name="imaginary">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="floor">
+    <element name="floor">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="ceiling">
+    <element name="ceiling">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="exp">
+    <element name="exp">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="nary-minmax.class">
+    <choice>
+      <ref name="max"/>
+      <ref name="min"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="nary-minmax.class"/>
+  </define>
+  <define name="max">
+    <element name="max">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="min">
+    <element name="min">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="nary-arith.class">
+    <choice>
+      <ref name="plus"/>
+      <ref name="times"/>
+      <ref name="gcd"/>
+      <ref name="lcm"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="nary-arith.class"/>
+  </define>
+  <define name="plus">
+    <element name="plus">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="times">
+    <element name="times">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="gcd">
+    <element name="gcd">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="lcm">
+    <element name="lcm">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="nary-logical.class">
+    <choice>
+      <ref name="and"/>
+      <ref name="or"/>
+      <ref name="xor"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="nary-logical.class"/>
+  </define>
+  <define name="and">
+    <element name="and">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="or">
+    <element name="or">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="xor">
+    <element name="xor">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="unary-logical.class">
+    <ref name="not"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="unary-logical.class"/>
+  </define>
+  <define name="not">
+    <element name="not">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="binary-logical.class">
+    <choice>
+      <ref name="implies"/>
+      <ref name="equivalent"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="binary-logical.class"/>
+  </define>
+  <define name="implies">
+    <element name="implies">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="equivalent">
+    <element name="equivalent">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="quantifier.class">
+    <choice>
+      <ref name="forall"/>
+      <ref name="exists"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="quantifier.class"/>
+  </define>
+  <define name="forall">
+    <element name="forall">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="exists">
+    <element name="exists">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="nary-reln.class">
+    <choice>
+      <ref name="eq"/>
+      <ref name="gt"/>
+      <ref name="lt"/>
+      <ref name="geq"/>
+      <ref name="leq"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="nary-reln.class"/>
+  </define>
+  <define name="eq">
+    <element name="eq">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="gt">
+    <element name="gt">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="lt">
+    <element name="lt">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="geq">
+    <element name="geq">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="leq">
+    <element name="leq">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="binary-reln.class">
+    <choice>
+      <ref name="neq"/>
+      <ref name="approx"/>
+      <ref name="factorof"/>
+      <ref name="tendsto"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="binary-reln.class"/>
+  </define>
+  <define name="neq">
+    <element name="neq">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="approx">
+    <element name="approx">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="factorof">
+    <element name="factorof">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="tendsto">
+    <element name="tendsto">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <optional>
+        <ref name="type"/>
+      </optional>
+      <empty/>
+    </element>
+  </define>
+  <define name="int.class">
+    <ref name="int"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="int.class"/>
+  </define>
+  <define name="int">
+    <element name="int">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="Differential-Operator.class">
+    <ref name="diff"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="Differential-Operator.class"/>
+  </define>
+  <define name="diff">
+    <element name="diff">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="partialdiff.class">
+    <ref name="partialdiff"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="partialdiff.class"/>
+  </define>
+  <define name="partialdiff">
+    <element name="partialdiff">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="unary-veccalc.class">
+    <choice>
+      <ref name="divergence"/>
+      <ref name="grad"/>
+      <ref name="curl"/>
+      <ref name="laplacian"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="unary-veccalc.class"/>
+  </define>
+  <define name="divergence">
+    <element name="divergence">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="grad">
+    <element name="grad">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="curl">
+    <element name="curl">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="laplacian">
+    <element name="laplacian">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="nary-setlist-constructor.class">
+    <choice>
+      <ref name="set"/>
+      <ref name="list"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="nary-setlist-constructor.class"/>
+  </define>
+  <define name="set">
+    <element name="set">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <optional>
+        <ref name="type"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="BvarQ"/>
+      </zeroOrMore>
+      <zeroOrMore>
+        <ref name="DomainQ"/>
+      </zeroOrMore>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="list">
+    <element name="list">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <optional>
+        <ref name="order"/>
+      </optional>
+      <zeroOrMore>
+        <ref name="BvarQ"/>
+      </zeroOrMore>
+      <zeroOrMore>
+        <ref name="DomainQ"/>
+      </zeroOrMore>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="nary-set.class">
+    <choice>
+      <ref name="union"/>
+      <ref name="intersect"/>
+      <ref name="cartesianproduct"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="nary-set.class"/>
+  </define>
+  <define name="union">
+    <element name="union">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="intersect">
+    <element name="intersect">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="cartesianproduct">
+    <element name="cartesianproduct">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="binary-set.class">
+    <choice>
+      <ref name="in"/>
+      <ref name="notin"/>
+      <ref name="notsubset"/>
+      <ref name="notprsubset"/>
+      <ref name="setdiff"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="binary-set.class"/>
+  </define>
+  <define name="in">
+    <element name="in">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="notin">
+    <element name="notin">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="notsubset">
+    <element name="notsubset">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="notprsubset">
+    <element name="notprsubset">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="setdiff">
+    <element name="setdiff">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="nary-set-reln.class">
+    <choice>
+      <ref name="subset"/>
+      <ref name="prsubset"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="nary-set-reln.class"/>
+  </define>
+  <define name="subset">
+    <element name="subset">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="prsubset">
+    <element name="prsubset">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="unary-set.class">
+    <ref name="card"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="unary-set.class"/>
+  </define>
+  <define name="card">
+    <element name="card">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="sum.class">
+    <ref name="sum"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="sum.class"/>
+  </define>
+  <define name="sum">
+    <element name="sum">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="product.class">
+    <ref name="product"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="product.class"/>
+  </define>
+  <define name="product">
+    <element name="product">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="limit.class">
+    <ref name="limit"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="limit.class"/>
+  </define>
+  <define name="limit">
+    <element name="limit">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="unary-elementary.class">
+    <choice>
+      <ref name="sin"/>
+      <ref name="cos"/>
+      <ref name="tan"/>
+      <ref name="sec"/>
+      <ref name="csc"/>
+      <ref name="cot"/>
+      <ref name="sinh"/>
+      <ref name="cosh"/>
+      <ref name="tanh"/>
+      <ref name="sech"/>
+      <ref name="csch"/>
+      <ref name="coth"/>
+      <ref name="arcsin"/>
+      <ref name="arccos"/>
+      <ref name="arctan"/>
+      <ref name="arccosh"/>
+      <ref name="arccot"/>
+      <ref name="arccoth"/>
+      <ref name="arccsc"/>
+      <ref name="arccsch"/>
+      <ref name="arcsec"/>
+      <ref name="arcsech"/>
+      <ref name="arcsinh"/>
+      <ref name="arctanh"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="unary-elementary.class"/>
+  </define>
+  <define name="sin">
+    <element name="sin">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="cos">
+    <element name="cos">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="tan">
+    <element name="tan">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="sec">
+    <element name="sec">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="csc">
+    <element name="csc">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="cot">
+    <element name="cot">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="sinh">
+    <element name="sinh">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="cosh">
+    <element name="cosh">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="tanh">
+    <element name="tanh">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="sech">
+    <element name="sech">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="csch">
+    <element name="csch">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="coth">
+    <element name="coth">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arcsin">
+    <element name="arcsin">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arccos">
+    <element name="arccos">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arctan">
+    <element name="arctan">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arccosh">
+    <element name="arccosh">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arccot">
+    <element name="arccot">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arccoth">
+    <element name="arccoth">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arccsc">
+    <element name="arccsc">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arccsch">
+    <element name="arccsch">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arcsec">
+    <element name="arcsec">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arcsech">
+    <element name="arcsech">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arcsinh">
+    <element name="arcsinh">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="arctanh">
+    <element name="arctanh">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="nary-stats.class">
+    <choice>
+      <ref name="mean"/>
+      <ref name="sdev"/>
+      <ref name="variance"/>
+      <ref name="median"/>
+      <ref name="mode"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="nary-stats.class"/>
+  </define>
+  <define name="mean">
+    <element name="mean">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="sdev">
+    <element name="sdev">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="variance">
+    <element name="variance">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="median">
+    <element name="median">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="mode">
+    <element name="mode">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="nary-constructor.class">
+    <choice>
+      <ref name="vector"/>
+      <ref name="matrix"/>
+      <ref name="matrixrow"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="nary-constructor.class"/>
+  </define>
+  <define name="vector">
+    <element name="vector">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <ref name="BvarQ"/>
+      <ref name="DomainQ"/>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="matrix">
+    <element name="matrix">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <ref name="BvarQ"/>
+      <ref name="DomainQ"/>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="matrixrow">
+    <element name="matrixrow">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <ref name="BvarQ"/>
+      <ref name="DomainQ"/>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="unary-linalg.class">
+    <choice>
+      <ref name="determinant"/>
+      <ref name="transpose"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="unary-linalg.class"/>
+  </define>
+  <define name="determinant">
+    <element name="determinant">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="transpose">
+    <element name="transpose">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="nary-linalg.class">
+    <ref name="selector"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="nary-linalg.class"/>
+  </define>
+  <define name="selector">
+    <element name="selector">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="binary-linalg.class">
+    <choice>
+      <ref name="vectorproduct"/>
+      <ref name="scalarproduct"/>
+      <ref name="outerproduct"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="binary-linalg.class"/>
+  </define>
+  <define name="vectorproduct">
+    <element name="vectorproduct">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="scalarproduct">
+    <element name="scalarproduct">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="outerproduct">
+    <element name="outerproduct">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="constant-set.class">
+    <choice>
+      <ref name="integers"/>
+      <ref name="reals"/>
+      <ref name="rationals"/>
+      <ref name="naturalnumbers"/>
+      <ref name="complexes"/>
+      <ref name="primes"/>
+      <ref name="emptyset"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="constant-set.class"/>
+  </define>
+  <define name="integers">
+    <element name="integers">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="reals">
+    <element name="reals">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="rationals">
+    <element name="rationals">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="naturalnumbers">
+    <element name="naturalnumbers">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="complexes">
+    <element name="complexes">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="primes">
+    <element name="primes">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="emptyset">
+    <element name="emptyset">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="constant-arith.class">
+    <choice>
+      <ref name="exponentiale"/>
+      <ref name="imaginaryi"/>
+      <ref name="notanumber"/>
+      <ref name="true"/>
+      <ref name="false"/>
+      <ref name="pi"/>
+      <ref name="eulergamma"/>
+      <ref name="infinity"/>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="constant-arith.class"/>
+  </define>
+  <define name="exponentiale">
+    <element name="exponentiale">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="imaginaryi">
+    <element name="imaginaryi">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="notanumber">
+    <element name="notanumber">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="true">
+    <element name="true">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="false">
+    <element name="false">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="pi">
+    <element name="pi">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="eulergamma">
+    <element name="eulergamma">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="infinity">
+    <element name="infinity">
+      <ref name="CommonAtt"/>
+      <ref name="DefEncAtt"/>
+      <empty/>
+    </element>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/mathml3-deprecated.rnc b/app/report/mathml3/mathml3-deprecated.rnc
new file mode 100644
index 0000000..2718d9b
--- /dev/null
+++ b/app/report/mathml3/mathml3-deprecated.rnc
@@ -0,0 +1,44 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2008 W3C (MIT, ERCIM, Keio)
+# 
+#     Use and distribution of this code are permitted under the terms
+#     W3C Software Notice and License
+#     http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+#
+#
+#     Revision:   $Id: mathml3-deprecated.rnc,v 1.3 2008/11/15 22:00:48 dcarlis Exp $
+#
+#    Update to MathML3 and Relax NG: David Carlisle and Michael Kohlhase
+
+default namespace m = "http://www.w3.org/1998/Math/MathML"
+
+
+Token-style.attrib &=
+  attribute fontsize {xsd:string}? ,
+  attribute fontstyle {xsd:string}? ,
+  attribute fontweight {xsd:string}? ,
+  attribute color {xsd:string}? ,
+  attribute fontfamily {xsd:string}? ,
+  attribute fontweight {xsd:string}? 
+
+#Deprecated Content Elements
+dep-content = 
+  element reln {ContExp*}|
+  element fn {ContExp}
+
+ContExp |= dep-content
+
+apply-head |= dep-content
+
+declare = element declare {attribute type {xsd:string}?,
+                           attribute scope {xsd:string}?,
+                           attribute nargs {xsd:nonNegativeInteger}?,
+                           attribute occurrence {"prefix"|"infix"|"function-model"}?,
+                           Definition.attrib,cdbase.attrib?, 
+                           ContExp+}
+ContExp |= declare
+
+mtr.content |= ContInPres
\ No newline at end of file
diff --git a/app/report/mathml3/mathml3-deprecated.rng b/app/report/mathml3/mathml3-deprecated.rng
new file mode 100644
index 0000000..d9159d3
--- /dev/null
+++ b/app/report/mathml3/mathml3-deprecated.rng
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+      This is the Mathematical Markup Language (MathML) 3.0, an XML
+      application for describing mathematical notation and capturing
+      both its structure and content.
+  
+      Copyright 1998-2008 W3C (MIT, ERCIM, Keio)
+  
+      Use and distribution of this code are permitted under the terms
+      W3C Software Notice and License
+      http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+  
+  
+      Revision:   $Id: mathml3-deprecated.rng,v 1.3 2008/11/15 22:00:48 dcarlis Exp $
+  
+     Update to MathML3 and Relax NG: David Carlisle and Michael Kohlhase
+-->
+<grammar ns="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <define name="Token-style.attrib" combine="interleave">
+    <optional>
+      <attribute name="fontsize">
+        <data type="string"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="fontstyle">
+        <data type="string"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="fontweight">
+        <data type="string"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="color">
+        <data type="string"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="fontfamily">
+        <data type="string"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="fontweight">
+        <data type="string"/>
+      </attribute>
+    </optional>
+  </define>
+  <!-- Deprecated Content Elements -->
+  <define name="dep-content">
+    <choice>
+      <element name="reln">
+        <zeroOrMore>
+          <ref name="ContExp"/>
+        </zeroOrMore>
+      </element>
+      <element name="fn">
+        <ref name="ContExp"/>
+      </element>
+    </choice>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="dep-content"/>
+  </define>
+  <define name="apply-head" combine="choice">
+    <ref name="dep-content"/>
+  </define>
+  <define name="declare">
+    <element name="declare">
+      <optional>
+        <attribute name="type">
+          <data type="string"/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="scope">
+          <data type="string"/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="nargs">
+          <data type="nonNegativeInteger"/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="occurrence">
+          <choice>
+            <value>prefix</value>
+            <value>infix</value>
+            <value>function-model</value>
+          </choice>
+        </attribute>
+      </optional>
+      <ref name="Definition.attrib"/>
+      <optional>
+        <ref name="cdbase.attrib"/>
+      </optional>
+      <oneOrMore>
+        <ref name="ContExp"/>
+      </oneOrMore>
+    </element>
+  </define>
+  <define name="ContExp" combine="choice">
+    <ref name="declare"/>
+  </define>
+  <define name="mtr.content" combine="choice">
+    <ref name="ContInPres"/>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/mathml3-pragmatic.rnc b/app/report/mathml3/mathml3-pragmatic.rnc
new file mode 100644
index 0000000..86856ed
--- /dev/null
+++ b/app/report/mathml3/mathml3-pragmatic.rnc
@@ -0,0 +1,96 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2008 W3C (MIT, ERCIM, Keio)
+# 
+#     Use and distribution of this code are permitted under the terms
+#     W3C Software Notice and License
+#     http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+#
+#
+#   Revision: $Id: mathml3-pragmatic.rnc,v 1.4 2009/01/14 13:13:58 dcarlis Exp $
+#
+#     Update to MathML3 and Relax NG: David Carlisle and Michael Kohlhase
+#
+#     This is the RelaxNG schema module for the pragmatic content part of 
+#     MathML (but without the presentation in token elements).
+
+default namespace m = "http://www.w3.org/1998/Math/MathML"
+
+
+## the content of "cn" may have <sep> elements in it
+sep = element sep {empty}
+cn.content |= (sep|text|Glyph-alignmark)*
+cn.type.vals |= "e-notation"|"rational"|
+                 "complex-cartesian"|"complex-polar"|"constant" 
+
+## allow degree in bvar
+degree = element degree {MathML.Common.attrib,ContExp}
+logbase = element logbase {MathML.Common.attrib,ContExp}
+momentabout = element momentabout {MathML.Common.attrib,ContExp}
+bvar-head |= (degree?,ci)|(ci,degree?)
+
+## allow degree to modify <root/>
+apply.content |= root_arith1_elt,degree,ContExp*
+apply.content |= moment_s_data1_elt,(degree? & momentabout?),ContInPres*
+apply.content |= log_transc1_elt,logbase,ContExp*
+
+##allow apply to act as a binder
+apply.content |= bind.content
+
+domainofapplication = element domainofapplication {
+                   Definition.attrib,MathML.Common.attrib,cdbase.attrib?,ContExp}
+
+lowlimit = element lowlimit {
+           Definition.attrib,MathML.Common.attrib,cdbase.attrib?,ContExp+}
+uplimit = element uplimit {
+          Definition.attrib,MathML.Common.attrib,cdbase.attrib?,ContExp+}
+
+condition = element condition {Definition.attrib,cdbase.attrib?,ContExp}
+
+## allow the non-strict qualifiers
+qualifier |= domainofapplication|(uplimit,lowlimit?)|
+             (lowlimit,uplimit?)|degree|condition
+
+## we collect the operator elements by role
+opel.constant = notAllowed
+opel.binder = notAllowed
+opel.application = notAllowed
+opel.semantic-attribution = notAllowed
+opel.attribution = notAllowed
+opel.error = notAllowed
+
+opels = opel.constant | opel.binder | opel.application | 
+        opel.semantic-attribution | opel.attribution |
+	opel.error
+container = notAllowed
+
+## the values of the MathML type attributes;  
+MathMLType |= "real" | "complex" | "function" | "algebraic" | "integer"
+
+
+## we instantiate the strict content model by structure checking
+apply-binder-head = semantics-apply-binder|opel.binder
+apply.content |= apply-binder-head,bvar*,qualifier?,ContExp*
+semantics-apply-binder = element semantics {
+                       semantics.attribs,apply-binder-head, semantics-annotation*}
+
+apply-head |= opel.application
+bind-head |= opel.binder
+cerror-head |= opel.error
+
+## allow all functions, constants, and containers
+## to be content expressions on their own
+ContExp |= opel.constant|opel.application|container 
+
+
+# allow no body
+bind.content |= bind-head,bvar*,qualifier?
+
+# not sure what a sequence of things is supposed to map to in strict/OM
+# but is definitely allowed in pragmatic
+# see Content/SequencesAndSeries/product/rec-product3
+math.content |= ContExp*
+
+opel.content |= PresExp|Glyph-alignmark
diff --git a/app/report/mathml3/mathml3-pragmatic.rng b/app/report/mathml3/mathml3-pragmatic.rng
new file mode 100644
index 0000000..e45821a
--- /dev/null
+++ b/app/report/mathml3/mathml3-pragmatic.rng
@@ -0,0 +1,290 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+      This is the Mathematical Markup Language (MathML) 3.0, an XML
+      application for describing mathematical notation and capturing
+      both its structure and content.
+  
+      Copyright 1998-2008 W3C (MIT, ERCIM, Keio)
+  
+      Use and distribution of this code are permitted under the terms
+      W3C Software Notice and License
+      http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+  
+  
+      Revision:   $Id: mathml3-pragmatic.rng,v 1.3 2008/11/15 22:00:48 dcarlis Exp $
+  
+     Update to MathML3 and Relax NG: David Carlisle and Michael Kohlhase
+  
+      This is the RelaxNG schema module for the pragmatic content part of 
+      MathML (but without the presentation in token elements).
+-->
+<grammar ns="http://www.w3.org/1998/Math/MathML" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0">
+  <define name="sep">
+    <a:documentation>the content of "cn" may have &lt;sep&gt; elements in it</a:documentation>
+    <element name="sep">
+      <empty/>
+    </element>
+  </define>
+  <define name="cn.content" combine="choice">
+    <zeroOrMore>
+      <choice>
+        <ref name="sep"/>
+        <text/>
+        <ref name="Glyph-alignmark"/>
+      </choice>
+    </zeroOrMore>
+  </define>
+  <define name="cn.type.vals" combine="choice">
+    <choice>
+      <value>e-notation</value>
+      <value>rational</value>
+      <value>complex-cartesian</value>
+      <value>complex-polar</value>
+      <value>constant</value>
+    </choice>
+  </define>
+  <define name="degree">
+    <a:documentation>allow degree in bvar</a:documentation>
+    <element name="degree">
+      <ref name="MathML.Common.attrib"/>
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="logbase">
+    <element name="logbase">
+      <ref name="MathML.Common.attrib"/>
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="momentabout">
+    <element name="momentabout">
+      <ref name="MathML.Common.attrib"/>
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="bvar-head" combine="choice">
+    <choice>
+      <group>
+        <optional>
+          <ref name="degree"/>
+        </optional>
+        <ref name="ci"/>
+      </group>
+      <group>
+        <ref name="ci"/>
+        <optional>
+          <ref name="degree"/>
+        </optional>
+      </group>
+    </choice>
+  </define>
+  <define name="apply.content" combine="choice">
+    <a:documentation>allow degree to modify &lt;root/&gt;</a:documentation>
+    <ref name="root_arith1_elt"/>
+    <ref name="degree"/>
+    <zeroOrMore>
+      <ref name="ContExp"/>
+    </zeroOrMore>
+  </define>
+  <define name="apply.content" combine="choice">
+    <ref name="moment_s_data1_elt"/>
+    <interleave>
+      <optional>
+        <ref name="degree"/>
+      </optional>
+      <optional>
+        <ref name="momentabout"/>
+      </optional>
+    </interleave>
+    <zeroOrMore>
+      <ref name="ContInPres"/>
+    </zeroOrMore>
+  </define>
+  <define name="apply.content" combine="choice">
+    <ref name="log_transc1_elt"/>
+    <ref name="logbase"/>
+    <zeroOrMore>
+      <ref name="ContExp"/>
+    </zeroOrMore>
+  </define>
+  <define name="apply.content" combine="choice">
+    <a:documentation>allow apply to act as a binder</a:documentation>
+    <ref name="bind.content"/>
+  </define>
+  <define name="domainofapplication">
+    <element name="domainofapplication">
+      <ref name="Definition.attrib"/>
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="cdbase.attrib"/>
+      </optional>
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="lowlimit">
+    <element name="lowlimit">
+      <ref name="Definition.attrib"/>
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="cdbase.attrib"/>
+      </optional>
+      <oneOrMore>
+        <ref name="ContExp"/>
+      </oneOrMore>
+    </element>
+  </define>
+  <define name="uplimit">
+    <element name="uplimit">
+      <ref name="Definition.attrib"/>
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="cdbase.attrib"/>
+      </optional>
+      <oneOrMore>
+        <ref name="ContExp"/>
+      </oneOrMore>
+    </element>
+  </define>
+  <define name="condition">
+    <element name="condition">
+      <ref name="Definition.attrib"/>
+      <optional>
+        <ref name="cdbase.attrib"/>
+      </optional>
+      <ref name="ContExp"/>
+    </element>
+  </define>
+  <define name="qualifier" combine="choice">
+    <a:documentation>allow the non-strict qualifiers</a:documentation>
+    <choice>
+      <ref name="domainofapplication"/>
+      <group>
+        <ref name="uplimit"/>
+        <optional>
+          <ref name="lowlimit"/>
+        </optional>
+      </group>
+      <group>
+        <ref name="lowlimit"/>
+        <optional>
+          <ref name="uplimit"/>
+        </optional>
+      </group>
+      <ref name="degree"/>
+      <ref name="condition"/>
+    </choice>
+  </define>
+  <define name="opel.constant">
+    <a:documentation>we collect the operator elements by role</a:documentation>
+    <notAllowed/>
+  </define>
+  <define name="opel.binder">
+    <notAllowed/>
+  </define>
+  <define name="opel.application">
+    <notAllowed/>
+  </define>
+  <define name="opel.semantic-attribution">
+    <notAllowed/>
+  </define>
+  <define name="opel.attribution">
+    <notAllowed/>
+  </define>
+  <define name="opel.error">
+    <notAllowed/>
+  </define>
+  <define name="opels">
+    <choice>
+      <ref name="opel.constant"/>
+      <ref name="opel.binder"/>
+      <ref name="opel.application"/>
+      <ref name="opel.semantic-attribution"/>
+      <ref name="opel.attribution"/>
+      <ref name="opel.error"/>
+    </choice>
+  </define>
+  <define name="container">
+    <notAllowed/>
+  </define>
+  <define name="MathMLType" combine="choice">
+    <a:documentation>the values of the MathML type attributes;  </a:documentation>
+    <choice>
+      <value>real</value>
+      <value>complex</value>
+      <value>function</value>
+      <value>algebraic</value>
+      <value>integer</value>
+    </choice>
+  </define>
+  <define name="apply-binder-head">
+    <a:documentation>we instantiate the strict content model by structure checking</a:documentation>
+    <choice>
+      <ref name="semantics-apply-binder"/>
+      <ref name="opel.binder"/>
+    </choice>
+  </define>
+  <define name="apply.content" combine="choice">
+    <ref name="apply-binder-head"/>
+    <zeroOrMore>
+      <ref name="bvar"/>
+    </zeroOrMore>
+    <optional>
+      <ref name="qualifier"/>
+    </optional>
+    <zeroOrMore>
+      <ref name="ContExp"/>
+    </zeroOrMore>
+  </define>
+  <define name="semantics-apply-binder">
+    <element name="semantics">
+      <ref name="semantics.attribs"/>
+      <ref name="apply-binder-head"/>
+      <zeroOrMore>
+        <ref name="semantics-annotation"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="apply-head" combine="choice">
+    <ref name="opel.application"/>
+  </define>
+  <define name="bind-head" combine="choice">
+    <ref name="opel.binder"/>
+  </define>
+  <define name="cerror-head" combine="choice">
+    <ref name="opel.error"/>
+  </define>
+  <define name="ContExp" combine="choice">
+    <a:documentation>allow all functions, constants, and containers to be content expressions on their own</a:documentation>
+    <choice>
+      <ref name="opel.constant"/>
+      <ref name="opel.application"/>
+      <ref name="container"/>
+    </choice>
+  </define>
+  <!-- allow no body -->
+  <define name="bind.content" combine="choice">
+    <ref name="bind-head"/>
+    <zeroOrMore>
+      <ref name="bvar"/>
+    </zeroOrMore>
+    <optional>
+      <ref name="qualifier"/>
+    </optional>
+  </define>
+  <!--
+    not sure what a sequence of things is supposed to map to in strict/OM
+    but is definitely allowed in pragmatic
+    see Content/SequencesAndSeries/product/rec-product3
+  -->
+  <define name="math.content" combine="choice">
+    <zeroOrMore>
+      <ref name="ContExp"/>
+    </zeroOrMore>
+  </define>
+  <define name="opel.content" combine="choice">
+    <choice>
+      <ref name="PresExp"/>
+      <ref name="Glyph-alignmark"/>
+    </choice>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/mathml3-presentation.rnc b/app/report/mathml3/mathml3-presentation.rnc
new file mode 100644
index 0000000..7606d90
--- /dev/null
+++ b/app/report/mathml3/mathml3-presentation.rnc
@@ -0,0 +1,543 @@
+
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
+# 
+#     Use and distribution of this code are permitted under the terms
+#     W3C Software Notice and License
+#     http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+default namespace m = "http://www.w3.org/1998/Math/MathML"
+
+MathExpression |= PresentationExpression
+
+ImpliedMrow = MathExpression*
+
+TableRowExpression = mtr|mlabeledtr
+
+TableCellExpression = mtd
+
+MstackExpression = MathExpression|mscarries|msline|msrow|msgroup
+
+MsrowExpression = MathExpression|none
+
+MultiScriptExpression = (MathExpression|none),(MathExpression|none)
+
+mpadded-length = xsd:string {
+  pattern = '\s*([\+\-]?[0-9]*([0-9]\.?|\.[0-9])[0-9]*\s*((%?\s*(height|depth|width)?)|e[mx]|in|cm|mm|p[xtc]|((negative)?((very){0,2}thi(n|ck)|medium)mathspace))?)\s*' }
+
+linestyle = "none" | "solid" | "dashed"
+
+verticalalign =
+      "top" |
+      "bottom" |
+      "center" |
+      "baseline" |
+      "axis"
+
+columnalignstyle = "left" | "center" | "right"
+
+notationstyle =
+     "longdiv" |
+     "actuarial" |
+     "radical" |
+     "box" |
+     "roundedbox" |
+     "circle" |
+     "left" |
+     "right" |
+     "top" |
+     "bottom" |
+     "updiagonalstrike" |
+     "downdiagonalstrike" |
+     "verticalstrike" |
+     "horizontalstrike" |
+     "madruwb"
+
+idref = text
+unsigned-integer = xsd:unsignedLong
+integer = xsd:integer
+number = xsd:decimal
+
+character = xsd:string {
+  pattern = '\s*\S\s*'}
+
+color =  xsd:string {
+  pattern = '\s*((#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?)|[aA][qQ][uU][aA]|[bB][lL][aA][cC][kK]|[bB][lL][uU][eE]|[fF][uU][cC][hH][sS][iI][aA]|[gG][rR][aA][yY]|[gG][rR][eE][eE][nN]|[lL][iI][mM][eE]|[mM][aA][rR][oO][oO][nN]|[nN][aA][vV][yY]|[oO][lL][iI][vV][eE]|[pP][uU][rR][pP][lL][eE]|[rR][eE][dD]|[sS][iI][lL][vV][eE][rR]|[tT][eE][aA][lL]|[wW][hH][iI][tT][eE]|[yY][eE][lL][lL][oO][wW])\s*'}
+
+
+group-alignment = "left" | "center" | "right" | "decimalpoint"
+group-alignment-list = list {group-alignment+}
+group-alignment-list-list = xsd:string {
+  pattern = '(\s*\{\s*(left|center|right|decimalpoint)(\s+(left|center|right|decimalpoint))*\})*\s*' }
+positive-integer = xsd:positiveInteger
+
+
+TokenExpression = mi|mn|mo|mtext|mspace|ms
+
+token.content = mglyph|malignmark|text
+
+mi = element mi {mi.attributes, token.content*}
+mi.attributes = 
+  CommonAtt,
+  CommonPresAtt,
+  TokenAtt
+
+
+mn = element mn {mn.attributes, token.content*}
+mn.attributes = 
+  CommonAtt,
+  CommonPresAtt,
+  TokenAtt
+
+
+mo = element mo {mo.attributes, token.content*}
+mo.attributes = 
+  CommonAtt,
+  CommonPresAtt,
+  TokenAtt,
+  attribute form {"prefix" | "infix" | "postfix"}?,
+  attribute fence {"true" | "false"}?,
+  attribute separator {"true" | "false"}?,
+  attribute lspace {length}?,
+  attribute rspace {length}?,
+  attribute stretchy {"true" | "false"}?,
+  attribute symmetric {"true" | "false"}?,
+  attribute maxsize {length | "infinity"}?,
+  attribute minsize {length}?,
+  attribute largeop {"true" | "false"}?,
+  attribute movablelimits {"true" | "false"}?,
+  attribute accent {"true" | "false"}?,
+  attribute linebreak {"auto" | "newline" | "nobreak" | "goodbreak" | "badbreak"}?,
+  attribute lineleading {length}?,
+  attribute linebreakstyle {"before" | "after" | "duplicate" | "infixlinebreakstyle"}?,
+  attribute linebreakmultchar {text}?,
+  attribute indentalign {"left" | "center" | "right" | "auto" | "id"}?,
+  attribute indentshift {length}?,
+  attribute indenttarget {idref}?,
+  attribute indentalignfirst {"left" | "center" | "right" | "auto" | "id" | "indentalign"}?,
+  attribute indentshiftfirst {length | "indentshift"}?,
+  attribute indentalignlast {"left" | "center" | "right" | "auto" | "id" | "indentalign"}?,
+  attribute indentshiftlast {length | "indentshift"}?
+
+
+mtext = element mtext {mtext.attributes, token.content*}
+mtext.attributes = 
+  CommonAtt,
+  CommonPresAtt,
+  TokenAtt
+
+
+mspace = element mspace {mspace.attributes, empty}
+mspace.attributes = 
+  CommonAtt,
+  CommonPresAtt,
+  TokenAtt,
+  attribute width {length}?,
+  attribute height {length}?,
+  attribute depth {length}?,
+  attribute linebreak {"auto" | "newline" | "nobreak" | "goodbreak" | "badbreak" | "indentingnewline"}?,
+  attribute indentalign {"left" | "center" | "right" | "auto" | "id"}?,
+  attribute indentshift {length}?,
+  attribute indenttarget {idref}?,
+  attribute indentalignfirst {"left" | "center" | "right" | "auto" | "id" | "indentalign"}?,
+  attribute indentshiftfirst {length | "indentshift"}?,
+  attribute indentalignlast {"left" | "center" | "right" | "auto" | "id" | "indentalign"}?,
+  attribute indentshiftlast {length | "indentshift"}?
+
+
+ms = element ms {ms.attributes, token.content*}
+ms.attributes = 
+  CommonAtt,
+  CommonPresAtt,
+  TokenAtt,
+  attribute lquote {text}?,
+  attribute rquote {text}?
+
+
+mglyph = element mglyph {mglyph.attributes,mglyph.deprecatedattributes,empty}
+mglyph.attributes = 
+  CommonAtt,  CommonPresAtt,
+  attribute src {xsd:anyURI}?,
+  attribute width {length}?,
+  attribute height {length}?,
+  attribute valign {length}?,
+  attribute alt {text}?
+mglyph.deprecatedattributes =
+  attribute index {integer}?,
+  attribute mathvariant {"normal" | "bold" | "italic" | "bold-italic" | "double-struck" | "bold-fraktur" | "script" | "bold-script" | "fraktur" | "sans-serif" | "bold-sans-serif" | "sans-serif-italic" | "sans-serif-bold-italic" | "monospace" | "initial" | "tailed" | "looped" | "stretched"}?,
+  attribute mathsize {"small" | "normal" | "big" | length}?,
+  DeprecatedTokenAtt
+
+msline = element msline {msline.attributes,empty}
+msline.attributes = 
+  CommonAtt,  CommonPresAtt,
+  attribute position {integer}?,
+  attribute length {unsigned-integer}?,
+  attribute leftoverhang {length}?,
+  attribute rightoverhang {length}?,
+  attribute mslinethickness {length | "thin" | "medium" | "thick"}?
+
+none = element none {none.attributes,empty}
+none.attributes = 
+  CommonAtt,
+  CommonPresAtt
+
+mprescripts = element mprescripts {mprescripts.attributes,empty}
+mprescripts.attributes = 
+  CommonAtt,
+  CommonPresAtt
+
+
+CommonPresAtt = 
+  attribute mathcolor {color}?,
+  attribute mathbackground {color | "transparent"}?
+
+TokenAtt = 
+  attribute mathvariant {"normal" | "bold" | "italic" | "bold-italic" | "double-struck" | "bold-fraktur" | "script" | "bold-script" | "fraktur" | "sans-serif" | "bold-sans-serif" | "sans-serif-italic" | "sans-serif-bold-italic" | "monospace" | "initial" | "tailed" | "looped" | "stretched"}?,
+  attribute mathsize {"small" | "normal" | "big" | length}?,
+  attribute dir {"ltr" | "rtl"}?,
+  DeprecatedTokenAtt
+
+DeprecatedTokenAtt = 
+  attribute fontfamily {text}?,
+  attribute fontweight {"normal" | "bold"}?,
+  attribute fontstyle {"normal" | "italic"}?,
+  attribute fontsize {length}?,
+  attribute color {color}?,
+  attribute background {color | "transparent"}?
+
+MalignExpression = maligngroup|malignmark
+
+malignmark = element malignmark {malignmark.attributes, empty}
+malignmark.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute edge {"left" | "right"}?
+
+
+maligngroup = element maligngroup {maligngroup.attributes, empty}
+maligngroup.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute groupalign {"left" | "center" | "right" | "decimalpoint"}?
+
+
+PresentationExpression = TokenExpression|MalignExpression|
+                         mrow|mfrac|msqrt|mroot|mstyle|merror|mpadded|mphantom|
+                         mfenced|menclose|msub|msup|msubsup|munder|mover|munderover|
+                         mmultiscripts|mtable|mstack|mlongdiv|maction
+
+
+
+mrow = element mrow {mrow.attributes, MathExpression*}
+mrow.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute dir {"ltr" | "rtl"}?
+
+
+mfrac = element mfrac {mfrac.attributes, MathExpression, MathExpression}
+mfrac.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute linethickness {length | "thin" | "medium" | "thick"}?,
+  attribute numalign {"left" | "center" | "right"}?,
+  attribute denomalign {"left" | "center" | "right"}?,
+  attribute bevelled {"true" | "false"}?
+
+
+msqrt = element msqrt {msqrt.attributes, ImpliedMrow}
+msqrt.attributes = 
+  CommonAtt, CommonPresAtt
+
+
+mroot = element mroot {mroot.attributes, MathExpression, MathExpression}
+mroot.attributes = 
+  CommonAtt, CommonPresAtt
+
+
+mstyle = element mstyle {mstyle.attributes, ImpliedMrow}
+mstyle.attributes = 
+  CommonAtt, CommonPresAtt,
+  mstyle.specificattributes,
+  mstyle.generalattributes,
+  mstyle.deprecatedattributes
+
+mstyle.specificattributes =
+  attribute scriptlevel {integer}?,
+  attribute displaystyle {"true" | "false"}?,
+  attribute scriptsizemultiplier {number}?,
+  attribute scriptminsize {length}?,
+  attribute infixlinebreakstyle {"before" | "after" | "duplicate"}?,
+  attribute decimalpoint {character}?
+
+mstyle.generalattributes =
+  attribute accent {"true" | "false"}?,
+  attribute accentunder {"true" | "false"}?,
+  attribute align {"left" | "right" | "center"}?,
+  attribute alignmentscope {list {("true" | "false") +}}?,
+  attribute bevelled {"true" | "false"}?,
+  attribute charalign {"left" | "center" | "right"}?,
+  attribute charspacing {length | "loose" | "medium" | "tight"}?,
+  attribute close {text}?,
+  attribute columnalign {list {columnalignstyle+} }?,
+  attribute columnlines {list {linestyle +}}?,
+  attribute columnspacing {list {(length) +}}?,
+  attribute columnspan {positive-integer}?,
+  attribute columnwidth {list {("auto" | length | "fit") +}}?,
+  attribute crossout {list {("none" | "updiagonalstrike" | "downdiagonalstrike" | "verticalstrike" | "horizontalstrike")*}}?,
+  attribute denomalign {"left" | "center" | "right"}?,
+  attribute depth {length}?,
+  attribute dir {"ltr" | "rtl"}?,
+  attribute edge {"left" | "right"}?,
+  attribute equalcolumns {"true" | "false"}?,
+  attribute equalrows {"true" | "false"}?,
+  attribute fence {"true" | "false"}?,
+  attribute form {"prefix" | "infix" | "postfix"}?,
+  attribute frame {linestyle}?,
+  attribute framespacing {list {length, length}}?,
+  attribute groupalign {group-alignment-list-list}?,
+  attribute height {length}?,
+  attribute indentalign {"left" | "center" | "right" | "auto" | "id"}?,
+  attribute indentalignfirst {"left" | "center" | "right" | "auto" | "id" | "indentalign"}?,
+  attribute indentalignlast {"left" | "center" | "right" | "auto" | "id" | "indentalign"}?,
+  attribute indentshift {length}?,
+  attribute indentshiftfirst {length | "indentshift"}?,
+  attribute indentshiftlast {length | "indentshift"}?,
+  attribute indenttarget {idref}?,
+  attribute largeop {"true" | "false"}?,
+  attribute leftoverhang {length}?,
+  attribute length {unsigned-integer}?,
+  attribute linebreak {"auto" | "newline" | "nobreak" | "goodbreak" | "badbreak"}?,
+  attribute linebreakmultchar {text}?,
+  attribute linebreakstyle {"before" | "after" | "duplicate" | "infixlinebreakstyle"}?,
+  attribute lineleading {length}?,
+  attribute linethickness {length | "thin" | "medium" | "thick"}?,
+  attribute location {"w" | "nw" | "n" | "ne" | "e" | "se" | "s" | "sw"}?,
+  attribute longdivstyle {"lefttop" | "stackedrightright" | "mediumstackedrightright" | "shortstackedrightright" | "righttop" | "left/\right" | "left)(right" | ":right=right" | "stackedleftleft" | "stackedleftlinetop"}?,
+  attribute lquote {text}?,
+  attribute lspace {length}?,
+  attribute mathsize {"small" | "normal" | "big" | length}?,
+  attribute mathvariant {"normal" | "bold" | "italic" | "bold-italic" | "double-struck" | "bold-fraktur" | "script" | "bold-script" | "fraktur" | "sans-serif" | "bold-sans-serif" | "sans-serif-italic" | "sans-serif-bold-italic" | "monospace" | "initial" | "tailed" | "looped" | "stretched"}?,
+  attribute maxsize {length | "infinity"}?,
+  attribute minlabelspacing {length}?,
+  attribute minsize {length}?,
+  attribute movablelimits {"true" | "false"}?,
+  attribute mslinethickness {length | "thin" | "medium" | "thick"}?,
+  attribute notation {text}?,
+  attribute numalign {"left" | "center" | "right"}?,
+  attribute open {text}?,
+  attribute position {integer}?,
+  attribute rightoverhang {length}?,
+  attribute rowalign {list {verticalalign+} }?,
+  attribute rowlines {list {linestyle +}}?,
+  attribute rowspacing {list {(length) +}}?,
+  attribute rowspan {positive-integer}?,
+  attribute rquote {text}?,
+  attribute rspace {length}?,
+  attribute selection {positive-integer}?,
+  attribute separator {"true" | "false"}?,
+  attribute separators {text}?,
+  attribute shift {integer}?,
+  attribute side {"left" | "right" | "leftoverlap" | "rightoverlap"}?,
+  attribute stackalign {"left" | "center" | "right" | "decimalpoint"}?,
+  attribute stretchy {"true" | "false"}?,
+  attribute subscriptshift {length}?,
+  attribute superscriptshift {length}?,
+  attribute symmetric {"true" | "false"}?,
+  attribute valign {length}?,
+  attribute width {length}?
+
+mstyle.deprecatedattributes =
+  DeprecatedTokenAtt,
+  attribute veryverythinmathspace {length}?,
+  attribute verythinmathspace {length}?,
+  attribute thinmathspace {length}?,
+  attribute mediummathspace {length}?,
+  attribute thickmathspace {length}?,
+  attribute verythickmathspace {length}?,
+  attribute veryverythickmathspace {length}?
+
+math.attributes &= CommonPresAtt
+math.attributes &= mstyle.specificattributes
+math.attributes &= mstyle.generalattributes
+
+
+
+
+merror = element merror {merror.attributes, ImpliedMrow}
+merror.attributes = 
+  CommonAtt, CommonPresAtt
+
+
+mpadded = element mpadded {mpadded.attributes, ImpliedMrow}
+mpadded.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute height {mpadded-length}?,
+  attribute depth {mpadded-length}?,
+  attribute width {mpadded-length}?,
+  attribute lspace {mpadded-length}?,
+  attribute voffset {mpadded-length}?
+
+
+mphantom = element mphantom {mphantom.attributes, ImpliedMrow}
+mphantom.attributes = 
+  CommonAtt, CommonPresAtt
+
+
+mfenced = element mfenced {mfenced.attributes, MathExpression*}
+mfenced.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute open {text}?,
+  attribute close {text}?,
+  attribute separators {text}?
+
+
+menclose = element menclose {menclose.attributes, ImpliedMrow}
+menclose.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute notation {text}?
+
+
+msub = element msub {msub.attributes, MathExpression, MathExpression}
+msub.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute subscriptshift {length}?
+
+
+msup = element msup {msup.attributes, MathExpression, MathExpression}
+msup.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute superscriptshift {length}?
+
+
+msubsup = element msubsup {msubsup.attributes, MathExpression, MathExpression, MathExpression}
+msubsup.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute subscriptshift {length}?,
+  attribute superscriptshift {length}?
+
+
+munder = element munder {munder.attributes, MathExpression, MathExpression}
+munder.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute accentunder {"true" | "false"}?,
+  attribute align {"left" | "right" | "center"}?
+
+
+mover = element mover {mover.attributes, MathExpression, MathExpression}
+mover.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute accent {"true" | "false"}?,
+  attribute align {"left" | "right" | "center"}?
+
+
+munderover = element munderover {munderover.attributes, MathExpression, MathExpression, MathExpression}
+munderover.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute accent {"true" | "false"}?,
+  attribute accentunder {"true" | "false"}?,
+  attribute align {"left" | "right" | "center"}?
+
+
+mmultiscripts = element mmultiscripts {mmultiscripts.attributes, MathExpression,MultiScriptExpression*,(mprescripts,MultiScriptExpression*)?}
+mmultiscripts.attributes = 
+  msubsup.attributes
+
+
+mtable = element mtable {mtable.attributes, TableRowExpression*}
+mtable.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute align {xsd:string {
+    pattern ='\s*(top|bottom|center|baseline|axis)(\s+-?[0-9]+)?\s*'}}?,
+  attribute rowalign {list {verticalalign+} }?,
+  attribute columnalign {list {columnalignstyle+} }?,
+  attribute groupalign {group-alignment-list-list}?,
+  attribute alignmentscope {list {("true" | "false") +}}?,
+  attribute columnwidth {list {("auto" | length | "fit") +}}?,
+  attribute width {"auto" | length}?,
+  attribute rowspacing {list {(length) +}}?,
+  attribute columnspacing {list {(length) +}}?,
+  attribute rowlines {list {linestyle +}}?,
+  attribute columnlines {list {linestyle +}}?,
+  attribute frame {linestyle}?,
+  attribute framespacing {list {length, length}}?,
+  attribute equalrows {"true" | "false"}?,
+  attribute equalcolumns {"true" | "false"}?,
+  attribute displaystyle {"true" | "false"}?,
+  attribute side {"left" | "right" | "leftoverlap" | "rightoverlap"}?,
+  attribute minlabelspacing {length}?
+
+
+mlabeledtr = element mlabeledtr {mlabeledtr.attributes, TableCellExpression+}
+mlabeledtr.attributes = 
+  mtr.attributes
+
+
+mtr = element mtr {mtr.attributes, TableCellExpression*}
+mtr.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute rowalign {"top" | "bottom" | "center" | "baseline" | "axis"}?,
+  attribute columnalign {list {columnalignstyle+} }?,
+  attribute groupalign {group-alignment-list-list}?
+
+
+mtd = element mtd {mtd.attributes, ImpliedMrow}
+mtd.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute rowspan {positive-integer}?,
+  attribute columnspan {positive-integer}?,
+  attribute rowalign {"top" | "bottom" | "center" | "baseline" | "axis"}?,
+  attribute columnalign {columnalignstyle}?,
+  attribute groupalign {group-alignment-list}?
+
+
+mstack = element mstack {mstack.attributes, MstackExpression*}
+mstack.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute align {xsd:string {
+    pattern ='\s*(top|bottom|center|baseline|axis)(\s+-?[0-9]+)?\s*'}}?,
+  attribute stackalign {"left" | "center" | "right" | "decimalpoint"}?,
+  attribute charalign {"left" | "center" | "right"}?,
+  attribute charspacing {length | "loose" | "medium" | "tight"}?
+
+
+mlongdiv = element mlongdiv {mlongdiv.attributes, MstackExpression,MstackExpression,MstackExpression+}
+mlongdiv.attributes = 
+  msgroup.attributes,
+  attribute longdivstyle {"lefttop" | "stackedrightright" | "mediumstackedrightright" | "shortstackedrightright" | "righttop" | "left/\right" | "left)(right" | ":right=right" | "stackedleftleft" | "stackedleftlinetop"}?
+
+
+msgroup = element msgroup {msgroup.attributes, MstackExpression*}
+msgroup.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute position {integer}?,
+  attribute shift {integer}?
+
+
+msrow = element msrow {msrow.attributes, MsrowExpression*}
+msrow.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute position {integer}?
+
+
+mscarries = element mscarries {mscarries.attributes, (MsrowExpression|mscarry)*}
+mscarries.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute position {integer}?,
+  attribute location {"w" | "nw" | "n" | "ne" | "e" | "se" | "s" | "sw"}?,
+  attribute crossout {list {("none" | "updiagonalstrike" | "downdiagonalstrike" | "verticalstrike" | "horizontalstrike")*}}?,
+  attribute scriptsizemultiplier {number}?
+
+
+mscarry = element mscarry {mscarry.attributes, MsrowExpression*}
+mscarry.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute location {"w" | "nw" | "n" | "ne" | "e" | "se" | "s" | "sw"}?,
+  attribute crossout {list {("none" | "updiagonalstrike" | "downdiagonalstrike" | "verticalstrike" | "horizontalstrike")*}}?
+
+
+maction = element maction {maction.attributes, MathExpression+}
+maction.attributes = 
+  CommonAtt, CommonPresAtt,
+  attribute actiontype {text},
+  attribute selection {positive-integer}?
diff --git a/app/report/mathml3/mathml3-presentation.rng b/app/report/mathml3/mathml3-presentation.rng
new file mode 100644
index 0000000..2b56d56
--- /dev/null
+++ b/app/report/mathml3/mathml3-presentation.rng
@@ -0,0 +1,2324 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+      This is the Mathematical Markup Language (MathML) 3.0, an XML
+      application for describing mathematical notation and capturing
+      both its structure and content.
+  
+      Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
+  
+      Use and distribution of this code are permitted under the terms
+      W3C Software Notice and License
+      http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+<grammar ns="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <define name="MathExpression" combine="choice">
+    <ref name="PresentationExpression"/>
+  </define>
+  <define name="ImpliedMrow">
+    <zeroOrMore>
+      <ref name="MathExpression"/>
+    </zeroOrMore>
+  </define>
+  <define name="TableRowExpression">
+    <choice>
+      <ref name="mtr"/>
+      <ref name="mlabeledtr"/>
+    </choice>
+  </define>
+  <define name="TableCellExpression">
+    <ref name="mtd"/>
+  </define>
+  <define name="MstackExpression">
+    <choice>
+      <ref name="MathExpression"/>
+      <ref name="mscarries"/>
+      <ref name="msline"/>
+      <ref name="msrow"/>
+      <ref name="msgroup"/>
+    </choice>
+  </define>
+  <define name="MsrowExpression">
+    <choice>
+      <ref name="MathExpression"/>
+      <ref name="none"/>
+    </choice>
+  </define>
+  <define name="MultiScriptExpression">
+    <choice>
+      <ref name="MathExpression"/>
+      <ref name="none"/>
+    </choice>
+    <choice>
+      <ref name="MathExpression"/>
+      <ref name="none"/>
+    </choice>
+  </define>
+  <define name="mpadded-length">
+    <data type="string">
+      <param name="pattern">\s*([\+\-]?[0-9]*([0-9]\.?|\.[0-9])[0-9]*\s*((%?\s*(height|depth|width)?)|e[mx]|in|cm|mm|p[xtc]|((negative)?((very){0,2}thi(n|ck)|medium)mathspace))?)\s*</param>
+    </data>
+  </define>
+  <define name="linestyle">
+    <choice>
+      <value>none</value>
+      <value>solid</value>
+      <value>dashed</value>
+    </choice>
+  </define>
+  <define name="verticalalign">
+    <choice>
+      <value>top</value>
+      <value>bottom</value>
+      <value>center</value>
+      <value>baseline</value>
+      <value>axis</value>
+    </choice>
+  </define>
+  <define name="columnalignstyle">
+    <choice>
+      <value>left</value>
+      <value>center</value>
+      <value>right</value>
+    </choice>
+  </define>
+  <define name="notationstyle">
+    <choice>
+      <value>longdiv</value>
+      <value>actuarial</value>
+      <value>radical</value>
+      <value>box</value>
+      <value>roundedbox</value>
+      <value>circle</value>
+      <value>left</value>
+      <value>right</value>
+      <value>top</value>
+      <value>bottom</value>
+      <value>updiagonalstrike</value>
+      <value>downdiagonalstrike</value>
+      <value>verticalstrike</value>
+      <value>horizontalstrike</value>
+      <value>madruwb</value>
+    </choice>
+  </define>
+  <define name="idref">
+    <text/>
+  </define>
+  <define name="unsigned-integer">
+    <data type="unsignedLong"/>
+  </define>
+  <define name="integer">
+    <data type="integer"/>
+  </define>
+  <define name="number">
+    <data type="decimal"/>
+  </define>
+  <define name="character">
+    <data type="string">
+      <param name="pattern">\s*\S\s*</param>
+    </data>
+  </define>
+  <define name="color">
+    <data type="string">
+      <param name="pattern">\s*((#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?)|[aA][qQ][uU][aA]|[bB][lL][aA][cC][kK]|[bB][lL][uU][eE]|[fF][uU][cC][hH][sS][iI][aA]|[gG][rR][aA][yY]|[gG][rR][eE][eE][nN]|[lL][iI][mM][eE]|[mM][aA][rR][oO][oO][nN]|[nN][aA][vV][yY]|[oO][lL][iI][vV][eE]|[pP][uU][rR][pP][lL][eE]|[rR][eE][dD]|[sS][iI][lL][vV][eE][rR]|[tT][eE][aA][lL]|[wW][hH][iI][tT][eE]|[yY][eE][lL][lL][oO][wW])\s*</param>
+    </data>
+  </define>
+  <define name="group-alignment">
+    <choice>
+      <value>left</value>
+      <value>center</value>
+      <value>right</value>
+      <value>decimalpoint</value>
+    </choice>
+  </define>
+  <define name="group-alignment-list">
+    <list>
+      <oneOrMore>
+        <ref name="group-alignment"/>
+      </oneOrMore>
+    </list>
+  </define>
+  <define name="group-alignment-list-list">
+    <data type="string">
+      <param name="pattern">(\s*\{\s*(left|center|right|decimalpoint)(\s+(left|center|right|decimalpoint))*\})*\s*</param>
+    </data>
+  </define>
+  <define name="positive-integer">
+    <data type="positiveInteger"/>
+  </define>
+  <define name="TokenExpression">
+    <choice>
+      <ref name="mi"/>
+      <ref name="mn"/>
+      <ref name="mo"/>
+      <ref name="mtext"/>
+      <ref name="mspace"/>
+      <ref name="ms"/>
+    </choice>
+  </define>
+  <define name="token.content">
+    <choice>
+      <ref name="mglyph"/>
+      <ref name="malignmark"/>
+      <text/>
+    </choice>
+  </define>
+  <define name="mi">
+    <element name="mi">
+      <ref name="mi.attributes"/>
+      <zeroOrMore>
+        <ref name="token.content"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="mi.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <ref name="TokenAtt"/>
+  </define>
+  <define name="mn">
+    <element name="mn">
+      <ref name="mn.attributes"/>
+      <zeroOrMore>
+        <ref name="token.content"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="mn.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <ref name="TokenAtt"/>
+  </define>
+  <define name="mo">
+    <element name="mo">
+      <ref name="mo.attributes"/>
+      <zeroOrMore>
+        <ref name="token.content"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="mo.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <ref name="TokenAtt"/>
+    <optional>
+      <attribute name="form">
+        <choice>
+          <value>prefix</value>
+          <value>infix</value>
+          <value>postfix</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="fence">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="separator">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="lspace">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="rspace">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="stretchy">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="symmetric">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="maxsize">
+        <choice>
+          <ref name="length"/>
+          <value>infinity</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="minsize">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="largeop">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="movablelimits">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="accent">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="linebreak">
+        <choice>
+          <value>auto</value>
+          <value>newline</value>
+          <value>nobreak</value>
+          <value>goodbreak</value>
+          <value>badbreak</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="lineleading">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="linebreakstyle">
+        <choice>
+          <value>before</value>
+          <value>after</value>
+          <value>duplicate</value>
+          <value>infixlinebreakstyle</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="linebreakmultchar"/>
+    </optional>
+    <optional>
+      <attribute name="indentalign">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+          <value>auto</value>
+          <value>id</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentshift">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indenttarget">
+        <ref name="idref"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentalignfirst">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+          <value>auto</value>
+          <value>id</value>
+          <value>indentalign</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentshiftfirst">
+        <choice>
+          <ref name="length"/>
+          <value>indentshift</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentalignlast">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+          <value>auto</value>
+          <value>id</value>
+          <value>indentalign</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentshiftlast">
+        <choice>
+          <ref name="length"/>
+          <value>indentshift</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mtext">
+    <element name="mtext">
+      <ref name="mtext.attributes"/>
+      <zeroOrMore>
+        <ref name="token.content"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="mtext.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <ref name="TokenAtt"/>
+  </define>
+  <define name="mspace">
+    <element name="mspace">
+      <ref name="mspace.attributes"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="mspace.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <ref name="TokenAtt"/>
+    <optional>
+      <attribute name="width">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="height">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="depth">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="linebreak">
+        <choice>
+          <value>auto</value>
+          <value>newline</value>
+          <value>nobreak</value>
+          <value>goodbreak</value>
+          <value>badbreak</value>
+          <value>indentingnewline</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentalign">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+          <value>auto</value>
+          <value>id</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentshift">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indenttarget">
+        <ref name="idref"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentalignfirst">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+          <value>auto</value>
+          <value>id</value>
+          <value>indentalign</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentshiftfirst">
+        <choice>
+          <ref name="length"/>
+          <value>indentshift</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentalignlast">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+          <value>auto</value>
+          <value>id</value>
+          <value>indentalign</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentshiftlast">
+        <choice>
+          <ref name="length"/>
+          <value>indentshift</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="ms">
+    <element name="ms">
+      <ref name="ms.attributes"/>
+      <zeroOrMore>
+        <ref name="token.content"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="ms.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <ref name="TokenAtt"/>
+    <optional>
+      <attribute name="lquote"/>
+    </optional>
+    <optional>
+      <attribute name="rquote"/>
+    </optional>
+  </define>
+  <define name="mglyph">
+    <element name="mglyph">
+      <ref name="mglyph.attributes"/>
+      <ref name="mglyph.deprecatedattributes"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="mglyph.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="src">
+        <data type="anyURI"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="width">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="height">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="valign">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="alt"/>
+    </optional>
+  </define>
+  <define name="mglyph.deprecatedattributes">
+    <optional>
+      <attribute name="index">
+        <ref name="integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="mathvariant">
+        <choice>
+          <value>normal</value>
+          <value>bold</value>
+          <value>italic</value>
+          <value>bold-italic</value>
+          <value>double-struck</value>
+          <value>bold-fraktur</value>
+          <value>script</value>
+          <value>bold-script</value>
+          <value>fraktur</value>
+          <value>sans-serif</value>
+          <value>bold-sans-serif</value>
+          <value>sans-serif-italic</value>
+          <value>sans-serif-bold-italic</value>
+          <value>monospace</value>
+          <value>initial</value>
+          <value>tailed</value>
+          <value>looped</value>
+          <value>stretched</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="mathsize">
+        <choice>
+          <value>small</value>
+          <value>normal</value>
+          <value>big</value>
+          <ref name="length"/>
+        </choice>
+      </attribute>
+    </optional>
+    <ref name="DeprecatedTokenAtt"/>
+  </define>
+  <define name="msline">
+    <element name="msline">
+      <ref name="msline.attributes"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="msline.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="position">
+        <ref name="integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="length">
+        <ref name="unsigned-integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="leftoverhang">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="rightoverhang">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="mslinethickness">
+        <choice>
+          <ref name="length"/>
+          <value>thin</value>
+          <value>medium</value>
+          <value>thick</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="none">
+    <element name="none">
+      <ref name="none.attributes"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="none.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+  </define>
+  <define name="mprescripts">
+    <element name="mprescripts">
+      <ref name="mprescripts.attributes"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="mprescripts.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+  </define>
+  <define name="CommonPresAtt">
+    <optional>
+      <attribute name="mathcolor">
+        <ref name="color"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="mathbackground">
+        <choice>
+          <ref name="color"/>
+          <value>transparent</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="TokenAtt">
+    <optional>
+      <attribute name="mathvariant">
+        <choice>
+          <value>normal</value>
+          <value>bold</value>
+          <value>italic</value>
+          <value>bold-italic</value>
+          <value>double-struck</value>
+          <value>bold-fraktur</value>
+          <value>script</value>
+          <value>bold-script</value>
+          <value>fraktur</value>
+          <value>sans-serif</value>
+          <value>bold-sans-serif</value>
+          <value>sans-serif-italic</value>
+          <value>sans-serif-bold-italic</value>
+          <value>monospace</value>
+          <value>initial</value>
+          <value>tailed</value>
+          <value>looped</value>
+          <value>stretched</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="mathsize">
+        <choice>
+          <value>small</value>
+          <value>normal</value>
+          <value>big</value>
+          <ref name="length"/>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="dir">
+        <choice>
+          <value>ltr</value>
+          <value>rtl</value>
+        </choice>
+      </attribute>
+    </optional>
+    <ref name="DeprecatedTokenAtt"/>
+  </define>
+  <define name="DeprecatedTokenAtt">
+    <optional>
+      <attribute name="fontfamily"/>
+    </optional>
+    <optional>
+      <attribute name="fontweight">
+        <choice>
+          <value>normal</value>
+          <value>bold</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="fontstyle">
+        <choice>
+          <value>normal</value>
+          <value>italic</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="fontsize">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="color">
+        <ref name="color"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="background">
+        <choice>
+          <ref name="color"/>
+          <value>transparent</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="MalignExpression">
+    <choice>
+      <ref name="maligngroup"/>
+      <ref name="malignmark"/>
+    </choice>
+  </define>
+  <define name="malignmark">
+    <element name="malignmark">
+      <ref name="malignmark.attributes"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="malignmark.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="edge">
+        <choice>
+          <value>left</value>
+          <value>right</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="maligngroup">
+    <element name="maligngroup">
+      <ref name="maligngroup.attributes"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="maligngroup.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="groupalign">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+          <value>decimalpoint</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="PresentationExpression">
+    <choice>
+      <ref name="TokenExpression"/>
+      <ref name="MalignExpression"/>
+      <ref name="mrow"/>
+      <ref name="mfrac"/>
+      <ref name="msqrt"/>
+      <ref name="mroot"/>
+      <ref name="mstyle"/>
+      <ref name="merror"/>
+      <ref name="mpadded"/>
+      <ref name="mphantom"/>
+      <ref name="mfenced"/>
+      <ref name="menclose"/>
+      <ref name="msub"/>
+      <ref name="msup"/>
+      <ref name="msubsup"/>
+      <ref name="munder"/>
+      <ref name="mover"/>
+      <ref name="munderover"/>
+      <ref name="mmultiscripts"/>
+      <ref name="mtable"/>
+      <ref name="mstack"/>
+      <ref name="mlongdiv"/>
+      <ref name="maction"/>
+    </choice>
+  </define>
+  <define name="mrow">
+    <element name="mrow">
+      <ref name="mrow.attributes"/>
+      <zeroOrMore>
+        <ref name="MathExpression"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="mrow.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="dir">
+        <choice>
+          <value>ltr</value>
+          <value>rtl</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mfrac">
+    <element name="mfrac">
+      <ref name="mfrac.attributes"/>
+      <ref name="MathExpression"/>
+      <ref name="MathExpression"/>
+    </element>
+  </define>
+  <define name="mfrac.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="linethickness">
+        <choice>
+          <ref name="length"/>
+          <value>thin</value>
+          <value>medium</value>
+          <value>thick</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="numalign">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="denomalign">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="bevelled">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="msqrt">
+    <element name="msqrt">
+      <ref name="msqrt.attributes"/>
+      <ref name="ImpliedMrow"/>
+    </element>
+  </define>
+  <define name="msqrt.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+  </define>
+  <define name="mroot">
+    <element name="mroot">
+      <ref name="mroot.attributes"/>
+      <ref name="MathExpression"/>
+      <ref name="MathExpression"/>
+    </element>
+  </define>
+  <define name="mroot.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+  </define>
+  <define name="mstyle">
+    <element name="mstyle">
+      <ref name="mstyle.attributes"/>
+      <ref name="ImpliedMrow"/>
+    </element>
+  </define>
+  <define name="mstyle.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <ref name="mstyle.specificattributes"/>
+    <ref name="mstyle.generalattributes"/>
+    <ref name="mstyle.deprecatedattributes"/>
+  </define>
+  <define name="mstyle.specificattributes">
+    <optional>
+      <attribute name="scriptlevel">
+        <ref name="integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="displaystyle">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="scriptsizemultiplier">
+        <ref name="number"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="scriptminsize">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="infixlinebreakstyle">
+        <choice>
+          <value>before</value>
+          <value>after</value>
+          <value>duplicate</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="decimalpoint">
+        <ref name="character"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mstyle.generalattributes">
+    <optional>
+      <attribute name="accent">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="accentunder">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="align">
+        <choice>
+          <value>left</value>
+          <value>right</value>
+          <value>center</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="alignmentscope">
+        <list>
+          <oneOrMore>
+            <choice>
+              <value>true</value>
+              <value>false</value>
+            </choice>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="bevelled">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="charalign">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="charspacing">
+        <choice>
+          <ref name="length"/>
+          <value>loose</value>
+          <value>medium</value>
+          <value>tight</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="close"/>
+    </optional>
+    <optional>
+      <attribute name="columnalign">
+        <list>
+          <oneOrMore>
+            <ref name="columnalignstyle"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="columnlines">
+        <list>
+          <oneOrMore>
+            <ref name="linestyle"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="columnspacing">
+        <list>
+          <oneOrMore>
+            <ref name="length"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="columnspan">
+        <ref name="positive-integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="columnwidth">
+        <list>
+          <oneOrMore>
+            <choice>
+              <value>auto</value>
+              <ref name="length"/>
+              <value>fit</value>
+            </choice>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="crossout">
+        <list>
+          <zeroOrMore>
+            <choice>
+              <value>none</value>
+              <value>updiagonalstrike</value>
+              <value>downdiagonalstrike</value>
+              <value>verticalstrike</value>
+              <value>horizontalstrike</value>
+            </choice>
+          </zeroOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="denomalign">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="depth">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="dir">
+        <choice>
+          <value>ltr</value>
+          <value>rtl</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="edge">
+        <choice>
+          <value>left</value>
+          <value>right</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="equalcolumns">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="equalrows">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="fence">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="form">
+        <choice>
+          <value>prefix</value>
+          <value>infix</value>
+          <value>postfix</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="frame">
+        <ref name="linestyle"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="framespacing">
+        <list>
+          <ref name="length"/>
+          <ref name="length"/>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="groupalign">
+        <ref name="group-alignment-list-list"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="height">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentalign">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+          <value>auto</value>
+          <value>id</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentalignfirst">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+          <value>auto</value>
+          <value>id</value>
+          <value>indentalign</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentalignlast">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+          <value>auto</value>
+          <value>id</value>
+          <value>indentalign</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentshift">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentshiftfirst">
+        <choice>
+          <ref name="length"/>
+          <value>indentshift</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indentshiftlast">
+        <choice>
+          <ref name="length"/>
+          <value>indentshift</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="indenttarget">
+        <ref name="idref"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="largeop">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="leftoverhang">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="length">
+        <ref name="unsigned-integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="linebreak">
+        <choice>
+          <value>auto</value>
+          <value>newline</value>
+          <value>nobreak</value>
+          <value>goodbreak</value>
+          <value>badbreak</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="linebreakmultchar"/>
+    </optional>
+    <optional>
+      <attribute name="linebreakstyle">
+        <choice>
+          <value>before</value>
+          <value>after</value>
+          <value>duplicate</value>
+          <value>infixlinebreakstyle</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="lineleading">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="linethickness">
+        <choice>
+          <ref name="length"/>
+          <value>thin</value>
+          <value>medium</value>
+          <value>thick</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="location">
+        <choice>
+          <value>w</value>
+          <value>nw</value>
+          <value>n</value>
+          <value>ne</value>
+          <value>e</value>
+          <value>se</value>
+          <value>s</value>
+          <value>sw</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="longdivstyle">
+        <choice>
+          <value>lefttop</value>
+          <value>stackedrightright</value>
+          <value>mediumstackedrightright</value>
+          <value>shortstackedrightright</value>
+          <value>righttop</value>
+          <value>left/\right</value>
+          <value>left)(right</value>
+          <value>:right=right</value>
+          <value>stackedleftleft</value>
+          <value>stackedleftlinetop</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="lquote"/>
+    </optional>
+    <optional>
+      <attribute name="lspace">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="mathsize">
+        <choice>
+          <value>small</value>
+          <value>normal</value>
+          <value>big</value>
+          <ref name="length"/>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="mathvariant">
+        <choice>
+          <value>normal</value>
+          <value>bold</value>
+          <value>italic</value>
+          <value>bold-italic</value>
+          <value>double-struck</value>
+          <value>bold-fraktur</value>
+          <value>script</value>
+          <value>bold-script</value>
+          <value>fraktur</value>
+          <value>sans-serif</value>
+          <value>bold-sans-serif</value>
+          <value>sans-serif-italic</value>
+          <value>sans-serif-bold-italic</value>
+          <value>monospace</value>
+          <value>initial</value>
+          <value>tailed</value>
+          <value>looped</value>
+          <value>stretched</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="maxsize">
+        <choice>
+          <ref name="length"/>
+          <value>infinity</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="minlabelspacing">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="minsize">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="movablelimits">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="mslinethickness">
+        <choice>
+          <ref name="length"/>
+          <value>thin</value>
+          <value>medium</value>
+          <value>thick</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="notation"/>
+    </optional>
+    <optional>
+      <attribute name="numalign">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="open"/>
+    </optional>
+    <optional>
+      <attribute name="position">
+        <ref name="integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="rightoverhang">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="rowalign">
+        <list>
+          <oneOrMore>
+            <ref name="verticalalign"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="rowlines">
+        <list>
+          <oneOrMore>
+            <ref name="linestyle"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="rowspacing">
+        <list>
+          <oneOrMore>
+            <ref name="length"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="rowspan">
+        <ref name="positive-integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="rquote"/>
+    </optional>
+    <optional>
+      <attribute name="rspace">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="selection">
+        <ref name="positive-integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="separator">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="separators"/>
+    </optional>
+    <optional>
+      <attribute name="shift">
+        <ref name="integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="side">
+        <choice>
+          <value>left</value>
+          <value>right</value>
+          <value>leftoverlap</value>
+          <value>rightoverlap</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="stackalign">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+          <value>decimalpoint</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="stretchy">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="subscriptshift">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="superscriptshift">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="symmetric">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="valign">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="width">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mstyle.deprecatedattributes">
+    <ref name="DeprecatedTokenAtt"/>
+    <optional>
+      <attribute name="veryverythinmathspace">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="verythinmathspace">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="thinmathspace">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="mediummathspace">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="thickmathspace">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="verythickmathspace">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="veryverythickmathspace">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="math.attributes" combine="interleave">
+    <ref name="CommonPresAtt"/>
+  </define>
+  <define name="math.attributes" combine="interleave">
+    <ref name="mstyle.specificattributes"/>
+  </define>
+  <define name="math.attributes" combine="interleave">
+    <ref name="mstyle.generalattributes"/>
+  </define>
+  <define name="merror">
+    <element name="merror">
+      <ref name="merror.attributes"/>
+      <ref name="ImpliedMrow"/>
+    </element>
+  </define>
+  <define name="merror.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+  </define>
+  <define name="mpadded">
+    <element name="mpadded">
+      <ref name="mpadded.attributes"/>
+      <ref name="ImpliedMrow"/>
+    </element>
+  </define>
+  <define name="mpadded.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="height">
+        <ref name="mpadded-length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="depth">
+        <ref name="mpadded-length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="width">
+        <ref name="mpadded-length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="lspace">
+        <ref name="mpadded-length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="voffset">
+        <ref name="mpadded-length"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mphantom">
+    <element name="mphantom">
+      <ref name="mphantom.attributes"/>
+      <ref name="ImpliedMrow"/>
+    </element>
+  </define>
+  <define name="mphantom.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+  </define>
+  <define name="mfenced">
+    <element name="mfenced">
+      <ref name="mfenced.attributes"/>
+      <zeroOrMore>
+        <ref name="MathExpression"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="mfenced.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="open"/>
+    </optional>
+    <optional>
+      <attribute name="close"/>
+    </optional>
+    <optional>
+      <attribute name="separators"/>
+    </optional>
+  </define>
+  <define name="menclose">
+    <element name="menclose">
+      <ref name="menclose.attributes"/>
+      <ref name="ImpliedMrow"/>
+    </element>
+  </define>
+  <define name="menclose.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="notation"/>
+    </optional>
+  </define>
+  <define name="msub">
+    <element name="msub">
+      <ref name="msub.attributes"/>
+      <ref name="MathExpression"/>
+      <ref name="MathExpression"/>
+    </element>
+  </define>
+  <define name="msub.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="subscriptshift">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="msup">
+    <element name="msup">
+      <ref name="msup.attributes"/>
+      <ref name="MathExpression"/>
+      <ref name="MathExpression"/>
+    </element>
+  </define>
+  <define name="msup.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="superscriptshift">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="msubsup">
+    <element name="msubsup">
+      <ref name="msubsup.attributes"/>
+      <ref name="MathExpression"/>
+      <ref name="MathExpression"/>
+      <ref name="MathExpression"/>
+    </element>
+  </define>
+  <define name="msubsup.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="subscriptshift">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="superscriptshift">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="munder">
+    <element name="munder">
+      <ref name="munder.attributes"/>
+      <ref name="MathExpression"/>
+      <ref name="MathExpression"/>
+    </element>
+  </define>
+  <define name="munder.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="accentunder">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="align">
+        <choice>
+          <value>left</value>
+          <value>right</value>
+          <value>center</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mover">
+    <element name="mover">
+      <ref name="mover.attributes"/>
+      <ref name="MathExpression"/>
+      <ref name="MathExpression"/>
+    </element>
+  </define>
+  <define name="mover.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="accent">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="align">
+        <choice>
+          <value>left</value>
+          <value>right</value>
+          <value>center</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="munderover">
+    <element name="munderover">
+      <ref name="munderover.attributes"/>
+      <ref name="MathExpression"/>
+      <ref name="MathExpression"/>
+      <ref name="MathExpression"/>
+    </element>
+  </define>
+  <define name="munderover.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="accent">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="accentunder">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="align">
+        <choice>
+          <value>left</value>
+          <value>right</value>
+          <value>center</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mmultiscripts">
+    <element name="mmultiscripts">
+      <ref name="mmultiscripts.attributes"/>
+      <ref name="MathExpression"/>
+      <zeroOrMore>
+        <ref name="MultiScriptExpression"/>
+      </zeroOrMore>
+      <optional>
+        <ref name="mprescripts"/>
+        <zeroOrMore>
+          <ref name="MultiScriptExpression"/>
+        </zeroOrMore>
+      </optional>
+    </element>
+  </define>
+  <define name="mmultiscripts.attributes">
+    <ref name="msubsup.attributes"/>
+  </define>
+  <define name="mtable">
+    <element name="mtable">
+      <ref name="mtable.attributes"/>
+      <zeroOrMore>
+        <ref name="TableRowExpression"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="mtable.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="align">
+        <data type="string">
+          <param name="pattern">\s*(top|bottom|center|baseline|axis)(\s+-?[0-9]+)?\s*</param>
+        </data>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="rowalign">
+        <list>
+          <oneOrMore>
+            <ref name="verticalalign"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="columnalign">
+        <list>
+          <oneOrMore>
+            <ref name="columnalignstyle"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="groupalign">
+        <ref name="group-alignment-list-list"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="alignmentscope">
+        <list>
+          <oneOrMore>
+            <choice>
+              <value>true</value>
+              <value>false</value>
+            </choice>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="columnwidth">
+        <list>
+          <oneOrMore>
+            <choice>
+              <value>auto</value>
+              <ref name="length"/>
+              <value>fit</value>
+            </choice>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="width">
+        <choice>
+          <value>auto</value>
+          <ref name="length"/>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="rowspacing">
+        <list>
+          <oneOrMore>
+            <ref name="length"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="columnspacing">
+        <list>
+          <oneOrMore>
+            <ref name="length"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="rowlines">
+        <list>
+          <oneOrMore>
+            <ref name="linestyle"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="columnlines">
+        <list>
+          <oneOrMore>
+            <ref name="linestyle"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="frame">
+        <ref name="linestyle"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="framespacing">
+        <list>
+          <ref name="length"/>
+          <ref name="length"/>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="equalrows">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="equalcolumns">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="displaystyle">
+        <choice>
+          <value>true</value>
+          <value>false</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="side">
+        <choice>
+          <value>left</value>
+          <value>right</value>
+          <value>leftoverlap</value>
+          <value>rightoverlap</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="minlabelspacing">
+        <ref name="length"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mlabeledtr">
+    <element name="mlabeledtr">
+      <ref name="mlabeledtr.attributes"/>
+      <oneOrMore>
+        <ref name="TableCellExpression"/>
+      </oneOrMore>
+    </element>
+  </define>
+  <define name="mlabeledtr.attributes">
+    <ref name="mtr.attributes"/>
+  </define>
+  <define name="mtr">
+    <element name="mtr">
+      <ref name="mtr.attributes"/>
+      <zeroOrMore>
+        <ref name="TableCellExpression"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="mtr.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="rowalign">
+        <choice>
+          <value>top</value>
+          <value>bottom</value>
+          <value>center</value>
+          <value>baseline</value>
+          <value>axis</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="columnalign">
+        <list>
+          <oneOrMore>
+            <ref name="columnalignstyle"/>
+          </oneOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="groupalign">
+        <ref name="group-alignment-list-list"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mtd">
+    <element name="mtd">
+      <ref name="mtd.attributes"/>
+      <ref name="ImpliedMrow"/>
+    </element>
+  </define>
+  <define name="mtd.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="rowspan">
+        <ref name="positive-integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="columnspan">
+        <ref name="positive-integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="rowalign">
+        <choice>
+          <value>top</value>
+          <value>bottom</value>
+          <value>center</value>
+          <value>baseline</value>
+          <value>axis</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="columnalign">
+        <ref name="columnalignstyle"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="groupalign">
+        <ref name="group-alignment-list"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mstack">
+    <element name="mstack">
+      <ref name="mstack.attributes"/>
+      <zeroOrMore>
+        <ref name="MstackExpression"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="mstack.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="align">
+        <data type="string">
+          <param name="pattern">\s*(top|bottom|center|baseline|axis)(\s+-?[0-9]+)?\s*</param>
+        </data>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="stackalign">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+          <value>decimalpoint</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="charalign">
+        <choice>
+          <value>left</value>
+          <value>center</value>
+          <value>right</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="charspacing">
+        <choice>
+          <ref name="length"/>
+          <value>loose</value>
+          <value>medium</value>
+          <value>tight</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mlongdiv">
+    <element name="mlongdiv">
+      <ref name="mlongdiv.attributes"/>
+      <ref name="MstackExpression"/>
+      <ref name="MstackExpression"/>
+      <oneOrMore>
+        <ref name="MstackExpression"/>
+      </oneOrMore>
+    </element>
+  </define>
+  <define name="mlongdiv.attributes">
+    <ref name="msgroup.attributes"/>
+    <optional>
+      <attribute name="longdivstyle">
+        <choice>
+          <value>lefttop</value>
+          <value>stackedrightright</value>
+          <value>mediumstackedrightright</value>
+          <value>shortstackedrightright</value>
+          <value>righttop</value>
+          <value>left/\right</value>
+          <value>left)(right</value>
+          <value>:right=right</value>
+          <value>stackedleftleft</value>
+          <value>stackedleftlinetop</value>
+        </choice>
+      </attribute>
+    </optional>
+  </define>
+  <define name="msgroup">
+    <element name="msgroup">
+      <ref name="msgroup.attributes"/>
+      <zeroOrMore>
+        <ref name="MstackExpression"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="msgroup.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="position">
+        <ref name="integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="shift">
+        <ref name="integer"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="msrow">
+    <element name="msrow">
+      <ref name="msrow.attributes"/>
+      <zeroOrMore>
+        <ref name="MsrowExpression"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="msrow.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="position">
+        <ref name="integer"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mscarries">
+    <element name="mscarries">
+      <ref name="mscarries.attributes"/>
+      <zeroOrMore>
+        <choice>
+          <ref name="MsrowExpression"/>
+          <ref name="mscarry"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="mscarries.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="position">
+        <ref name="integer"/>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="location">
+        <choice>
+          <value>w</value>
+          <value>nw</value>
+          <value>n</value>
+          <value>ne</value>
+          <value>e</value>
+          <value>se</value>
+          <value>s</value>
+          <value>sw</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="crossout">
+        <list>
+          <zeroOrMore>
+            <choice>
+              <value>none</value>
+              <value>updiagonalstrike</value>
+              <value>downdiagonalstrike</value>
+              <value>verticalstrike</value>
+              <value>horizontalstrike</value>
+            </choice>
+          </zeroOrMore>
+        </list>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="scriptsizemultiplier">
+        <ref name="number"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="mscarry">
+    <element name="mscarry">
+      <ref name="mscarry.attributes"/>
+      <zeroOrMore>
+        <ref name="MsrowExpression"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="mscarry.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <optional>
+      <attribute name="location">
+        <choice>
+          <value>w</value>
+          <value>nw</value>
+          <value>n</value>
+          <value>ne</value>
+          <value>e</value>
+          <value>se</value>
+          <value>s</value>
+          <value>sw</value>
+        </choice>
+      </attribute>
+    </optional>
+    <optional>
+      <attribute name="crossout">
+        <list>
+          <zeroOrMore>
+            <choice>
+              <value>none</value>
+              <value>updiagonalstrike</value>
+              <value>downdiagonalstrike</value>
+              <value>verticalstrike</value>
+              <value>horizontalstrike</value>
+            </choice>
+          </zeroOrMore>
+        </list>
+      </attribute>
+    </optional>
+  </define>
+  <define name="maction">
+    <element name="maction">
+      <ref name="maction.attributes"/>
+      <oneOrMore>
+        <ref name="MathExpression"/>
+      </oneOrMore>
+    </element>
+  </define>
+  <define name="maction.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="CommonPresAtt"/>
+    <attribute name="actiontype"/>
+    <optional>
+      <attribute name="selection">
+        <ref name="positive-integer"/>
+      </attribute>
+    </optional>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/mathml3-strict-content.rnc b/app/report/mathml3/mathml3-strict-content.rnc
new file mode 100644
index 0000000..b88e498
--- /dev/null
+++ b/app/report/mathml3/mathml3-strict-content.rnc
@@ -0,0 +1,60 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
+# 
+#     Use and distribution of this code are permitted under the terms
+#     W3C Software Notice and License
+#     http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+
+default namespace m = "http://www.w3.org/1998/Math/MathML"
+
+ContExp = semantics-contexp | cn | ci | csymbol | apply | bind | share | cerror | cbytes | cs
+
+cn = element cn {cn.attributes,cn.content}
+cn.content = text
+cn.attributes = CommonAtt, attribute type {"integer" | "real" | "double" | "hexdouble"}
+
+semantics-ci = element semantics {semantics.attributes,(ci|semantics-ci), 
+  (annotation|annotation-xml)*}
+
+semantics-contexp = element semantics {semantics.attributes,ContExp, 
+  (annotation|annotation-xml)*}
+
+ci = element ci {ci.attributes, ci.content}
+ci.attributes = CommonAtt, ci.type?
+ci.type = attribute type {"integer" | "rational" | "real" | "complex" | "complex-polar" | "complex-cartesian" | "constant" | "function" | "vector" | "list" | "set" | "matrix"}
+ci.content = text
+
+
+csymbol = element csymbol {csymbol.attributes,csymbol.content}
+
+SymbolName = xsd:NCName
+csymbol.attributes = CommonAtt, cd
+csymbol.content = SymbolName
+
+BvarQ = bvar*
+bvar = element bvar {CommonAtt, (ci | semantics-ci)}
+
+apply = element apply {CommonAtt,apply.content}
+apply.content = ContExp+
+
+
+bind = element bind {CommonAtt,bind.content}
+bind.content = ContExp,bvar*,ContExp
+
+share = element share {CommonAtt, src, empty}
+
+cerror = element cerror {cerror.attributes, csymbol, ContExp*}
+cerror.attributes = CommonAtt
+
+cbytes = element cbytes {cbytes.attributes, base64}
+cbytes.attributes = CommonAtt
+base64 = xsd:base64Binary
+
+cs = element cs {cs.attributes, text}
+cs.attributes = CommonAtt
+
+MathExpression |= ContExp
diff --git a/app/report/mathml3/mathml3-strict-content.rng b/app/report/mathml3/mathml3-strict-content.rng
new file mode 100644
index 0000000..25e5162
--- /dev/null
+++ b/app/report/mathml3/mathml3-strict-content.rng
@@ -0,0 +1,205 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+      This is the Mathematical Markup Language (MathML) 3.0, an XML
+      application for describing mathematical notation and capturing
+      both its structure and content.
+  
+      Copyright 1998-2014 W3C (MIT, ERCIM, Keio, Beihang)
+  
+      Use and distribution of this code are permitted under the terms
+      W3C Software Notice and License
+      http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+<grammar ns="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <define name="ContExp">
+    <choice>
+      <ref name="semantics-contexp"/>
+      <ref name="cn"/>
+      <ref name="ci"/>
+      <ref name="csymbol"/>
+      <ref name="apply"/>
+      <ref name="bind"/>
+      <ref name="share"/>
+      <ref name="cerror"/>
+      <ref name="cbytes"/>
+      <ref name="cs"/>
+    </choice>
+  </define>
+  <define name="cn">
+    <element name="cn">
+      <ref name="cn.attributes"/>
+      <ref name="cn.content"/>
+    </element>
+  </define>
+  <define name="cn.content">
+    <text/>
+  </define>
+  <define name="cn.attributes">
+    <ref name="CommonAtt"/>
+    <attribute name="type">
+      <choice>
+        <value>integer</value>
+        <value>real</value>
+        <value>double</value>
+        <value>hexdouble</value>
+      </choice>
+    </attribute>
+  </define>
+  <define name="semantics-ci">
+    <element name="semantics">
+      <ref name="semantics.attributes"/>
+      <choice>
+        <ref name="ci"/>
+        <ref name="semantics-ci"/>
+      </choice>
+      <zeroOrMore>
+        <choice>
+          <ref name="annotation"/>
+          <ref name="annotation-xml"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="semantics-contexp">
+    <element name="semantics">
+      <ref name="semantics.attributes"/>
+      <ref name="ContExp"/>
+      <zeroOrMore>
+        <choice>
+          <ref name="annotation"/>
+          <ref name="annotation-xml"/>
+        </choice>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="ci">
+    <element name="ci">
+      <ref name="ci.attributes"/>
+      <ref name="ci.content"/>
+    </element>
+  </define>
+  <define name="ci.attributes">
+    <ref name="CommonAtt"/>
+    <optional>
+      <ref name="ci.type"/>
+    </optional>
+  </define>
+  <define name="ci.type">
+    <attribute name="type">
+      <choice>
+        <value>integer</value>
+        <value>rational</value>
+        <value>real</value>
+        <value>complex</value>
+        <value>complex-polar</value>
+        <value>complex-cartesian</value>
+        <value>constant</value>
+        <value>function</value>
+        <value>vector</value>
+        <value>list</value>
+        <value>set</value>
+        <value>matrix</value>
+      </choice>
+    </attribute>
+  </define>
+  <define name="ci.content">
+    <text/>
+  </define>
+  <define name="csymbol">
+    <element name="csymbol">
+      <ref name="csymbol.attributes"/>
+      <ref name="csymbol.content"/>
+    </element>
+  </define>
+  <define name="SymbolName">
+    <data type="NCName"/>
+  </define>
+  <define name="csymbol.attributes">
+    <ref name="CommonAtt"/>
+    <ref name="cd"/>
+  </define>
+  <define name="csymbol.content">
+    <ref name="SymbolName"/>
+  </define>
+  <define name="BvarQ">
+    <zeroOrMore>
+      <ref name="bvar"/>
+    </zeroOrMore>
+  </define>
+  <define name="bvar">
+    <element name="bvar">
+      <ref name="CommonAtt"/>
+      <choice>
+        <ref name="ci"/>
+        <ref name="semantics-ci"/>
+      </choice>
+    </element>
+  </define>
+  <define name="apply">
+    <element name="apply">
+      <ref name="CommonAtt"/>
+      <ref name="apply.content"/>
+    </element>
+  </define>
+  <define name="apply.content">
+    <oneOrMore>
+      <ref name="ContExp"/>
+    </oneOrMore>
+  </define>
+  <define name="bind">
+    <element name="bind">
+      <ref name="CommonAtt"/>
+      <ref name="bind.content"/>
+    </element>
+  </define>
+  <define name="bind.content">
+    <ref name="ContExp"/>
+    <zeroOrMore>
+      <ref name="bvar"/>
+    </zeroOrMore>
+    <ref name="ContExp"/>
+  </define>
+  <define name="share">
+    <element name="share">
+      <ref name="CommonAtt"/>
+      <ref name="src"/>
+      <empty/>
+    </element>
+  </define>
+  <define name="cerror">
+    <element name="cerror">
+      <ref name="cerror.attributes"/>
+      <ref name="csymbol"/>
+      <zeroOrMore>
+        <ref name="ContExp"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="cerror.attributes">
+    <ref name="CommonAtt"/>
+  </define>
+  <define name="cbytes">
+    <element name="cbytes">
+      <ref name="cbytes.attributes"/>
+      <ref name="base64"/>
+    </element>
+  </define>
+  <define name="cbytes.attributes">
+    <ref name="CommonAtt"/>
+  </define>
+  <define name="base64">
+    <data type="base64Binary"/>
+  </define>
+  <define name="cs">
+    <element name="cs">
+      <ref name="cs.attributes"/>
+      <text/>
+    </element>
+  </define>
+  <define name="cs.attributes">
+    <ref name="CommonAtt"/>
+  </define>
+  <define name="MathExpression" combine="choice">
+    <ref name="ContExp"/>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/mathml3-strict.rnc b/app/report/mathml3/mathml3-strict.rnc
new file mode 100644
index 0000000..0f9f0fa
--- /dev/null
+++ b/app/report/mathml3/mathml3-strict.rnc
@@ -0,0 +1,81 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2008 W3C (MIT, ERCIM, Keio)
+# 
+#     Use and distribution of this code are permitted under the terms
+#     W3C Software Notice and License
+#     http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+#
+#
+#     Revision:   $Id: mathml3-strict.rnc,v 1.3 2008/11/15 22:00:48 dcarlis Exp $
+#
+#    Update to MathML3 and Relax NG: David Carlisle and Michael Kohlhase
+#
+#  This is the RelaxNG schema module for the strict content part of MathML.
+
+default namespace m = "http://www.w3.org/1998/Math/MathML"
+
+include "mathml3-common.rnc"
+
+math.content |= ContExp
+
+#ednote(rnc:opel-content) What is the content of a operator element, currently all text?
+opel.content = text
+
+# we want to extend this in pragmatic CMathML, so we introduce abbrevs here.
+#ednote(rnc:cn-content) What is the content of a cn?
+cn.content = text |(cn,cn)
+cn.type.vals  = "integer"|"real"|"double"
+
+cn = element cn {attribute base {text}?,
+                 attribute type {cn.type.vals}?,
+  		 Definition.attrib,
+  		 MathML.Common.attrib,	
+		 (cn.content)*}
+
+ci = element ci {attribute type {xsd:string}?,
+                 attribute nargs {xsd:string}?,
+		 attribute occurrence {xsd:string}?,		
+                 Definition.attrib,	
+  		 MathML.Common.attrib,
+		 opel.content,
+		 name.attrib?}
+
+cdname.attrib = attribute cd {xsd:NCName}
+
+csymbol       = element csymbol {MathML.Common.attrib,
+	                         Definition.attrib,cdname.attrib?,cdbase.attrib?, 
+				 opel.content}
+
+# the content of the apply element, leave it empty and extend it later
+apply = element apply {MathML.Common.attrib,cdbase.attrib?,apply.content}
+apply-head = apply|bind|ci|csymbol|semantics-apply
+apply.content = apply-head,ContExp*
+semantics-apply = element semantics {semantics.attribs,apply-head, semantics-annotation*}
+
+qualifier = notAllowed
+
+# the content of the bind element, leave it empty and extend it later
+bind = element bind {MathML.Common.attrib,cdbase.attrib?,bind.content}
+bind-head = apply|csymbol|semantics-bind
+bind.content = bind-head,bvar*,qualifier?,ContExp
+semantics-bind   = element semantics {semantics.attribs,bind-head, semantics-annotation*}
+
+bvar = element bvar {MathML.Common.attrib,cdbase.attrib?,bvar-head}
+bvar-head = ci|semantics-bvar
+semantics-bvar   = element semantics {semantics.attribs,bvar-head, semantics-annotation*}
+
+share = element share {MathML.Common.attrib,attribute href {xsd:anyURI}}
+
+# the content of the cerror element, leave it empty and extend it later
+cerror = element cerror {MathML.Common.attrib,cdbase.attrib?,cerror.content}
+cerror-head = csymbol|apply|semantics-cerror
+cerror.content = cerror-head,ContExp*
+semantics-cerror = element semantics {semantics.attribs,cerror-head, semantics-annotation*}
+
+semantics-cmml = element semantics {semantics.attribs,ContExp, semantics-annotation*}
+
+ContExp = cn| ci | csymbol | apply | bind | share | cerror | semantics-cmml
+
diff --git a/app/report/mathml3/mathml3-strict.rng b/app/report/mathml3/mathml3-strict.rng
new file mode 100644
index 0000000..706df24
--- /dev/null
+++ b/app/report/mathml3/mathml3-strict.rng
@@ -0,0 +1,267 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+      This is the Mathematical Markup Language (MathML) 3.0, an XML
+      application for describing mathematical notation and capturing
+      both its structure and content.
+  
+      Copyright 1998-2008 W3C (MIT, ERCIM, Keio)
+  
+      Use and distribution of this code are permitted under the terms
+      W3C Software Notice and License
+      http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+  
+  
+      Revision:   $Id: mathml3-strict.rng,v 1.3 2008/11/15 22:00:48 dcarlis Exp $
+  
+     Update to MathML3 and Relax NG: David Carlisle and Michael Kohlhase
+  
+   This is the RelaxNG schema module for the strict content part of MathML.
+-->
+<grammar ns="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+  <include href="mathml3-common.rng"/>
+  <define name="math.content" combine="choice">
+    <ref name="ContExp"/>
+  </define>
+  <!-- ednote(rnc:opel-content) What is the content of a operator element, currently all text? -->
+  <define name="opel.content">
+    <text/>
+  </define>
+  <!--
+    we want to extend this in pragmatic CMathML, so we introduce abbrevs here.
+    ednote(rnc:cn-content) What is the content of a cn?
+  -->
+  <define name="cn.content">
+    <choice>
+      <text/>
+      <group>
+        <ref name="cn"/>
+        <ref name="cn"/>
+      </group>
+    </choice>
+  </define>
+  <define name="cn.type.vals">
+    <choice>
+      <value>integer</value>
+      <value>real</value>
+      <value>double</value>
+    </choice>
+  </define>
+  <define name="cn">
+    <element name="cn">
+      <optional>
+        <attribute name="base"/>
+      </optional>
+      <optional>
+        <attribute name="type">
+          <ref name="cn.type.vals"/>
+        </attribute>
+      </optional>
+      <ref name="Definition.attrib"/>
+      <ref name="MathML.Common.attrib"/>
+      <zeroOrMore>
+        <ref name="cn.content"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="ci">
+    <element name="ci">
+      <optional>
+        <attribute name="type">
+          <data type="string"/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="nargs">
+          <data type="string"/>
+        </attribute>
+      </optional>
+      <optional>
+        <attribute name="occurrence">
+          <data type="string"/>
+        </attribute>
+      </optional>
+      <ref name="Definition.attrib"/>
+      <ref name="MathML.Common.attrib"/>
+      <ref name="opel.content"/>
+      <optional>
+        <ref name="name.attrib"/>
+      </optional>
+    </element>
+  </define>
+  <define name="cdname.attrib">
+    <attribute name="cd">
+      <data type="NCName"/>
+    </attribute>
+  </define>
+  <define name="csymbol">
+    <element name="csymbol">
+      <ref name="MathML.Common.attrib"/>
+      <ref name="Definition.attrib"/>
+      <optional>
+        <ref name="cdname.attrib"/>
+      </optional>
+      <optional>
+        <ref name="cdbase.attrib"/>
+      </optional>
+      <ref name="opel.content"/>
+    </element>
+  </define>
+  <!-- the content of the apply element, leave it empty and extend it later -->
+  <define name="apply">
+    <element name="apply">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="cdbase.attrib"/>
+      </optional>
+      <ref name="apply.content"/>
+    </element>
+  </define>
+  <define name="apply-head">
+    <choice>
+      <ref name="apply"/>
+      <ref name="bind"/>
+      <ref name="ci"/>
+      <ref name="csymbol"/>
+      <ref name="semantics-apply"/>
+    </choice>
+  </define>
+  <define name="apply.content">
+    <ref name="apply-head"/>
+    <zeroOrMore>
+      <ref name="ContExp"/>
+    </zeroOrMore>
+  </define>
+  <define name="semantics-apply">
+    <element name="semantics">
+      <ref name="semantics.attribs"/>
+      <ref name="apply-head"/>
+      <zeroOrMore>
+        <ref name="semantics-annotation"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="qualifier">
+    <notAllowed/>
+  </define>
+  <!-- the content of the bind element, leave it empty and extend it later -->
+  <define name="bind">
+    <element name="bind">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="cdbase.attrib"/>
+      </optional>
+      <ref name="bind.content"/>
+    </element>
+  </define>
+  <define name="bind-head">
+    <choice>
+      <ref name="apply"/>
+      <ref name="csymbol"/>
+      <ref name="semantics-bind"/>
+    </choice>
+  </define>
+  <define name="bind.content">
+    <ref name="bind-head"/>
+    <zeroOrMore>
+      <ref name="bvar"/>
+    </zeroOrMore>
+    <optional>
+      <ref name="qualifier"/>
+    </optional>
+    <ref name="ContExp"/>
+  </define>
+  <define name="semantics-bind">
+    <element name="semantics">
+      <ref name="semantics.attribs"/>
+      <ref name="bind-head"/>
+      <zeroOrMore>
+        <ref name="semantics-annotation"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="bvar">
+    <element name="bvar">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="cdbase.attrib"/>
+      </optional>
+      <ref name="bvar-head"/>
+    </element>
+  </define>
+  <define name="bvar-head">
+    <choice>
+      <ref name="ci"/>
+      <ref name="semantics-bvar"/>
+    </choice>
+  </define>
+  <define name="semantics-bvar">
+    <element name="semantics">
+      <ref name="semantics.attribs"/>
+      <ref name="bvar-head"/>
+      <zeroOrMore>
+        <ref name="semantics-annotation"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="share">
+    <element name="share">
+      <ref name="MathML.Common.attrib"/>
+      <attribute name="href">
+        <data type="anyURI"/>
+      </attribute>
+    </element>
+  </define>
+  <!-- the content of the cerror element, leave it empty and extend it later -->
+  <define name="cerror">
+    <element name="cerror">
+      <ref name="MathML.Common.attrib"/>
+      <optional>
+        <ref name="cdbase.attrib"/>
+      </optional>
+      <ref name="cerror.content"/>
+    </element>
+  </define>
+  <define name="cerror-head">
+    <choice>
+      <ref name="csymbol"/>
+      <ref name="apply"/>
+      <ref name="semantics-cerror"/>
+    </choice>
+  </define>
+  <define name="cerror.content">
+    <ref name="cerror-head"/>
+    <zeroOrMore>
+      <ref name="ContExp"/>
+    </zeroOrMore>
+  </define>
+  <define name="semantics-cerror">
+    <element name="semantics">
+      <ref name="semantics.attribs"/>
+      <ref name="cerror-head"/>
+      <zeroOrMore>
+        <ref name="semantics-annotation"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="semantics-cmml">
+    <element name="semantics">
+      <ref name="semantics.attribs"/>
+      <ref name="ContExp"/>
+      <zeroOrMore>
+        <ref name="semantics-annotation"/>
+      </zeroOrMore>
+    </element>
+  </define>
+  <define name="ContExp">
+    <choice>
+      <ref name="cn"/>
+      <ref name="ci"/>
+      <ref name="csymbol"/>
+      <ref name="apply"/>
+      <ref name="bind"/>
+      <ref name="share"/>
+      <ref name="cerror"/>
+      <ref name="semantics-cmml"/>
+    </choice>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/mathml3.rnc b/app/report/mathml3/mathml3.rnc
new file mode 100644
index 0000000..3c68cdb
--- /dev/null
+++ b/app/report/mathml3/mathml3.rnc
@@ -0,0 +1,21 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2010 W3C (MIT, ERCIM, Keio)
+# 
+#     Use and distribution of this code are permitted under the terms
+#     W3C Software Notice and License
+#     http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+
+default namespace m = "http://www.w3.org/1998/Math/MathML"
+
+## Content  MathML
+include "mathml3-content.rnc" 
+
+## Presentation MathML
+include "mathml3-presentation.rnc"
+
+## math and semantics common to both Content and Presentation
+include "mathml3-common.rnc"
diff --git a/app/report/mathml3/mathml3.rng b/app/report/mathml3/mathml3.rng
new file mode 100644
index 0000000..f1f75fc
--- /dev/null
+++ b/app/report/mathml3/mathml3.rng
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+      This is the Mathematical Markup Language (MathML) 3.0, an XML
+      application for describing mathematical notation and capturing
+      both its structure and content.
+  
+      Copyright 1998-2010 W3C (MIT, ERCIM, Keio)
+  
+      Use and distribution of this code are permitted under the terms
+      W3C Software Notice and License
+      http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+-->
+<grammar ns="http://www.w3.org/1998/Math/MathML" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns="http://relaxng.org/ns/structure/1.0">
+  <include href="mathml3-content.rng">
+    <a:documentation>Content  MathML</a:documentation>
+  </include>
+  <include href="mathml3-presentation.rng">
+    <a:documentation>Presentation MathML</a:documentation>
+  </include>
+  <include href="mathml3-common.rng">
+    <a:documentation>math and semantics common to both Content and Presentation</a:documentation>
+  </include>
+</grammar>
diff --git a/app/report/mathml3/ms.rnc b/app/report/mathml3/ms.rnc
new file mode 100644
index 0000000..d4f5aa3
--- /dev/null
+++ b/app/report/mathml3/ms.rnc
@@ -0,0 +1,21 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2010 W3C (MIT, ERCIM, Keio)
+# 
+#     Use and distribution of this code are permitted under the terms
+#     W3C Software Notice and License
+#     http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231
+
+
+default namespace m = "http://www.w3.org/1998/Math/MathML"
+
+## Content  MathML
+include "mathml3-strict-content.rnc" 
+
+## Presentation MathML
+# include "mathml3-presentation.rnc"
+
+## math and semantics common to both Content and Presentation
+include "mathml3-common.rnc"
diff --git a/app/report/mathml3/relations.rnc b/app/report/mathml3/relations.rnc
new file mode 100644
index 0000000..1493daf
--- /dev/null
+++ b/app/report/mathml3/relations.rnc
@@ -0,0 +1,43 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2007 World Wide Web Consortium
+#        (Massachusetts Institute of Technology, Institut National de
+#         Recherche en Informatique et en Automatique, Keio University).
+#         All Rights Reserved.
+#
+#     Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+#     and its accompanying documentation for any purpose and without fee is
+#     hereby granted in perpetuity, provided that the above copyright notice
+#     and this paragraph appear in all copies.  The copyright holders make
+#     no representation about the suitability of the Schema for any purpose.
+#
+#     This file contains the arity checking rules for the symbols
+#     from the content dictionary 
+#     It is provided "as is" without expressed or implied warranty.
+#
+#     Revision:   $Id: relations.rnc,v 1.1 2007/12/11 15:38:52 dcarlis Exp $
+
+cd.token.binary.class |= neq.token | factorof.token
+cd.token.nary.class |= eq.token | gt.token | lt.token | geq.token | leq.token | equivalent.token | approx.token
+
+# the element definitions for the token elements
+eq.content = Token.type
+eq.token = element eq {eq.content}
+neq.content = Token.type
+neq.token = element neq {neq.content}
+gt.content = Token.type
+gt.token = element gt {gt.content}
+lt.content = Token.type
+lt.token = element lt {lt.content}
+geq.content = Token.type
+geq.token = element geq {geq.content}
+leq.content = Token.type
+leq.token = element leq {leq.content}
+equivalent.content = Token.type
+equivalent.token = element equivalent {equivalent.content}
+approx.content = Token.type, attribute type {MathMLtype}?
+approx.token = element approx {approx.content}
+factorof.content = Token.type, attribute  type  {MathMLtype}?
+factorof.token = element factorof {factorof.content}
\ No newline at end of file
diff --git a/app/report/mathml3/relations.rng b/app/report/mathml3/relations.rng
new file mode 100644
index 0000000..cf4322b
--- /dev/null
+++ b/app/report/mathml3/relations.rng
@@ -0,0 +1,125 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <!--
+        This is the Mathematical Markup Language (MathML) 3.0, an XML
+        application for describing mathematical notation and capturing
+        both its structure and content.
+    
+        Copyright 1998-2007 World Wide Web Consortium
+           (Massachusetts Institute of Technology, Institut National de
+            Recherche en Informatique et en Automatique, Keio University).
+            All Rights Reserved.
+    
+        Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+        and its accompanying documentation for any purpose and without fee is
+        hereby granted in perpetuity, provided that the above copyright notice
+        and this paragraph appear in all copies.  The copyright holders make
+        no representation about the suitability of the Schema for any purpose.
+    
+        This file contains the arity checking rules for the symbols
+        from the content dictionary 
+        It is provided "as is" without expressed or implied warranty.
+    
+        Revision:   $Id: relations.rng,v 1.1 2007/12/11 15:59:28 dcarlis Exp $
+  -->
+  <define name="cd.token.binary.class" combine="choice">
+    <choice>
+      <ref name="neq.token"/>
+      <ref name="factorof.token"/>
+    </choice>
+  </define>
+  <define name="cd.token.nary.class" combine="choice">
+    <choice>
+      <ref name="eq.token"/>
+      <ref name="gt.token"/>
+      <ref name="lt.token"/>
+      <ref name="geq.token"/>
+      <ref name="leq.token"/>
+      <ref name="equivalent.token"/>
+      <ref name="approx.token"/>
+    </choice>
+  </define>
+  <!-- the element definitions for the token elements -->
+  <define name="eq.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="eq.token">
+    <element name="eq">
+      <ref name="eq.content"/>
+    </element>
+  </define>
+  <define name="neq.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="neq.token">
+    <element name="neq">
+      <ref name="neq.content"/>
+    </element>
+  </define>
+  <define name="gt.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="gt.token">
+    <element name="gt">
+      <ref name="gt.content"/>
+    </element>
+  </define>
+  <define name="lt.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="lt.token">
+    <element name="lt">
+      <ref name="lt.content"/>
+    </element>
+  </define>
+  <define name="geq.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="geq.token">
+    <element name="geq">
+      <ref name="geq.content"/>
+    </element>
+  </define>
+  <define name="leq.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="leq.token">
+    <element name="leq">
+      <ref name="leq.content"/>
+    </element>
+  </define>
+  <define name="equivalent.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="equivalent.token">
+    <element name="equivalent">
+      <ref name="equivalent.content"/>
+    </element>
+  </define>
+  <define name="approx.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="approx.token">
+    <element name="approx">
+      <ref name="approx.content"/>
+    </element>
+  </define>
+  <define name="factorof.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="factorof.token">
+    <element name="factorof">
+      <ref name="factorof.content"/>
+    </element>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/sequences_series.rnc b/app/report/mathml3/sequences_series.rnc
new file mode 100644
index 0000000..3e15156
--- /dev/null
+++ b/app/report/mathml3/sequences_series.rnc
@@ -0,0 +1,31 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2007 World Wide Web Consortium
+#        (Massachusetts Institute of Technology, Institut National de
+#         Recherche en Informatique et en Automatique, Keio University).
+#         All Rights Reserved.
+#
+#     Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+#     and its accompanying documentation for any purpose and without fee is
+#     hereby granted in perpetuity, provided that the above copyright notice
+#     and this paragraph appear in all copies.  The copyright holders make
+#     no representation about the suitability of the Schema for any purpose.
+#
+#     This file contains the arity checking rules for the symbols
+#     from the content dictionary 
+#     It is provided "as is" without expressed or implied warranty.
+#
+#     Revision:   $Id: sequences_series.rnc,v 1.1 2007/12/11 15:38:52 dcarlis Exp $
+
+
+# the element definitions for the token elements
+sum.content = Token.type
+sum.token = element sum {sum.content}
+product.content = Token.type
+product.token = element product {product.content}
+limit.content = Token.type
+limit.token = element limit {limit.content}
+tendsto.content = Token.type, attribute type {MathMLtype}?
+tendsto.token = element tendsto {tendsto.content}
\ No newline at end of file
diff --git a/app/report/mathml3/sequences_series.rng b/app/report/mathml3/sequences_series.rng
new file mode 100644
index 0000000..bd9329f
--- /dev/null
+++ b/app/report/mathml3/sequences_series.rng
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <!--
+        This is the Mathematical Markup Language (MathML) 3.0, an XML
+        application for describing mathematical notation and capturing
+        both its structure and content.
+    
+        Copyright 1998-2007 World Wide Web Consortium
+           (Massachusetts Institute of Technology, Institut National de
+            Recherche en Informatique et en Automatique, Keio University).
+            All Rights Reserved.
+    
+        Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+        and its accompanying documentation for any purpose and without fee is
+        hereby granted in perpetuity, provided that the above copyright notice
+        and this paragraph appear in all copies.  The copyright holders make
+        no representation about the suitability of the Schema for any purpose.
+    
+        This file contains the arity checking rules for the symbols
+        from the content dictionary 
+        It is provided "as is" without expressed or implied warranty.
+    
+        Revision:   $Id: sequences_series.rng,v 1.1 2007/12/11 15:59:28 dcarlis Exp $
+  -->
+  <!-- the element definitions for the token elements -->
+  <define name="sum.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="sum.token">
+    <element name="sum">
+      <ref name="sum.content"/>
+    </element>
+  </define>
+  <define name="product.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="product.token">
+    <element name="product">
+      <ref name="product.content"/>
+    </element>
+  </define>
+  <define name="limit.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="limit.token">
+    <element name="limit">
+      <ref name="limit.content"/>
+    </element>
+  </define>
+  <define name="tendsto.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="type">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+  </define>
+  <define name="tendsto.token">
+    <element name="tendsto">
+      <ref name="tendsto.content"/>
+    </element>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/sets.rnc b/app/report/mathml3/sets.rnc
new file mode 100644
index 0000000..046d306
--- /dev/null
+++ b/app/report/mathml3/sets.rnc
@@ -0,0 +1,52 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2007 World Wide Web Consortium
+#        (Massachusetts Institute of Technology, Institut National de
+#         Recherche en Informatique et en Automatique, Keio University).
+#         All Rights Reserved.
+#
+#     Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+#     and its accompanying documentation for any purpose and without fee is
+#     hereby granted in perpetuity, provided that the above copyright notice
+#     and this paragraph appear in all copies.  The copyright holders make
+#     no representation about the suitability of the Schema for any purpose.
+#
+#     This file contains the arity checking rules for the symbols
+#     from the content dictionary 
+#     It is provided "as is" without expressed or implied warranty.
+#
+#     Revision:   $Id: sets.rnc,v 1.1 2007/12/11 15:38:53 dcarlis Exp $
+
+cd.token.unary.class |= card.token
+cd.token.binary.class |= in.token | notin.token | notsubset.token | notprsubset.token | setdiff.token
+cd.token.nary.class |= set.token | list.token | intersect.token | subset.token | prsubset.token | cartesianproduct.token
+
+# the element definitions for the token elements
+set.content = Token.type, attribute order {MathMLtype}?,ContExp*
+set.token = element set {set.content}
+list.content = Token.type, attribute order {MathMLtype}?,ContExp*
+list.token = element list {list.content}
+union.content = Token.type
+union.token = element union {union.content}
+intersect.content = Token.type
+intersect.token = element intersect {intersect.content}
+in.content = Token.type
+in.token = element in {in.content}
+notin.content = Token.type
+notin.token = element notin {notin.content}
+subset.content = Token.type
+subset.token = element subset {subset.content}
+prsubset.content = Token.type
+prsubset.token = element prsubset {prsubset.content}
+notsubset.content = Token.type
+notsubset.token = element notsubset {notsubset.content}
+notprsubset.content = Token.type
+notprsubset.token = element notprsubset {notprsubset.content}
+setdiff.content = Token.type
+setdiff.token = element setdiff {setdiff.content}
+card.content = Token.type
+card.token = element card {card.content}
+cartesianproduct.content = Token.type
+cartesianproduct.token = element cartesianproduct {cartesianproduct.content}
\ No newline at end of file
diff --git a/app/report/mathml3/sets.rng b/app/report/mathml3/sets.rng
new file mode 100644
index 0000000..3c0b368
--- /dev/null
+++ b/app/report/mathml3/sets.rng
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <!--
+        This is the Mathematical Markup Language (MathML) 3.0, an XML
+        application for describing mathematical notation and capturing
+        both its structure and content.
+    
+        Copyright 1998-2007 World Wide Web Consortium
+           (Massachusetts Institute of Technology, Institut National de
+            Recherche en Informatique et en Automatique, Keio University).
+            All Rights Reserved.
+    
+        Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+        and its accompanying documentation for any purpose and without fee is
+        hereby granted in perpetuity, provided that the above copyright notice
+        and this paragraph appear in all copies.  The copyright holders make
+        no representation about the suitability of the Schema for any purpose.
+    
+        This file contains the arity checking rules for the symbols
+        from the content dictionary 
+        It is provided "as is" without expressed or implied warranty.
+    
+        Revision:   $Id: sets.rng,v 1.1 2007/12/11 15:59:28 dcarlis Exp $
+  -->
+  <define name="cd.token.unary.class" combine="choice">
+    <ref name="card.token"/>
+  </define>
+  <define name="cd.token.binary.class" combine="choice">
+    <choice>
+      <ref name="in.token"/>
+      <ref name="notin.token"/>
+      <ref name="notsubset.token"/>
+      <ref name="notprsubset.token"/>
+      <ref name="setdiff.token"/>
+    </choice>
+  </define>
+  <define name="cd.token.nary.class" combine="choice">
+    <choice>
+      <ref name="set.token"/>
+      <ref name="list.token"/>
+      <ref name="intersect.token"/>
+      <ref name="subset.token"/>
+      <ref name="prsubset.token"/>
+      <ref name="cartesianproduct.token"/>
+    </choice>
+  </define>
+  <!-- the element definitions for the token elements -->
+  <define name="set.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="order">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+    <zeroOrMore>
+      <ref name="ContExp"/>
+    </zeroOrMore>
+  </define>
+  <define name="set.token">
+    <element name="set">
+      <ref name="set.content"/>
+    </element>
+  </define>
+  <define name="list.content">
+    <ref name="Token.type"/>
+    <optional>
+      <attribute name="order">
+        <ref name="MathMLtype"/>
+      </attribute>
+    </optional>
+    <zeroOrMore>
+      <ref name="ContExp"/>
+    </zeroOrMore>
+  </define>
+  <define name="list.token">
+    <element name="list">
+      <ref name="list.content"/>
+    </element>
+  </define>
+  <define name="union.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="union.token">
+    <element name="union">
+      <ref name="union.content"/>
+    </element>
+  </define>
+  <define name="intersect.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="intersect.token">
+    <element name="intersect">
+      <ref name="intersect.content"/>
+    </element>
+  </define>
+  <define name="in.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="in.token">
+    <element name="in">
+      <ref name="in.content"/>
+    </element>
+  </define>
+  <define name="notin.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="notin.token">
+    <element name="notin">
+      <ref name="notin.content"/>
+    </element>
+  </define>
+  <define name="subset.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="subset.token">
+    <element name="subset">
+      <ref name="subset.content"/>
+    </element>
+  </define>
+  <define name="prsubset.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="prsubset.token">
+    <element name="prsubset">
+      <ref name="prsubset.content"/>
+    </element>
+  </define>
+  <define name="notsubset.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="notsubset.token">
+    <element name="notsubset">
+      <ref name="notsubset.content"/>
+    </element>
+  </define>
+  <define name="notprsubset.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="notprsubset.token">
+    <element name="notprsubset">
+      <ref name="notprsubset.content"/>
+    </element>
+  </define>
+  <define name="setdiff.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="setdiff.token">
+    <element name="setdiff">
+      <ref name="setdiff.content"/>
+    </element>
+  </define>
+  <define name="card.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="card.token">
+    <element name="card">
+      <ref name="card.content"/>
+    </element>
+  </define>
+  <define name="cartesianproduct.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="cartesianproduct.token">
+    <element name="cartesianproduct">
+      <ref name="cartesianproduct.content"/>
+    </element>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/specfun.rnc b/app/report/mathml3/specfun.rnc
new file mode 100644
index 0000000..cf051a7
--- /dev/null
+++ b/app/report/mathml3/specfun.rnc
@@ -0,0 +1,79 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2007 World Wide Web Consortium
+#        (Massachusetts Institute of Technology, Institut National de
+#         Recherche en Informatique et en Automatique, Keio University).
+#         All Rights Reserved.
+#
+#     Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+#     and its accompanying documentation for any purpose and without fee is
+#     hereby granted in perpetuity, provided that the above copyright notice
+#     and this paragraph appear in all copies.  The copyright holders make
+#     no representation about the suitability of the Schema for any purpose.
+#
+#     This file contains the arity checking rules for the symbols
+#     from the content dictionary 
+#     It is provided "as is" without expressed or implied warranty.
+#
+#     Revision:   $Id: specfun.rnc,v 1.1 2007/12/11 15:38:53 dcarlis Exp $
+
+cd.token.unary.class |= ln.token | sin.token | cos.token | tan.token | sec.token | csc.token | cot.token | sinh.token | cosh.token | tanh.token | sech.token | csch.token | coth.token | arcsin.token | arccos.token | arctan.token | arccosh.token | arccot.token | arccoth.token | arccsc.token | arccsch.token | arcsec.token | arcsech.token | arcsinh.token | arctanh.token | exp.token 
+cd.token.binary.class |=  log.token
+
+# the element definitions for the token elements
+exp.content = Token.type
+exp.token = element exp {exp.content}
+ln.content = Token.type
+ln.token = element ln {ln.content}
+log.content = Token.type
+log.token = element log {log.content}
+sin.content = Token.type
+sin.token = element sin {sin.content}
+cos.content = Token.type
+cos.token = element cos {cos.content}
+tan.content = Token.type
+tan.token = element tan {tan.content}
+sec.content = Token.type
+sec.token = element sec {sec.content}
+csc.content = Token.type
+csc.token = element csc {csc.content}
+cot.content = Token.type
+cot.token = element cot {cot.content}
+sinh.content = Token.type
+sinh.token = element sinh {sinh.content}
+cosh.content = Token.type
+cosh.token = element cosh {cosh.content}
+tanh.content = Token.type
+tanh.token = element tanh {tanh.content}
+sech.content = Token.type
+sech.token = element sech {sech.content}
+csch.content = Token.type
+csch.token = element csch {csch.content}
+coth.content = Token.type
+coth.token = element coth {coth.content}
+arcsin.content = Token.type
+arcsin.token = element arcsin {arcsin.content}
+arccos.content = Token.type
+arccos.token = element arccos {arccos.content}
+arctan.content = Token.type
+arctan.token = element arctan {arctan.content}
+arccosh.content = Token.type
+arccosh.token = element arccosh {arccosh.content}
+arccot.content = Token.type
+arccot.token = element arccot {arccot.content}
+arccoth.content = Token.type
+arccoth.token = element arccoth {arccoth.content}
+arccsc.content = Token.type
+arccsc.token = element arccsc {arccsc.content}
+arccsch.content = Token.type
+arccsch.token = element arccsch {arccsch.content}
+arcsec.content = Token.type
+arcsec.token = element arcsec {arcsec.content}
+arcsech.content = Token.type
+arcsech.token = element arcsech {arcsech.content}
+arcsinh.content = Token.type
+arcsinh.token = element arcsinh {arcsinh.content}
+arctanh.content = Token.type
+arctanh.token = element arctanh {arctanh.content}
diff --git a/app/report/mathml3/specfun.rng b/app/report/mathml3/specfun.rng
new file mode 100644
index 0000000..2ace29b
--- /dev/null
+++ b/app/report/mathml3/specfun.rng
@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <!--
+        This is the Mathematical Markup Language (MathML) 3.0, an XML
+        application for describing mathematical notation and capturing
+        both its structure and content.
+    
+        Copyright 1998-2007 World Wide Web Consortium
+           (Massachusetts Institute of Technology, Institut National de
+            Recherche en Informatique et en Automatique, Keio University).
+            All Rights Reserved.
+    
+        Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+        and its accompanying documentation for any purpose and without fee is
+        hereby granted in perpetuity, provided that the above copyright notice
+        and this paragraph appear in all copies.  The copyright holders make
+        no representation about the suitability of the Schema for any purpose.
+    
+        This file contains the arity checking rules for the symbols
+        from the content dictionary 
+        It is provided "as is" without expressed or implied warranty.
+    
+        Revision:   $Id: specfun.rng,v 1.1 2007/12/11 15:59:28 dcarlis Exp $
+  -->
+  <define name="cd.token.unary.class" combine="choice">
+    <choice>
+      <ref name="ln.token"/>
+      <ref name="sin.token"/>
+      <ref name="cos.token"/>
+      <ref name="tan.token"/>
+      <ref name="sec.token"/>
+      <ref name="csc.token"/>
+      <ref name="cot.token"/>
+      <ref name="sinh.token"/>
+      <ref name="cosh.token"/>
+      <ref name="tanh.token"/>
+      <ref name="sech.token"/>
+      <ref name="csch.token"/>
+      <ref name="coth.token"/>
+      <ref name="arcsin.token"/>
+      <ref name="arccos.token"/>
+      <ref name="arctan.token"/>
+      <ref name="arccosh.token"/>
+      <ref name="arccot.token"/>
+      <ref name="arccoth.token"/>
+      <ref name="arccsc.token"/>
+      <ref name="arccsch.token"/>
+      <ref name="arcsec.token"/>
+      <ref name="arcsech.token"/>
+      <ref name="arcsinh.token"/>
+      <ref name="arctanh.token"/>
+      <ref name="exp.token"/>
+    </choice>
+  </define>
+  <define name="cd.token.binary.class" combine="choice">
+    <ref name="log.token"/>
+  </define>
+  <!-- the element definitions for the token elements -->
+  <define name="exp.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="exp.token">
+    <element name="exp">
+      <ref name="exp.content"/>
+    </element>
+  </define>
+  <define name="ln.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="ln.token">
+    <element name="ln">
+      <ref name="ln.content"/>
+    </element>
+  </define>
+  <define name="log.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="log.token">
+    <element name="log">
+      <ref name="log.content"/>
+    </element>
+  </define>
+  <define name="sin.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="sin.token">
+    <element name="sin">
+      <ref name="sin.content"/>
+    </element>
+  </define>
+  <define name="cos.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="cos.token">
+    <element name="cos">
+      <ref name="cos.content"/>
+    </element>
+  </define>
+  <define name="tan.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="tan.token">
+    <element name="tan">
+      <ref name="tan.content"/>
+    </element>
+  </define>
+  <define name="sec.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="sec.token">
+    <element name="sec">
+      <ref name="sec.content"/>
+    </element>
+  </define>
+  <define name="csc.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="csc.token">
+    <element name="csc">
+      <ref name="csc.content"/>
+    </element>
+  </define>
+  <define name="cot.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="cot.token">
+    <element name="cot">
+      <ref name="cot.content"/>
+    </element>
+  </define>
+  <define name="sinh.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="sinh.token">
+    <element name="sinh">
+      <ref name="sinh.content"/>
+    </element>
+  </define>
+  <define name="cosh.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="cosh.token">
+    <element name="cosh">
+      <ref name="cosh.content"/>
+    </element>
+  </define>
+  <define name="tanh.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="tanh.token">
+    <element name="tanh">
+      <ref name="tanh.content"/>
+    </element>
+  </define>
+  <define name="sech.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="sech.token">
+    <element name="sech">
+      <ref name="sech.content"/>
+    </element>
+  </define>
+  <define name="csch.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="csch.token">
+    <element name="csch">
+      <ref name="csch.content"/>
+    </element>
+  </define>
+  <define name="coth.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="coth.token">
+    <element name="coth">
+      <ref name="coth.content"/>
+    </element>
+  </define>
+  <define name="arcsin.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="arcsin.token">
+    <element name="arcsin">
+      <ref name="arcsin.content"/>
+    </element>
+  </define>
+  <define name="arccos.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="arccos.token">
+    <element name="arccos">
+      <ref name="arccos.content"/>
+    </element>
+  </define>
+  <define name="arctan.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="arctan.token">
+    <element name="arctan">
+      <ref name="arctan.content"/>
+    </element>
+  </define>
+  <define name="arccosh.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="arccosh.token">
+    <element name="arccosh">
+      <ref name="arccosh.content"/>
+    </element>
+  </define>
+  <define name="arccot.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="arccot.token">
+    <element name="arccot">
+      <ref name="arccot.content"/>
+    </element>
+  </define>
+  <define name="arccoth.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="arccoth.token">
+    <element name="arccoth">
+      <ref name="arccoth.content"/>
+    </element>
+  </define>
+  <define name="arccsc.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="arccsc.token">
+    <element name="arccsc">
+      <ref name="arccsc.content"/>
+    </element>
+  </define>
+  <define name="arccsch.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="arccsch.token">
+    <element name="arccsch">
+      <ref name="arccsch.content"/>
+    </element>
+  </define>
+  <define name="arcsec.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="arcsec.token">
+    <element name="arcsec">
+      <ref name="arcsec.content"/>
+    </element>
+  </define>
+  <define name="arcsech.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="arcsech.token">
+    <element name="arcsech">
+      <ref name="arcsech.content"/>
+    </element>
+  </define>
+  <define name="arcsinh.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="arcsinh.token">
+    <element name="arcsinh">
+      <ref name="arcsinh.content"/>
+    </element>
+  </define>
+  <define name="arctanh.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="arctanh.token">
+    <element name="arctanh">
+      <ref name="arctanh.content"/>
+    </element>
+  </define>
+</grammar>
diff --git a/app/report/mathml3/statistics.rnc b/app/report/mathml3/statistics.rnc
new file mode 100644
index 0000000..fda8e71
--- /dev/null
+++ b/app/report/mathml3/statistics.rnc
@@ -0,0 +1,39 @@
+#     This is the Mathematical Markup Language (MathML) 3.0, an XML
+#     application for describing mathematical notation and capturing
+#     both its structure and content.
+#
+#     Copyright 1998-2007 World Wide Web Consortium
+#        (Massachusetts Institute of Technology, Institut National de
+#         Recherche en Informatique et en Automatique, Keio University).
+#         All Rights Reserved.
+#
+#     Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+#     and its accompanying documentation for any purpose and without fee is
+#     hereby granted in perpetuity, provided that the above copyright notice
+#     and this paragraph appear in all copies.  The copyright holders make
+#     no representation about the suitability of the Schema for any purpose.
+#
+#     This file contains the arity checking rules for the symbols
+#     from the content dictionary 
+#     It is provided "as is" without expressed or implied warranty.
+#
+#     Revision:   $Id: statistics.rnc,v 1.1 2007/12/11 15:38:53 dcarlis Exp $
+
+cd.token.unary.class |= momentabout.token
+cd.token.nary.class |= mean.token | sdev.token | variance.token | median.token | mode.token | moment.token
+
+# the element definitions for the token elements
+mean.content = Token.type
+mean.token = element mean {mean.content}
+sdev.content = Token.type
+sdev.token = element sdev {sdev.content}
+variance.content = Token.type
+variance.token = element variance {variance.content}
+median.content = Token.type
+median.token = element median {median.content}
+mode.content = Token.type
+mode.token = element mode {mode.content}
+moment.content = Token.type
+moment.token = element moment {moment.content}
+momentabout.content = Token.type
+momentabout.token = element momentabout {momentabout.content}
\ No newline at end of file
diff --git a/app/report/mathml3/statistics.rng b/app/report/mathml3/statistics.rng
new file mode 100644
index 0000000..f93c0c4
--- /dev/null
+++ b/app/report/mathml3/statistics.rng
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0">
+  <!--
+        This is the Mathematical Markup Language (MathML) 3.0, an XML
+        application for describing mathematical notation and capturing
+        both its structure and content.
+    
+        Copyright 1998-2007 World Wide Web Consortium
+           (Massachusetts Institute of Technology, Institut National de
+            Recherche en Informatique et en Automatique, Keio University).
+            All Rights Reserved.
+    
+        Permission to use, copy, modify and distribute the RelaxNG schema for MathML3
+        and its accompanying documentation for any purpose and without fee is
+        hereby granted in perpetuity, provided that the above copyright notice
+        and this paragraph appear in all copies.  The copyright holders make
+        no representation about the suitability of the Schema for any purpose.
+    
+        This file contains the arity checking rules for the symbols
+        from the content dictionary 
+        It is provided "as is" without expressed or implied warranty.
+    
+        Revision:   $Id: statistics.rng,v 1.1 2007/12/11 15:59:28 dcarlis Exp $
+  -->
+  <define name="cd.token.unary.class" combine="choice">
+    <ref name="momentabout.token"/>
+  </define>
+  <define name="cd.token.nary.class" combine="choice">
+    <choice>
+      <ref name="mean.token"/>
+      <ref name="sdev.token"/>
+      <ref name="variance.token"/>
+      <ref name="median.token"/>
+      <ref name="mode.token"/>
+      <ref name="moment.token"/>
+    </choice>
+  </define>
+  <!-- the element definitions for the token elements -->
+  <define name="mean.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="mean.token">
+    <element name="mean">
+      <ref name="mean.content"/>
+    </element>
+  </define>
+  <define name="sdev.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="sdev.token">
+    <element name="sdev">
+      <ref name="sdev.content"/>
+    </element>
+  </define>
+  <define name="variance.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="variance.token">
+    <element name="variance">
+      <ref name="variance.content"/>
+    </element>
+  </define>
+  <define name="median.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="median.token">
+    <element name="median">
+      <ref name="median.content"/>
+    </element>
+  </define>
+  <define name="mode.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="mode.token">
+    <element name="mode">
+      <ref name="mode.content"/>
+    </element>
+  </define>
+  <define name="moment.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="moment.token">
+    <element name="moment">
+      <ref name="moment.content"/>
+    </element>
+  </define>
+  <define name="momentabout.content">
+    <ref name="Token.type"/>
+  </define>
+  <define name="momentabout.token">
+    <element name="momentabout">
+      <ref name="momentabout.content"/>
+    </element>
+  </define>
+</grammar>
-- 
GitLab