#     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
