<?xml version="1.0" encoding="iso-8859-1"?><?xml-stylesheet  type="text/xsl" href="pmathml.xsl"?><html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML" xml:space="preserve">
<head>
<title>The OpenMath Standard</title>

<style>
p {text-align:justify;	   
  }
code {font-size: 125%;
      font-family: monospace; 
     }
.figure {
border-width:1px;
border-color: black;
}
.footnote{
font-size: 75%;
font-style: italic;
}
.delliteral {
font-size: 75%;
background-color: #cfcfcf;
border-color: black;
border-style: solid;
border-width: 1px;
padding: 1em;
color: red;
text-decoration: line-through;
}
.newliteral {
font-size: 75%;
background-color: #cfcfcf;
border-color: black;
border-style: solid;
border-width: 1px;
padding: 1em;
color: green;
}
.literal {
font-size: 75%;
background-color: #cfcfcf;
border-color: black;
border-style: solid;
border-width: 1px;
padding: 1em;
}
.del {
color: red;
text-decoration: line-through;
}
.new {
color: green;
}
.chg {
color: blue;
}
.changetoc {
border-style: solid;
border-color: black;
border-width: 1px;
margin: 2em 2em 2em 2em;
background-color: yellow;
}

.lowerroman {
list-style-type: lower-roman;
}
</style>
</head>
<body>
<h1>The <i>OpenMath</i> Standard</h1>
<div>
Version: 2.0 Public Draft 3 (5 November 2003)
</div>

<div>
The OpenMath Society
</div>

<div>Editors<br/>
S. Buswell, O. Caprotti, D. P. Carlisle, M. C. Dewar, M. Gaetano, M. Kohlhase
</div>

<div>
October 2003
</div>

<div>
<h3>Abstract</h3>
<p>This document proposes <i>OpenMath</i> as a standard for the communication of
  semantically rich mathematical objects. This draft of the <i>OpenMath</i> 
  standard comprises the following: a description of <i>OpenMath</i> objects, the
  grammar of <span>xml</span> and of the binary encoding of objects, a
  description of Content Dictionaries and an <span>xml</span> document type
  definition for validating Content Dictionaries. The non-normative
  <a href="#cha_his">Chapter 1</a> of this document briefly overviews the history
  of <i>OpenMath</i>.</p>
</div>


<div class="changetoc">
<h3>Change-marked edition notes</h3>
<p>
This edition contains colour coded change markings
relative to the OpenMath 1.0 document...</p>
<ul>
<li class="new">New text is marked with css class "new" (green).</li>
<li class="del">Deleted text is marked with css class "del" (red).</li>
</ul>

<p>Sections with new text</p>
<ul>


















<a href="#sec_basic" class="new">
3.1.1 Basic OpenMath objects
</a><br/>



<a href="#sec_derived" class="new">
3.1.2 Derived OpenMath Objects
</a><br/>



<a href="#sec_compound" class="new">
3.1.3 Compound OpenMath Objects
</a><br/>



<a href="#sec_roles" class="new">
3.1.4 OpenMath Symbol Rôles
</a><br/>



<a href="#sec_omin" class="new">
3.2 Further Description of OpenMath Objects
</a><br/>



<a href="#sec_names" class="new">
3.3 Names
</a><br/>



<a href="#sec_summary" class="new">
3.4 Summary
</a><br/>





<a href="#ssec_xml" class="new">
4.1.1 A GrammarSchema for the xml Encoding
</a><br/>



<a href="#sec_xml-desc" class="new">
4.1.2 Informal description of
the Grammarxml Encoding
</a><br/>



<a href="#sec_acyclicity" class="new">
4.1.2.1 An Acyclicity Constraint
</a><br/>



<a href="#sec_sharing_bvars" class="new">
4.1.2.2 Sharing and Bound Variables
</a><br/>



<a href="#xmldoc" class="new">
4.1.3 Embedding OpenMath in xml Documents
</a><br/>





<a href="#sec_binary_grammar" class="new">
4.2.1 A Grammar for the Binary Encoding
</a><br/>



<a href="#sec_bin-desc" class="new">
4.2.2 Description of the Grammar
</a><br/>



<a href="#sec_sharing" class="new">
4.2.2.1 Sharing in Objects begining with the identifier [24]
</a><br/>



<a href="#sec_sharing_references" class="new">
4.2.3 Sharing with References (beginning with [24+64])
</a><br/>



<a href="#sec_impl_note" class="new">
4.2.4 Implementation Note
</a><br/>





<a href="#sec_relation_OM1_binary" class="new">
4.2.6 Relation to the OpenMath1 binary encoding
</a><br/>





<a href="#sec_cd_summary" class="new">
5.1 Introduction
</a><br/>



<a href="#sect_func" class="new">
5.2 Abstract Content Dictionaries
</a><br/>



<a href="#sec_status" class="new">
5.2.1 Content Dictionary Status
</a><br/>



<a href="#sec_version" class="new">
5.2.2 Content Dictionary Version Numbers
</a><br/>



<a href="#sec_xml_cd" class="new">
5.3 The xmlReference Encoding for Content Dictionaries
</a><br/>



<a href="#sec_cd_schema" class="new">
5.3.1 The RelaxNG Schema for Content Dictionaries
</a><br/>





<a href="#sect_pcdata" class="new">
5.3.2 Further Requirements of an OpenMath
Content DictionaryDescription of
the CD Schema
</a><br/>



<a href="#addfiles" class="new">
5.4 Additional Information
</a><br/>



<a href="#sigfiles" class="new">
5.4.1 Signature
FilesDictionaries

</a><br/>





<a href="#sect_sigpcdata" class="new">
5.4.1.1 Further
Requirements


Abstract Specification
 of a Signature File
</a><br/>



<a href="#sect_sigschema" class="new">
5.4.1.2 A RelaxNG Schema for a Signature File
</a><br/>







<a href="#sec_dtd_cdg" class="new">
5.4.2.1 The DTD Specification of CDGroups
</a><br/>



<a href="#sect_cdgpcdata" class="new">
5.4.2.2 Further Requirements of a CDGroup
</a><br/>







<a href="#sec_compl_cd" class="new">
6.2 Content Dictionaries
</a><br/>
































</ul>
</div>





  
<h2>Contents</h2><a href="#cha_his">1 <i>OpenMath</i> Movement</a><br/>
    <a href="#sec_hist">1.1 History</a><br/>
    <a href="#sec_omsoc">1.2 <i>OpenMath</i> Society</a><br/><a href="#cha_int">2 Introduction to <i>OpenMath</i></a><br/>
    <a href="#sec_om-arch">2.1 <i>OpenMath</i> Architecture</a><br/>
    <a href="#sec_intro-obj">2.2 <i>OpenMath</i> Objects and Encodings</a><br/>
    <a href="#sec_intro-cd">2.3 Content Dictionaries</a><br/>
    <a href="#sec_addnfiles">2.4 Additional Files</a><br/>
    <a href="#sec_phrasebooks">2.5 Phrasebooks</a><br/><a href="#cha_obj">3 <i>OpenMath</i> Objects</a><br/>
    <a href="#sec_omabs">3.1 Formal Definition of <i>OpenMath</i> Objects</a><br/>
        <a href="#sec_basic">3.1.1 Basic <i>OpenMath</i> objects</a><br/>
        <a href="#sec_derived" class="new">3.1.2 Derived <i>OpenMath</i> Objects</a><br/>
        <a href="#sec_compound">3.1.3 Compound <i>OpenMath</i> Objects</a><br/>
        <a href="#sec_roles" class="new">3.1.4 <i>OpenMath</i> Symbol Rôles</a><br/>
    <a href="#sec_omin">3.2 Further Description of <i>OpenMath</i> Objects</a><br/>
    <a href="#sec_names" class="new">3.3 Names</a><br/>
    <a href="#sec_summary">3.4 Summary</a><br/><a href="#cha_enco">4 <i>OpenMath</i> Encodings</a><br/>
    <a href="#sec_xml">4.1 The <span>xml</span> Encoding</a><br/>
        <a href="#ssec_xml">4.1.1 A <span class="del">Grammar</span><span>Schema</span> for the <span>xml</span> Encoding</a><br/>
        <a href="#sec_xml-desc">4.1.2 <span class="new">Informal</span> description of
the <span class="del">Grammar</span><span class="new"><span>xml</span> Encoding</span></a><br/>
            <a href="#sec_acyclicity" class="new">4.1.2.1 An Acyclicity Constraint</a><br/>
            <a href="#sec_sharing_bvars" class="new">4.1.2.2 Sharing and Bound Variables</a><br/>
        <a href="#xmldoc">4.1.3 Embedding <i>OpenMath</i> in <span>xml</span> Documents</a><br/>
    <a href="#sec_binary">4.2 The Binary Encoding</a><br/>
        <a href="#sec_binary_grammar">4.2.1 A Grammar for the Binary Encoding</a><br/>
        <a href="#sec_bin-desc">4.2.2 Description of the Grammar</a><br/>
            <a href="#sec_sharing">4.2.2.1 Sharing <span class="new">in Objects begining with the identifier [24]</span></a><br/>
        <a href="#sec_sharing_references" class="new">4.2.3 Sharing with References (beginning with [24+64])</a><br/>
        <a href="#sec_impl_note">4.2.4 Implementation Note</a><br/>
        <a href="#sec_bin_example">4.2.5 Example of Binary Encoding</a><br/>
        <a href="#sec_relation_OM1_binary" class="new">4.2.6 Relation to the <i>OpenMath</i>1 binary encoding</a><br/>
    <a href="#sec_enc_summary">4.3 Summary</a><br/><a href="#cha_cd">5 Content Dictionaries</a><br/>
    <a href="#sec_cd_summary">5.1 Introduction</a><br/>
    <a href="#sect_func">5.2 Abstract Content Dictionaries</a><br/>
        <a href="#sec_status" class="new">5.2.1 Content Dictionary Status</a><br/>
        <a href="#sec_version" class="new">5.2.2 Content Dictionary Version Numbers</a><br/>
    <a href="#sec_xml_cd">5.3 The <span class="del"><span>xml</span></span><span class="new">Reference</span> Encoding for Content Dictionaries</a><br/>
        <a href="#sec_cd_schema" class="new">5.3.1 The RelaxNG Schema for Content Dictionaries</a><br/>
        <a href="#sec_dtd_cd" class="del"> The DTD Specification of  Content Dictionaries</a><br/>
        <a href="#sect_pcdata">5.3.2 Further <span class="del">Requirements of an <i>OpenMath</i>
Content Dictionary</span><span class="new">Description of
the CD Schema</span></a><br/>
    <a href="#addfiles">5.4 Additional Information</a><br/>
        <a href="#sigfiles">5.4.1 Signature
<span class="del">Files</span><span class="new">Dictionaries</span>
</a><br/>
            <a href="#sec_dtd_sig" class="del"> The  DTD Specification of Signature Files</a><br/>
            <a href="#sect_sigpcdata">5.4.1.1 <span class="del">Further
Requirements
</span>
<span class="new">
Abstract Specification</span>
 of a Signature File</a><br/>
            <a href="#sect_sigschema" class="new">5.4.1.2 A RelaxNG Schema for a Signature File</a><br/>
            <a href="#sect_sigex">5.4.1.3 Examples</a><br/>
        <a href="#ssec_cdgroups">5.4.2 CDGroups</a><br/>
            <a href="#sec_dtd_cdg">5.4.2.1 The DTD Specification of CDGroups</a><br/>
            <a href="#sect_cdgpcdata">5.4.2.2 Further Requirements of a CDGroup</a><br/>
    <a href="#cdapprove">5.5 Content Dictionaries Reviewing Process</a><br/><a href="#cha_comp">6 <i>OpenMath</i> Compliance</a><br/>
    <a href="#sec_compl_encoding">6.1 Encoding</a><br/>
    <a href="#sec_compl_cd">6.2 Content Dictionaries</a><br/>
    <a href="#sec_comp_lex">6.3 Lexical Errors</a><br/><a href="#cha_conc">7 Conclusion</a><br/><a href="#app_cdfiles">A CD Files</a><br/>
    <a href="#app_cdcd">A.1 The <b>meta</b> Content Dictionary</a><br/>
    <a href="#arith1.ocd">A.2 The  <b>arith1</b> Content Dictionary File</a><br/>
    <a href="#arith1.sts">A.3 The  <b>arith1</b> STS Signature File</a><br/>
    <a href="#mathml.cdg">A.4 The  <b>MathML</b> CDGroup</a><br/>
    <a href="#errorcd">A.5 The <b>error</b> Content Dictionary</a><br/><a href="#app_openmath.rng">B <i>OpenMath</i> Schema in Relax NG XML Syntax (Non-Normative)</a><br/><a href="#app_relaxrestricted">C Restricting the <i>OpenMath</i> Schema (Non-Normative)</a><br/><a href="#app_xsd">D <i>OpenMath</i> Schema in XSD Syntax (Non-Normative)</a><br/><a href="#app_dtd">E <i>OpenMath</i> DTD (Non-Normative)</a><br/><a href="#app_whats_new">F Changes between <i>OpenMath</i> 1.1 and <i>OpenMath</i> 2 (Non-Normative)</a><br/>
    <a href="#">F.1 Changes to the Formal Definition of Objects</a><br/>
    <a href="#">F.2 Changes to the encodings</a><br/>
    <a href="#">F.3 Changes to Content Dictionaries</a><br/><a href="#bibliography">G Bibliography</a><br/>
<h2>List of Figures</h2><a href="#fig_om">2.1 The <i>OpenMath</i> Architecture</a><br/><a href="#fig_obj">3.1 The <i>OpenMath</i> application and binding objects for
<m:math><m:mi>sin</m:mi> <m:mo>(</m:mo><m:mi>x</m:mi> <m:mo>)</m:mo></m:math>  and
<m:math><m:mi>&#955;</m:mi> <m:mi>x</m:mi><m:mo>.</m:mo><m:mi>x</m:mi> <m:mo>+</m:mo>
<m:mn>2</m:mn></m:math>  in tree-like notation.</a><br/><a href="#fig_shared_vs_unshared">4.1 Shared vs. unshared representations</a><br/><a href="#fig_bin-enc">4.2 Grammar of the binary encoding of <i>OpenMath</i> objects.</a><br/><a href="#fig_bin-enc2" class="new">4.3 A binary encoding of the <i>OpenMath</i> object from figure <a href="#fig_shared_vs_unshared">Figure 4.1</a>.</a><br/><a href="#fig_cd-dtd" class="del"> DTD Specification of  Content Dictionaries</a><br/><a href="#fig_omcdsig.dtd" class="del"> DTD Specification of Signature Files</a><br/><a href="#fig_cdgroup.dtd">5.1 <span class="del">DTD</span><span class="new">Relax NG</span>Specification of CDGroups</a><br/>

<h2 name="cha_his" id="cha_his">
  Chapter 1<br/><i>OpenMath</i> Movement</h2>



<p>This chapter is a historical account of <i>OpenMath</i> and should be regarded
as non-normative.</p>

<p><i>OpenMath</i> is a standard for representing mathematical objects,
allowing them to be exchanged between computer programs, stored in
databases, or published on the worldwide web.  While the original
designers were mainly developers of computer algebra systems, it is
now attracting interest from other areas of scientific computation and
from many publishers of electronic documents with a significant
mathematical content.  There is a strong relationship to the MathML
recommendation <a href="#MathML_2000">[18]</a> from the Worldwide Web
Consortium, and a large overlap between the two developer communities.
MathML deals principally with the <i>presentation</i> of
mathematical objects, while <i>OpenMath</i> is solely concerned with their
semantic meaning or <i>content</i>.  While MathML does
have some limited facilities for dealing with content, it also allows
semantic information encoded in <i>OpenMath</i> to be embedded inside a MathML
structure.  Thus the two technologies may be seen as highly
complementary.</p>

<div><h3 name="sec_hist" id="sec_hist">1.1 History</h3>



<p><i>OpenMath</i> was originally developed through a series of workshops held
in Zurich (1993 and 1996), Oxford (1994), Amsterdam (1995), Copenhagen
(1995), Bath (1996), Dublin (1996), Nice (1997), Yorktown Heights
(1997), Berlin (1998), and Tallahassee (1998).  The participants in
these workshops formed a global <i>OpenMath</i> community which was coordinated
by a Steering Committee and operated through electronic mailing groups
and ad-hoc working parties.  This loose arrangement has been
formalised through the establishment of an <i>OpenMath</i> Society.  Up until the
end of 1996 much of the work of the community was funded through a
grant from the Human Capital and Mobility program of the European
Union, the contributions of several institutions and individuals.  A
document outlining the objectives and basic design of <i>OpenMath</i> was
produced (later published as
<a href="#Abbott_Leeuwen_Strotmann_98">[1]</a>).  By the end of 1996
a simplified specification had been agreed on and some prototype
implementations have come about
<a href="#Dalmas_Gaetano_Watt_97">[5]</a>.</p>


<p>In 1996 a group of European participants in <i>OpenMath</i> decided to bid
for funding under the European Union's Fourth Framework Programme for
strategic research in information technology.  This bid was successful
and the project started in late 1997.  The principal aims of the
project are to formalise <i>OpenMath</i> as a standard and to develop it
further through industrial applications; this document is a product of
that process and draws heavily on the previous work described earlier.
<i>OpenMath</i> participants from all over the world continue to meet
regularly and cooperate on areas of mutual interest, and
recent workshops in Tallahassee (November 1998) and Eindhoven (June
1999)  endorsed  drafts of this document as the current <i>OpenMath</i> standard.</p>




</div>

<div><h3 name="sec_omsoc" id="sec_omsoc">1.2 <i>OpenMath</i> Society</h3>



<p>In November 1998 the <i>OpenMath</i> Society has been established to coordinate
all <i>OpenMath</i> activities. The society is based in Helsinki, Finland and is
steered by the executive committee whose members are elected by the
society. The official web page of the society is
<a href="http://www.openmath.org">http://www.openmath.org</a>.</p>
</div>



<h2 name="cha_int" id="cha_int">
  Chapter 2<br/>Introduction to <i>OpenMath</i></h2>





<p>This chapter briefly introduces <i>OpenMath</i> concepts and notions that are
referred to in the rest of this document.</p>

<div><h3 name="sec_om-arch" id="sec_om-arch">2.1 <i>OpenMath</i> Architecture</h3>



<div class="figure"><a name="fig_om" id="fig_om"/>
    
    <img src="om-arch.png" alt="om-arch.png"/>
<div>
  Figure 2.1 The <i>OpenMath</i> Architecture</div></div>

<p>The architecture of <i>OpenMath</i> is described in <a href="#fig_om">Figure 2.1</a> and summarizes the interactions among the different
<i>OpenMath</i> components.  There are three layers of representation of a
mathematical object <a href="#OM_98">[12]</a>. A private layer that
is the internal representation used by an application.  An abstract
layer that is the representation as an <i>OpenMath</i> object. Third is a
communication layer that translates the <i>OpenMath</i> object representation to
a stream of bytes. An application dependent program manipulates the
mathematical objects using its internal representation, it can convert
them to <i>OpenMath</i> objects and communicate them by using the byte stream
representation of <i>OpenMath</i> objects.</p>
</div>

<div><h3 name="sec_intro-obj" id="sec_intro-obj">2.2 <i>OpenMath</i> Objects and Encodings</h3>






<p><i>OpenMath</i> objects are representations of mathematical entities that
can be communicated among various software applications in a
meaningful way, that is, preserving their
<span>"semantics"</span>.</p>

<p><i>OpenMath</i> objects and encodings are described in detail in <a href="#cha_obj">Chapter 3</a> and <a href="#cha_enco">Chapter 4</a>.</p>




<p>The standard endorses encodings in <span>xml</span> and binary
format. These are the encodings supported by the official <i>OpenMath</i>
libraries. However they are not the only possible encodings of <i>OpenMath</i>
objects. Users that wish to define their own encoding using some other
specific language (e.g.  Lisp) may do so provided there is an
effective translation of this encoding to an official one.</p>
</div>

<div><h3 name="sec_intro-cd" id="sec_intro-cd">2.3 Content Dictionaries</h3>



<p>Content Dictionaries (CDs) are used to assign informal and formal
semantics to all symbols used in the <i>OpenMath</i> objects. They define the
symbols used to represent concepts arising in a particular area of
mathematics.</p>

<p>The Content Dictionaries are public, they represent the actual
common knowledge among <i>OpenMath</i> applications.  Content Dictionaries fix
the <span>"meaning"</span> of objects independently of the
application.  The application receiving the object may then recognize
whether or not, according to the semantics of the symbols defined in
the Content Dictionaries, the object can be transformed to the
corresponding internal representation used by the application.</p>
</div>

<div><h3 name="sec_addnfiles" id="sec_addnfiles">2.4 Additional Files</h3>
  <p>Several
additional files are related to Content Dictionaries.  Signature files
contain the signatures of symbols defined in some <i>OpenMath</i> Content
Dictionary and their format is endorsed by this standard.</p>

<p>Furthermore, the standard fixes how to define as a CDGroup a specific
set of Content Dictionaries.</p>

<p>Auxiliary files that define presentation and rendering or that
are used for manipulating and processing Content Dictionaries are not
discussed by the standard.</p>


</div>
<div><h3 name="sec_phrasebooks" id="sec_phrasebooks">2.5 Phrasebooks</h3>




<p>The conversion of an <i>OpenMath</i> object to/from the internal
representation in a software application is performed by an interface
program called <i>Phrasebook</i>. The translation is
governed by the Content Dictionaries and the specifics of the
application. It is envisioned that a software application dealing with
a specific area of mathematics declares which Content Dictionaries it
understands. As a consequence, it is expected that the Phrasebook of
the application is able to translate <i>OpenMath</i> objects built using symbols
from these Content Dictionaries to/from the internal mathematical
objects of the application.</p>

 <p><i>OpenMath</i> objects do not
specify any computational behaviour, they merely represent mathematical
expressions.  Part of the <i>OpenMath</i> philosophy is to leave it to the
application to decide what it does with an object once it has received
it.  <i>OpenMath</i> is not a query or programming language. Because of this,
<i>OpenMath</i> does not prescribe a way of forcing <span>"evaluation"</span> or
<span>"simplification"</span> of objects like
<m:math><m:mn>2</m:mn><m:mo>+</m:mo><m:mn>3</m:mn></m:math>  or
<m:math><m:mi>sin</m:mi><m:mo>(</m:mo><m:mi>&#960;</m:mi><m:mo>)</m:mo></m:math>. Thus,
the same object <m:math><m:mn>2</m:mn><m:mo>+</m:mo><m:mn>3</m:mn></m:math>  could be
transformed to <m:math><m:mn>5</m:mn></m:math>  by a computer algebra system,
or displayed as <m:math><m:mn>2</m:mn><m:mo>+</m:mo><m:mn>3</m:mn></m:math>  by a
typesetting tool.</p>
</div>


<h2 name="cha_obj" id="cha_obj">
  Chapter 3<br/><i>OpenMath</i> Objects</h2>




<p>In this chapter we provide a self-contained description of <i>OpenMath</i>
objects. We first do so at an informal level (<a href="#sec_omin">Section 3.2</a>) and next by means of an abstract grammar
description (<a href="#sec_omabs">Section 3.1</a>).</p>


<div><h3 name="sec_omabs" id="sec_omabs">3.1 Formal Definition of <i>OpenMath</i> Objects</h3>



<p><i>OpenMath</i> represents mathematical objects as terms or as labelled
trees that are called <i>OpenMath</i> objects or <i>OpenMath</i> expressions. The definition
of an abstract <i>OpenMath</i> object is then the following.</p>


<div><h4 name="sec_basic" id="sec_basic">3.1.1 Basic <i>OpenMath</i> objects</h4>
 <p>The Basic <i>OpenMath</i> Objects form
the leaves of the <i>OpenMath</i> Object tree.  A Basic <i>OpenMath</i> Object is of one of
the following.</p> 
<ul>
<li><p><span>(i)</span> Integer.</p><p>Integers in
  the mathematical sense, with no predefined range.  They are
  <span>"infinite precision"</span> integers (also called
  <span>"bignums"</span> in computer algebra).</p></li>
<li><p><span>(ii)</span> IEEE floating point
    number.</p><p>Double precision floating-point numbers
    following the <span>ieee</span> 754-1985
    standard <a href="#ieee754_85">[8]</a>.</p></li>
<li><p><span>(iii)</span> Character string.</p><p>A Unicode Character string. This also corresponds to `characters' in
  <span>xml</span>.</p></li>
<li><p><span>(iv)</span> Bytearray.</p><p>A sequence of bytes.</p></li>
<li><p><span>(v)</span> Symbol.</p><p class="del">A Symbol
encodes two fields of information, a <i>name</i> and a
<i>Content Dictionary</i>. Each is a sequence of
characters matching a regular expression, as described below.</p><p class="new">A Symbol encodes three fields of
information, a <i>name</i>, a <i>Content
Dictionary</i>, and (optionally) a role.  The name of a symbol
is a sequence of characters matching the regular expression described
in <a href="#sec_names">Section 3.3</a>.  The Content Dictionary is the
location of the definition of the symbol, consisting of a name (a
sequence of characters matching the regular expression described in
<a href="#sec_names">Section 3.3</a>) and, optionally, a unique prefix called
a <i>cdbase</i> which is used to
disambiguate multiple Content Dictionaries of the same name.  The role
is a restriction on where the symbol may appear in an <i>OpenMath</i> object.
The possible roles are described in <a href="#sec_roles">Section 3.1.4</a>.

</p></li>
<li><p><span>(vi)</span> Variable.</p><p>A Variable <span class="del">consists of</span>
<span class="new">must have</span> a
<i>name</i> which is a sequence of characters matching a
regular expression, as described in <a href="#sec_names">Section 3.3</a>.
<span class="new">Where the variable is a member of an
enumerated set it also has a child which is an <i>OpenMath</i> object
representing its indices.  </span></p></li>
</ul>
</div>

<div class="new"><h4 name="sec_derived" id="sec_derived">3.1.2 Derived <i>OpenMath</i> Objects</h4>


<p>A derived <i>OpenMath</i> object is built as follows: 
<ul>
<li><p><span>(i)</span> If <m:math><m:mi>A</m:mi></m:math>  is
<i>not</i> an <i>OpenMath</i> object, then <m:math><m:mi mathvariant="bold">foreign</m:mi><m:mfenced><m:mi>A</m:mi></m:mfenced></m:math>  is an <i>OpenMath</i>
<i>foreign object</i>.</p></li>
</ul>
</p>
</div>

<div><h4 name="sec_compound" id="sec_compound">3.1.3 Compound <i>OpenMath</i> Objects</h4>

  
<p><i>OpenMath</i> objects are built recursively as follows.
<ul>
<li><p><span>(i)</span> Basic <i>OpenMath</i> objects are <i>OpenMath</i> objects.
<span class="new">Derived <i>OpenMath</i> objects are <i>not</i>
<i>OpenMath</i> objects.</span></p></li>

<li><p>
    <span>(ii)</span> If
    <m:math><m:msub><m:mi>A</m:mi><m:mn>1</m:mn></m:msub></m:math>,
    <span>&#8230;</span>,
    <m:math><m:msub><m:mi>A</m:mi><m:mi>n</m:mi></m:msub></m:math> 
    <m:math><m:mo>(</m:mo><m:mi>n</m:mi><m:mo>&gt;</m:mo><m:mn>0</m:mn><m:mo>)</m:mo></m:math> 
    are <i>OpenMath</i> objects, then
  <m:math display="block">
  <m:mi mathvariant="bold">application</m:mi><m:mo>(</m:mo><m:msub><m:mi>A</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo> <m:mi>&#8230;</m:mi><m:mo>,</m:mo> <m:msub><m:mi>A</m:mi><m:mi>n</m:mi></m:msub><m:mo>)</m:mo>
  </m:math>
  is an <i>OpenMath</i> <i>application object</i>.</p></li> <li><p><span>(iii)</span> If
  <m:math><m:msub><m:mi>S</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo>
  <m:mi>&#8230;</m:mi><m:mo>,</m:mo> <m:msub><m:mi>S</m:mi><m:mi>n</m:mi></m:msub></m:math> 
  are <i>OpenMath</i> symbols, and
<span class="del">
<m:math><m:mi>A</m:mi></m:math>,
  <m:math><m:msub><m:mi>A</m:mi><m:mn>1</m:mn></m:msub></m:math>,
  <span>&#8230;</span>, <m:math><m:msub><m:mi>A</m:mi><m:mi>n</m:mi></m:msub></m:math>, <m:math><m:mo>(</m:mo><m:mi>n</m:mi><m:mo>&gt;</m:mo><m:mn>0</m:mn><m:mo>)</m:mo></m:math>  are <i>OpenMath</i> objects, then
</span>
<span class="new">
<m:math><m:mi>A</m:mi></m:math>  is an <i>OpenMath</i> object, and
  <m:math><m:msub><m:mi>A</m:mi><m:mn>1</m:mn></m:msub></m:math>,
  <span>&#8230;</span>, <m:math><m:msub><m:mi>A</m:mi><m:mi>n</m:mi></m:msub></m:math>, <m:math><m:mo>(</m:mo><m:mi>n</m:mi><m:mo>&gt;</m:mo><m:mn>0</m:mn><m:mo>)</m:mo></m:math>  are <i>OpenMath</i> objects or <i>OpenMath</i> derived objects, then
</span>

  <m:math display="block"><m:mi mathvariant="bold">attribution</m:mi>
  <m:mo>(</m:mo><m:mi>A</m:mi><m:mo>,</m:mo> <m:msub><m:mi>S</m:mi><m:mn>1</m:mn></m:msub>
  <m:mspace width=".3em"/> <m:msub><m:mi>A</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo>
  <m:mspace width=".3em"/> <m:mi>&#8230;</m:mi> <m:mspace width=".3em"/>
  <m:mo>,</m:mo> <m:msub><m:mi>S</m:mi><m:mi>n</m:mi></m:msub> <m:mspace width=".3em"/>
  <m:msub><m:mi>A</m:mi><m:mi>n</m:mi></m:msub><m:mo>)</m:mo></m:math> is an <i>OpenMath</i>
  <i>attribution object</i>. 

  <span class="del">and</span> <m:math><m:mi>A</m:mi></m:math> 
  is the object <i>stripped of attributions</i>. <span class="new">
  <m:math><m:msub><m:mi>S</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo>
  <m:mi>&#8230;</m:mi><m:mo>,</m:mo> <m:msub><m:mi>S</m:mi><m:mi>n</m:mi></m:msub></m:math> 
  are referred to as <i>keys</i> and
  <m:math><m:msub><m:mi>A</m:mi><m:mn>1</m:mn></m:msub></m:math>,
  <span>&#8230;</span>,
  <m:math><m:msub><m:mi>A</m:mi><m:mi>n</m:mi></m:msub></m:math>  as their associated
  <i>values</i></span>. The operation of recursively
  applying stripping to the stripped object is called
  <i>flattening of the attribution</i>.

		  When the stripped object after flattening is a
  variable, the attributed object is called <i>attributed
  variable</i>.</p></li>

<li><p><span>(iv)</span> If <m:math><m:mi>B</m:mi></m:math>  and
  <m:math><m:mi>C</m:mi></m:math>  are <i>OpenMath</i> objects, and
  <m:math><m:msub><m:mi>v</m:mi><m:mn>1</m:mn></m:msub></m:math>,
  <m:math><m:mi>&#8230;</m:mi></m:math>,
  <m:math><m:msub><m:mi>v</m:mi><m:mi>n</m:mi></m:msub></m:math> 
  <m:math><m:mo>(</m:mo><m:mi>n</m:mi> <m:mo>&#8805;</m:mo>
  <m:mn>0</m:mn><m:mo>)</m:mo></m:math>  are <i>OpenMath</i> variables or attributed
  variables, then
  <m:math display="block">
  <m:mi mathvariant="bold">binding</m:mi> <m:mo>(</m:mo><m:mi>B</m:mi><m:mo>,</m:mo> <m:msub><m:mi>v</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo> <m:mi>&#8230;</m:mi><m:mo>,</m:mo> <m:msub><m:mi>v</m:mi><m:mi>n</m:mi></m:msub><m:mo>,</m:mo> <m:mi>C</m:mi><m:mo>)</m:mo>
  </m:math>
is an <i>OpenMath</i> <i>binding object</i>.</p></li>
<li><p><span>(v)</span> If <m:math><m:mi>S</m:mi></m:math>  is an
<i>OpenMath</i> symbol and <m:math><m:msub><m:mi>A</m:mi><m:mn>1</m:mn></m:msub></m:math>,
<span>&#8230;</span>,
<m:math><m:msub><m:mi>A</m:mi><m:mi>n</m:mi></m:msub></m:math> 
<m:math><m:mo>(</m:mo><m:mi>n</m:mi> <m:mo>&#8805;</m:mo>
<m:mn>0</m:mn><m:mo>)</m:mo></m:math>  are <i>OpenMath</i> objects, then <m:math display="block"><m:mi mathvariant="bold">error</m:mi>
<m:mo>(</m:mo><m:mi>S</m:mi><m:mo>,</m:mo>
<m:msub><m:mi>A</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:mi>&#8230;</m:mi><m:mo>,</m:mo><m:msub><m:mi>A</m:mi><m:mi>n</m:mi></m:msub><m:mo>)</m:mo>
  </m:math>
  is an <i>OpenMath</i> <i>error object</i>.</p></li>
</ul>
</p>
</div>

<div class="new"><h4 name="sec_roles" id="sec_roles">3.1.4 <i>OpenMath</i> Symbol Rôles</h4>


<p>The <i>rôle</i> of an <i>OpenMath</i> symbol is a restriction
on where it can appear in an <i>OpenMath</i> object.  A symbol cannot have more
than one role.  If no role is indicated
then the symbol can be used anywhere.  Possible roles are:
<ol class="lowerroman">

<li><p><i>binder</i> The symbol may only
appear as the first child of an <i>OpenMath</i> binding object.
</p></li>

<li><p> <i>attribution</i> The symbol may only
be used as key in an <i>OpenMath</i> attribution object, i.e. as the first
element of a key-value pair, or in an equivalent context (for example
to refer to the value of an attribution).  This form of attribution
may be ignored by an application, so should be used for information
which does not change the meaning of the attributed <i>OpenMath</i> object.
</p></li> 

<li><p> <i>semantic-attribution</i> This is the
same as <i>attribution</i> except that it modifies the
meaning of the attributed <i>OpenMath</i> object and thus cannot be ignored by an
application.  </p></li> 

<li><p> <i>error</i> The symbol can only appear
as the first child of an <i>OpenMath</i> error object.  </p></li>
<li><p> <i>default</i> The symbol can appear
anywhere not defined in the previous four cases.  </p></li>
</ol>
</p>
</div>

</div>
<div><h3 name="sec_omin" id="sec_omin">3.2 Further Description of <i>OpenMath</i> Objects</h3>




  

<p>Informally, an <i>OpenMath</i> <span><i>object</i></span> can be
viewed as a tree and is also referred to as a term.  The objects at
the leaves of <i>OpenMath</i> trees are called <span><i>basic
objects</i></span>.  The basic objects supported by <i>OpenMath</i> are:
<dl>
<dt>Integer</dt><dd><p>Arbitrary Precision
integers.</p> </dd>
<dt>Float</dt><dd> <p><i>OpenMath</i> floats are
<span>ieee</span> 754 Double precision floating-point
numbers. Other types of floating point number may be encoded in <i>OpenMath</i>
by the use of suitable content dictionaries.</p>
  
</dd>

<dt>Character strings</dt><dd><p>are
  sequences of characters. These characters come from the Unicode
  standard <a href="#UNICODE">[14]</a>.</p>
  
</dd>
<dt>Bytearrays</dt><dd><p>are sequences of
bytes. There is no <span>"byte"</span> in <i>OpenMath</i> as an object of its
own. However, a single byte can of course be represented by a
bytearray of length 1.  The difference between strings and bytearrays
is the following: a character string is a sequence of bytes with a
fixed interpretation (as characters, Unicode texts may require several
bytes to code one character), whereas a bytearray is an uninterpreted
sequence of bytes with no intrinsic meaning.  Bytearrays could be used
inside <i>OpenMath</i> errors to provide information to, for example, a debugger;
they could also contain intermediate results of calculations, or
`handles' into computations or databases.</p>
</dd>

<dt>Symbols</dt><dd>
  
  
  <p>
 are uniquely defined by the Content Dictionary in which they occur
  and by a name.
<span class="del">In definition in <a href="#sec_omabs">Section 3.1</a> we have
  left this information implicit. However, it should be kept in mind
  that all symbols appearing in an <i>OpenMath</i> object are defined in a
  Content Dictionary.
</span>The form of these definitions is explained in
  <a href="#cha_cd">Chapter 5</a>.  Each symbol has no more than one
  definition in a Content Dictionary. Many Content Dictionaries may
  define differently a symbol with the same name (e.g. the symbol
  <small><code>union</code></small> is defined as
  associative-commutativeset theoretic union in a Content Dictionary
  <small><code>set1</code></small> but another Content Dictionary,
  <small><code>multiset1</code></small> might define a symbol
  <small><code>union</code></small> as the union of multi-sets).
<span class="del">The name
  of a symbol can only contain alphanumeric characters and
  underscores.  More precisely, a symbol name matches the following
  regular expression:</span>
<blockquote><p>
  [<small><code>A</code></small>-<small><code>Z</code></small><small><code>a</code></small>-<small><code>z</code></small>]
  [<small><code>A</code></small>-<small><code>Z</code></small><small><code>a</code></small>-<small><code>z</code></small><small><code>0</code></small>-<small><code>9</code></small><small><code>_</code></small>]*
  </p></blockquote>
  <span class="del">Notice that these symbol names are case sensitive.  <i>OpenMath</i>
  <i>recommends</i> that symbol names should be no longer than
  100 characters.</span>
</p>
  
 
  </dd>

<dt>Variables</dt><dd><p>are meant to
  denote parameters, variables or indeterminates (such as bound
  variables of function definitions, variables in summations and
  integrals, independent variables of derivatives).  <span class="del">Plain variable names are restricted to use a
  subset of the printable ASCII characters.  Formally the names must
  match the regular expression:</span> <blockquote><p>
  [A-Za-z0-9=+(),-./:?!#$%*;=@[]^_`{|}]+ </p></blockquote>
</p>
<p class="new">
A variable may have one or more children which are themselves <i>OpenMath</i>
objects and are treated as scripts.  Thus it is possible to create a
variable with cardinality such as
<m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub></m:math>  or
<m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>.
</p>
</dd>

</dl> </p>


<p class="new">Currently there is one way of making a
derived <i>OpenMath</i> object.</p>

<dl class="new">
<dt>Foreign</dt><dd><p>is used to import a
non-<i>OpenMath</i> object into an <i>OpenMath</i> attribution.  Examples of its use could
be to annotate a formula with a visual or aural rendering, an
animation etc.
</p>
</dd>

</dl>


<p>The four following constructs can be used to make compound
 <i>OpenMath</i> objects.</p>
<dl>
<dt>Application</dt><dd><p>constructs an
  <i>OpenMath</i> object from a sequence of one or more <i>OpenMath</i> objects. The first
  argument of application is referred to as <span>"head"</span> while
  the remaining objects are called <span>"arguments"</span>.  An <i>OpenMath</i>
  application object can be used to convey the mathematical notion of
  application of a function to a set of arguments.  For instance,
  suppose that the <i>OpenMath</i> symbol <m:math><m:mi>sin</m:mi></m:math>  is defined in
  a Content Dictionary for trigonometry, then <m:math><m:mi mathvariant="bold">application</m:mi><m:mo>(</m:mo><m:mi>sin</m:mi><m:mo>,</m:mo>
  <m:mi>x</m:mi> <m:mo>)</m:mo></m:math>  is the abstract <i>OpenMath</i> object
  corresponding to <m:math><m:mi>sin</m:mi> <m:mo>(</m:mo><m:mi>x</m:mi>
  <m:mo>)</m:mo></m:math>.  More generally, an <i>OpenMath</i> application object can
  be used as a constructor to convey a mathematical object built from
  other objects such as a polynomial constructed from a set of
  monomials.  Constructors build inhabitants of some symbolic type,
  for instance the type of rational numbers or the type of
  polynomials.  The rational number, usually denoted as
  <m:math><m:mn>1</m:mn><m:mo>/</m:mo><m:mn>2</m:mn></m:math>, is represented by the
  <i>OpenMath</i> application object <m:math><m:mi mathvariant="bold">application</m:mi><m:mo>(</m:mo><m:mi>Rational</m:mi><m:mo>,</m:mo>
  <m:mn>1</m:mn><m:mo>,</m:mo> <m:mn>2</m:mn><m:mo>)</m:mo></m:math>. The symbol
  <m:math><m:mi>Rational</m:mi></m:math>  must be defined, by a Content
  Dictionary, as a constructor symbol for the rational numbers.</p>
   
<div class="figure"><a name="fig_obj" id="fig_obj"/>
      <img src="lambda.png" alt="lambda.png"/>
<div>
  Figure 3.1 The <i>OpenMath</i> application and binding objects for
<m:math><m:mi>sin</m:mi> <m:mo>(</m:mo><m:mi>x</m:mi> <m:mo>)</m:mo></m:math>  and
<m:math><m:mi>&#955;</m:mi> <m:mi>x</m:mi><m:mo>.</m:mo><m:mi>x</m:mi> <m:mo>+</m:mo>
<m:mn>2</m:mn></m:math>  in tree-like notation.</div></div>

  
</dd>

<dt>Binding</dt><dd><p>objects are
  constructed from an <i>OpenMath</i> object, and from a sequence of zero or more
  variables followed by another <i>OpenMath</i> object.  The first <i>OpenMath</i> object is
  the <span>"binder"</span> object. Arguments 2 to
  <m:math><m:mi>n</m:mi><m:mo>-</m:mo><m:mn>1</m:mn></m:math>  are always variables to
  be bound in the <span>"body"</span> which is the
  <m:math><m:msup><m:mi>n</m:mi><m:mi>th</m:mi></m:msup></m:math>  argument object. It
  is allowed to have no bound variables, but the binder object and the
  body should be present. Binding can be used to express functions or
  logical statements.  The function <m:math><m:mi>&#955;</m:mi>
  <m:mi>x</m:mi><m:mo>.</m:mo><m:mi>x</m:mi> <m:mo>+</m:mo><m:mn>2</m:mn></m:math>, in which
  the variable <m:math><m:mi>x</m:mi></m:math>  is bound by
  <m:math><m:mi>&#955;</m:mi></m:math>, corresponds to a binding object having
  as binder the <i>OpenMath</i> symbol <m:math><m:mi>lambda</m:mi></m:math>: <m:math display="block"><m:mi mathvariant="bold">binding</m:mi><m:mo>(</m:mo><m:mi>lambda</m:mi><m:mo>,</m:mo>
  <m:mi>x</m:mi> <m:mo>,</m:mo> <m:mi mathvariant="bold">application</m:mi><m:mo>(</m:mo><m:mi>plus</m:mi><m:mo>,</m:mo>
  <m:mi>x</m:mi> <m:mo>,</m:mo>
  <m:mn>2</m:mn><m:mo>)</m:mo><m:mo>)</m:mo><m:mtext>.</m:mtext></m:math></p>
  
  
  


<p>Phrasebooks are allowed to use <m:math><m:mi>&#945;</m:mi></m:math> 
  conversion in order to avoid clashes of variable names. Suppose an
  object <m:math><m:mi>&#937;</m:mi></m:math>  contains an occurrence of the
  object <m:math><m:mi mathvariant="bold">binding</m:mi>
  <m:mo>(</m:mo><m:mi>B</m:mi> <m:mo>,</m:mo> <m:mi>v</m:mi> <m:mo>,</m:mo> <m:mi>C</m:mi>
  <m:mo>)</m:mo></m:math>.  This object <m:math><m:mi mathvariant="bold">binding</m:mi> <m:mo>(</m:mo><m:mi>B</m:mi> <m:mo>,</m:mo>
  <m:mi>v</m:mi> <m:mo>,</m:mo> <m:mi>C</m:mi> <m:mo>)</m:mo></m:math>  can be replaced
  in <m:math><m:mi>&#937;</m:mi></m:math>  by <m:math><m:mi mathvariant="bold">binding</m:mi> <m:mo>(</m:mo><m:mi>B</m:mi> <m:mo>,</m:mo>
  <m:mi>z</m:mi> <m:mo>,</m:mo> <m:mi>C'</m:mi><m:mo>)</m:mo></m:math>  where
  <m:math><m:mi>z</m:mi></m:math>  is a variable not occurring free in
  <m:math><m:mi>C</m:mi></m:math>  and <m:math><m:mi>C'</m:mi></m:math>  is obtained
  from <m:math><m:mi>C</m:mi></m:math>  by replacing each free (i.e., not bound
  by any intermediate <b>binding</b> construct) occurrence
  of <m:math><m:mi>v</m:mi></m:math>  by <m:math><m:mi>z</m:mi></m:math>.  This
  operation preserves the semantics of the object
  <m:math><m:mi>&#937;</m:mi></m:math>. In the above example, a phrasebook is
  thus allowed to transform the object to, e.g.  <m:math revisionflag="deleted" display="block"><m:mi mathvariant="bold">binding</m:mi>
  <m:mo>(</m:mo><m:mi>lambda</m:mi><m:mo>,</m:mo> <m:mi>v</m:mi> <m:mo>,</m:mo> <m:mi mathvariant="bold">binding</m:mi> <m:mo>(</m:mo><m:mi>lambda</m:mi><m:mo>,</m:mo>
  <m:mi>z</m:mi> <m:mo>,</m:mo><m:mi mathvariant="bold">application</m:mi>
  <m:mo>(</m:mo><m:mi>times</m:mi><m:mo>,</m:mo><m:mi>z</m:mi>
  <m:mo>,</m:mo><m:mi>z</m:mi><m:mo>)</m:mo><m:mo>)</m:mo><m:mo>)</m:mo><m:mtext>.</m:mtext></m:math>
  <m:math revisionflag="added" display="block"><m:mi mathvariant="bold">binding</m:mi><m:mo>(</m:mo><m:mi>lambda</m:mi><m:mo>,</m:mo>
  <m:mi>z</m:mi> <m:mo>,</m:mo> <m:mi mathvariant="bold">application</m:mi><m:mo>(</m:mo><m:mi>plus</m:mi><m:mo>,</m:mo>
  <m:mi>z</m:mi> <m:mo>,</m:mo>
  <m:mn>2</m:mn><m:mo>)</m:mo><m:mo>)</m:mo><m:mtext>.</m:mtext></m:math>
</p>
<p>Repeated occurrences of the same variable in a binding operator
  are allowed. An <i>OpenMath</i> application should treat a binding with
  multiple occurrences of the same variable as equivalent to the
  binding in which all but the last occurrence of each variable is
  replaced by a new variable which does not occur free in the body of
  the binding.  <m:math display="block"><m:mi mathvariant="bold">binding</m:mi> <m:mo>(</m:mo><m:mi>lambda</m:mi><m:mo>,</m:mo>
  <m:mi>v</m:mi> <m:mo>,</m:mo> <m:mi>v</m:mi> <m:mo>,</m:mo><m:mi mathvariant="bold">application</m:mi>
  <m:mo>(</m:mo><m:mi>times</m:mi><m:mo>,</m:mo><m:mi>v</m:mi>
  <m:mo>,</m:mo><m:mi>v</m:mi><m:mo>)</m:mo> <m:mo>)</m:mo></m:math> is semantically
  equivalent to: <m:math display="block"><m:mi mathvariant="bold">binding</m:mi> <m:mo>(</m:mo><m:mi>lambda</m:mi> <m:mo>,</m:mo>
  <m:msup><m:mi>v</m:mi><m:mo>'</m:mo></m:msup> <m:mo>,</m:mo> <m:mi>v</m:mi>
  <m:mo>,</m:mo><m:mi mathvariant="bold">application</m:mi>
  <m:mo>(</m:mo><m:mi>times</m:mi><m:mo>,</m:mo><m:mi>v</m:mi>
  <m:mo>,</m:mo><m:mi>v</m:mi><m:mo>)</m:mo> <m:mo>)</m:mo></m:math> so that the
  resulting function is actually a constant in its first argument
  (<m:math><m:msup><m:mi>v</m:mi><m:mo>'</m:mo></m:msup></m:math>  does not occur free
  in the body <m:math><m:mi mathvariant="bold">application</m:mi>
  <m:mo>(</m:mo><m:mi>times</m:mi><m:mo>,</m:mo><m:mi>v</m:mi>
  <m:mo>,</m:mo><m:mi>v</m:mi><m:mo>)</m:mo> <m:mo>)</m:mo></m:math>).</p>

  
</dd>

<dt>Attribution</dt><dd><p>decorates an
  object with a sequence of one or more pairs made up of an <i>OpenMath</i>
  symbol, the <span>"attribute"</span>, and an associated <span class="del"><i>OpenMath</i></span> object, the <span>"value of the
  attribute"</span>.  The value of the attribute can be an <span class="new"><i>OpenMath</i></span> attribution object itself. As an
  example of this, consider the <i>OpenMath</i> objects representing groups,
  automorphism groups, and group dimensions. It is then possible to
  attribute an <i>OpenMath</i> object representing a group by its automorphism
  group, itself attributed by its dimension.</p>

<p class="new">
<i>OpenMath</i> objects can be attributed with <i>OpenMath</i> derived objects, which are
containers for non-<i>OpenMath</i> structures.  For example a mathematical
expression could be attributed with its spoken or visual rendering.
</p>

<p>Composition of attributions, as in
  <m:math display="block">
<m:mi mathvariant="bold">attribution</m:mi><m:mo>(</m:mo><m:mi mathvariant="bold">attribution</m:mi><m:mo>(</m:mo><m:mi>A</m:mi><m:mo>,</m:mo>
  <m:msub><m:mi>S</m:mi><m:mn>1</m:mn></m:msub> <m:mspace width=".3em"/>
  <m:msub><m:mi>A</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo><m:mi>&#8230;</m:mi><m:mo>,</m:mo><m:msub><m:mi>S</m:mi><m:mi>h</m:mi></m:msub>
  <m:mspace width=".3em"/>
  <m:msub><m:mi>A</m:mi><m:mi>h</m:mi></m:msub><m:mo>)</m:mo><m:mo>,</m:mo>
  <m:msub><m:mi>S</m:mi><m:mrow><m:mi>h</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub>
  <m:mspace width=".3em"/>
  <m:msub><m:mi>A</m:mi><m:mrow><m:mi>h</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>,</m:mo>
  <m:mi>&#8230;</m:mi><m:mo>,</m:mo> <m:msub><m:mi>S</m:mi><m:mi>n</m:mi></m:msub> <m:mspace width=".3em"/> <m:msub><m:mi>A</m:mi><m:mi>n</m:mi></m:msub><m:mo>)</m:mo></m:math> is
  semantically equivalent to a single attribution, that is <m:math display="block"><m:mi mathvariant="bold">attribution</m:mi><m:mo>(</m:mo><m:mi>A</m:mi><m:mo>,</m:mo>
  <m:msub><m:mi>S</m:mi><m:mn>1</m:mn></m:msub> <m:mspace width=".3em"/>
  <m:msub><m:mi>A</m:mi><m:mn>1</m:mn></m:msub><m:mo>,</m:mo>
  <m:mi>&#8230;</m:mi><m:mo>,</m:mo> <m:msub><m:mi>S</m:mi><m:mi>h</m:mi></m:msub> <m:mspace width=".3em"/> <m:msub><m:mi>A</m:mi><m:mi>h</m:mi></m:msub><m:mo>,</m:mo>
  <m:msub><m:mi>S</m:mi><m:mrow><m:mi>h</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub>
  <m:mspace width=".3em"/>
  <m:msub><m:mi>A</m:mi><m:mrow><m:mi>h</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub><m:mo>,</m:mo>
  <m:mi>&#8230;</m:mi><m:mo>,</m:mo> <m:msub><m:mi>S</m:mi><m:mi>n</m:mi></m:msub> <m:mspace width=".3em"/>
  <m:msub><m:mi>A</m:mi><m:mi>n</m:mi></m:msub><m:mo>)</m:mo><m:mtext>.</m:mtext></m:math>
  The operation that produces an object with a single layer of
  attribution is called <i>flattening</i>.</p>

<p>Multiple attributes with the same name are allowed.  While the
  order of the given attributes does not imply any notion of priority,
  potentially it could be significant. For instance, consider the case
  in which <m:math><m:msub><m:mi>S</m:mi><m:mi>h</m:mi></m:msub> <m:mo>=</m:mo>
  <m:msub><m:mi>S</m:mi><m:mi>n</m:mi></m:msub></m:math>  (<m:math><m:mi>h</m:mi>
  <m:mo>&lt;</m:mo> <m:mi>n</m:mi></m:math>) in the example above. Then, the
  object is to be interpreted as if the value
  <m:math><m:msub><m:mi>A</m:mi><m:mi>n</m:mi></m:msub></m:math>  overwrites the value
  <m:math><m:msub><m:mi>A</m:mi><m:mi>h</m:mi></m:msub></m:math>.  (<i>OpenMath</i> however does
  not mandate that an application preserves the attributes or their
  order.)</p>

<p class="new">Attribution acts as either adornment
  annotation or as semantical annotation. When the key has rôle
  <i> attribution</i>, then replacement of the
  attributed object by the object itself is not harmful and preserves
  the semantics. When the key has rôle
  <i>semantic-attribution</i> then the attributed
  object is modified by the attribution and cannot be viewed as
  semantically equivalent to the stripped object. If the attribute
  lacks the rôle specification then attribution is acting as adornment
  annotation.
  </p>


<p>Objects can be decorated in a multitude of
ways. In <a href="#OM_D131b">[3]</a>, typing of <i>OpenMath</i> objects is
expressed by using an attribution. The object <m:math><m:mi mathvariant="bold">attribution</m:mi><m:mo>(</m:mo><m:mi>A</m:mi><m:mo>,</m:mo>
<m:mi>type</m:mi> <m:mspace width=".3em"/> <m:mi>t</m:mi> <m:mo>)</m:mo></m:math> 
represents the judgment stating that object <m:math><m:mi>A</m:mi></m:math> 
has type <m:math><m:mi>t</m:mi></m:math>. Note that both
<m:math><m:mi>A</m:mi></m:math>  and <m:math><m:mi>t</m:mi></m:math>  are <i>OpenMath</i>
objects.</p>


<p class="del">Attribution can act as either annotation,
  in the sense of adornment, or as modifier. In the former case,
  replacement of the adorned object by the object itself is probably
  not harmful (preserves the semantics). In the latter case however,
  it may very well be.  Therefore, attribution in general should by
  default be treated as a construct rather than as adornment. Only
  when the CD definitions of the attributes make it clear that they
  are adornments, can the attributed object be viewed as semantically
  equivalent to the stripped object.</p>

  	    
  
  
</dd>

<dt>Error</dt><dd><p>is made up of an <i>OpenMath</i>
  symbol and a sequence of zero or more <i>OpenMath</i> objects. This object has
  no direct mathematical meaning.  Errors occur as the result of some
  treatment on an <i>OpenMath</i> object and are thus of real interest only when
  some sort of communication is taking place. Errors may occur inside
  other objects and also inside other errors.  Error objects might
  consist only of a symbol as in the object: <m:math><m:mi mathvariant="bold">error</m:mi> <m:mo>(</m:mo><m:mi>S</m:mi>
  <m:mo>)</m:mo></m:math>.</p> 
</dd>

</dl> 
</div>

<div class="new"><h3 name="sec_names" id="sec_names">3.3 Names</h3>

<p>

The names of symbols, variables and content dictionaries must conform to the
following rules, which are designed to be compatible with standards such as
Unicode and XML.  These standards group individual characters into letters,
digits, combining characters and extenders.  Informally, these are defined as
follows:

<dl>

<dt>Letters</dt><dd><p> are elements of an
alphabet such as latin, cyrillic, kanji etc.</p></dd>

<dt>Digits</dt><dd><p> are atomic numbers,
from which compound numbers can be constructed (for example `1' is a
digit but `11' is not).</p></dd>

<dt>Combining Characters</dt><dd><p> are
used to combine several characters to produce a new one, for example
an accented character.
</p></dd>

<dt>Extenders</dt><dd><p> are characters
which are neither letters nor combining characters but modify the
appearance of other characters in some way.
</p></dd>

</dl>
Formally, we use the precise definitions given in the Unicode
standard <a href="#UNICODE">[14]</a>.
</p>

<p>

Then a legal <i>OpenMath</i> name is defined by the following grammar:
<blockquote>
<table>
<tr>
<td>Name </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> (Letter | '_') (Char)*
</td>
</tr>
<tr>
<td>Char</td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> Letter | Digit | '.' | '-' | '_' | CombiningChar | Extender
</td>
</tr>
</table>
</blockquote>

</p>

<p><b>CD Base</b>

<p>A cdbase must conform to the grammar for URIs described in
<a href="#IETF2396">[9]</a>.  Note that if non-ASCII characters are
used in a CD or symbol name then when a URI for that symbol is
constructed it will be necessary to map the non-ASCII characters to a
sequence of octets.  The precise mechanism for doing this depends on
the URI scheme.</p></p>

<p><b>Note on content dictionary names</b>
<p>
It is a common convention to store a Content Dictionary in a file of
the same name, which can cause difficulties on many file systems.  If
this convention is to be followed then <i>OpenMath</i>
<i>recommends</i> that the name be restricted to the
subset of the above grammar which is a legal POSIX
<a href="#POSIX">[7]</a> filename, namely:
<blockquote>
<table>
<tr>
<td>Name </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> (PosixLetter | '_') (Char)*
</td>
</tr>
<tr>
<td>Char</td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> PosixLetter | Digit | '.' | '-' | '_' 
</td>
</tr>
<tr>
<td>PosixLetter</td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> 
'a' | 'b' | ... | 'z' | 'A' | 'B' | ... | 'Z'
</td>
</tr>
</table>
</blockquote>
</p>
</p>

</div>

<div><h3 name="sec_summary" id="sec_summary">3.4 Summary</h3>


<ul>
<li><p><i>OpenMath</i> supports basic objects like integers, symbols,
  floating-point numbers, character strings, bytearrays, and
  variables.</p></li>
<li><p><i>OpenMath</i> compound objects are of four kinds:
  applications, bindings, errors, and attributions.</p></li>
<li class="new"><p><i>OpenMath</i> objects may be attributed
with non-<i>OpenMath</i> objects via the use of derived <i>OpenMath</i> objects.
  </p></li>
<li><p><i>OpenMath</i> objects have the expressive power to cover all
  areas of computational mathematics.</p></li>
</ul>

 <p>Observe that an <i>OpenMath</i>
application object is viewed as a <span>"tree"</span> by software
applications that do not understand Content Dictionaries, whereas a
Phrasebook that understands the semantics of the symbols, as defined
in the Content Dictionaries, should interpret the object as functional
application, constructor, or binding accordingly. Thus, for example,
for some applications, the <i>OpenMath</i> object corresponding to
<m:math><m:mn>2</m:mn><m:mo>+</m:mo><m:mn>5</m:mn></m:math>  may result in a command
that writes <m:math><m:mn>7</m:mn></m:math>.</p>
</div>


<h2 name="cha_enco" id="cha_enco">
  Chapter 4<br/><i>OpenMath</i> Encodings</h2>



<p>In this chapter, two encodings are defined that map between <i>OpenMath</i>
objects and byte streams.  These byte streams constitute a low level
representation that can be easily exchanged between processes (via
almost any communication method) or stored and retrieved from
files.</p>


<p class="del">The first encoding uses ISO 646:1983
characters <a href="#iso646_83">[10]</a> (also known as
<span>ascii</span> characters) and is an <span>xml</span>
application. Although the <span>xml</span> markup of the encoding uses only
<span>ascii</span> characters, <i>OpenMath</i> strings may use arbitrary
Unicode/ISO 10646:1988 characters <a href="#UNICODE">[14]</a>.
It can be used, for example, to send <i>OpenMath</i> objects via e-mail, news,
cut-and-paste, etc. The texts produced by this encoding can be part of
<span>xml</span> documents.</p>

<p class="new">The first encoding is a character-based
encoding in <span>xml</span> format.  In previous versions of the <i>OpenMath</i> Standard
this encoding was a restricted subset of the full legal <span>xml</span> syntax.
In this version, however, we have removed all these restrictions so that
the earlier encoding is a strict subset of the existing one.  The
<span>xml</span> encoding can be used, for example, to send <i>OpenMath</i> objects via
e-mail, cut-and-paste, etc. and to embed <i>OpenMath</i> objects in <span>xml</span>
documents or to have <i>OpenMath</i> objects processed by <span>xml</span>-aware
applications.</p>

<p>The second encoding is a binary encoding that is meant to be
used when the compactness of the encoding is important (interprocess
communications over a network is an example).</p>

<p>Note that these two encodings are sufficiently different for
autodetection to be effective: an application reading the bytes can
very easily determine which encoding is used.</p>

<div><h3 name="sec_xml" id="sec_xml">4.1 The <span>xml</span> Encoding</h3>


<p>This encoding has been designed with two main goals in mind:
<ol>
<li><p>to provide an encoding that uses common character sets
  (so that it can be easily included in most documents and transport
  protocols) and that is both readable and writable by a human.</p></li>
<li><p>to provide an encoding that can be included (embedded) in
  <span>xml</span> documents or processed by <span>xml</span>-aware applications.</p></li>
</ol> 
</p>

<div><h4 name="ssec_xml" id="ssec_xml">4.1.1 A <span class="del">Grammar</span><span>Schema</span> for the <span>xml</span> Encoding</h4>





<p class="new">The <span>xml</span> encoding of an <i>OpenMath</i> object is
defined by the Relax NG schema <a href="#RELAX">[11]</a> given below.
Relax NG has a number of advantages over the older XSD Schema format
<a href="#XSD">[15]</a>, in particular it allows for tighter control
of attributes and has a modular, extensible structure.  Although we
have made the <span>xml</span> form, which is given  in <a href="#app_openmath.rng">Appendix B</a> normative, it is generated from the
using the compact syntax given below.
It is also very easy to restrict the schema to allow a limited set of
<i>OpenMath</i> symbols as described in <a href="#app_relaxrestricted">Appendix C</a>.
</p>

<p class="new"> Standard tools exist for generating a DTD
or an XSD schema from a Relax NG Schema.  Examples of such documents
are given in <a href="#app_dtd">Appendix E</a> and <a href="#app_xsd">Appendix D</a>
respectively.</p>

<div class="newliteral"><pre>
<span style="color:brown;"># RELAX NG Schema for OpenMath 2</span>


<span style="font-weight:bold;">default</span> <span style="font-weight:bold;">namespace</span> <a name="rncnamespaceom" style="color:blue;">om</a> = "http://www.openmath.org/OpenMath"
<span style="font-weight:bold;">namespace</span> <a name="rncnamespacexlink" style="color:blue;">xlink</a> = "http://www.w3.org/1999/xlink"

<span style="color:brown;"># OM2: allow OMR</span>
<a name="rncomel" style="color:blue;">omel</a> = 
  <a href="#rncOMS">OMS</a> | <a href="#rncOMV">OMV</a> | <a href="#rncOMI">OMI</a> | <a href="#rncOMB">OMB</a> | <a href="#rncOMSTR">OMSTR</a> | <a href="#rncOMF">OMF</a> | <a href="#rncOMA">OMA</a> | <a href="#rncOMBIND">OMBIND</a> | <a href="#rncOME">OME</a> | <a href="#rncOMATTR">OMATTR</a> |<a href="#rncOMR">OMR</a>

<span style="color:brown;"># things which can be variables</span>
<a name="rncomvar" style="color:blue;">omvar</a> = <a href="#rncOMV">OMV</a> | <a href="#rncattvar">attvar</a>

<a name="rncattvar" style="color:blue;">attvar</a> = <span style="font-weight:bold;">element</span> OMATTR { <a href="#rnccommon.attributes">common.attributes</a>,(<a href="#rncOMATP">OMATP</a> , (<a href="#rncOMV">OMV</a> | <a href="#rncattvar">attvar</a>))}

<span style="color:brown;">#OM2: common attributes</span>
<a name="rnccdbase" style="color:blue;">cdbase</a> = <span style="font-weight:bold;">attribute</span> cdbase { <span style="font-weight:bold;">xsd:anyURI</span>}
<a name="rnccommon.attributes" style="color:blue;">common.attributes</a> = (<span style="font-weight:bold;">attribute</span> id { <span style="font-weight:bold;">xsd:ID</span> })?
<a name="rnccompound.attributes" style="color:blue;">compound.attributes</a> = <a href="#rnccommon.attributes">common.attributes</a>,<a href="#rnccdbase">cdbase</a>

<span style="color:brown;"># symbol</span>
<a name="rncOMS" style="color:blue;">OMS</a> = <span style="font-weight:bold;">element</span> OMS { <a href="#rnccommon.attributes">common.attributes</a>, <a href="#rncattlist.OMS">attlist.OMS</a>}
<a name="rncattlist.OMS" style="color:blue;">attlist.OMS</a> =
  <span style="font-weight:bold;">attribute</span> name { <span style="font-weight:bold;">xsd:NCName</span>},
  <span style="font-weight:bold;">attribute</span> cd { <span style="font-weight:bold;">xsd:NCName</span>},
  <a href="#rnccdbase">cdbase</a>

<span style="color:brown;"># variable</span>
<a name="rncOMV" style="color:blue;">OMV</a> = <span style="font-weight:bold;">element</span> OMV { <a href="#rnccommon.attributes">common.attributes</a>, <a href="#rncattlist.OMV">attlist.OMV</a>}
<a name="rncattlist.OMV" style="color:blue;">attlist.OMV</a> = <span style="font-weight:bold;">attribute</span> name { <span style="font-weight:bold;">xsd:NCName</span>}

<span style="color:brown;"># integer</span>
<a name="rncOMI" style="color:blue;">OMI</a> = <span style="font-weight:bold;">element</span> OMI { <a href="#rnccommon.attributes">common.attributes</a>, <span style="font-weight:bold;">xsd:string</span> {<span style="font-weight:bold;">pattern</span> = "\s*(-\s?)?[0-9]+(\s[0-9]+)*\s*"}}
<span style="color:brown;"># byte array</span>
<a name="rncOMB" style="color:blue;">OMB</a> = <span style="font-weight:bold;">element</span> OMB { <a href="#rnccommon.attributes">common.attributes</a>, <span style="font-weight:bold;">xsd:base64Binary</span> }

<span style="color:brown;"># string</span>
<a name="rncOMSTR" style="color:blue;">OMSTR</a> = <span style="font-weight:bold;">element</span> OMSTR { <a href="#rnccommon.attributes">common.attributes</a>, <span style="font-weight:bold;">text</span> }

<span style="color:brown;"># floating point</span>
<a name="rncOMF" style="color:blue;">OMF</a> = <span style="font-weight:bold;">element</span> OMF { <a href="#rnccommon.attributes">common.attributes</a>, <a href="#rncattlist.OMF">attlist.OMF</a>}
<a name="rncattlist.OMF" style="color:blue;">attlist.OMF</a> =
  <span style="font-weight:bold;">attribute</span> dec { <span style="font-weight:bold;">xsd:string</span> {<span style="font-weight:bold;">pattern</span> = "(-?)([0-9]+)?(\.[0-9]+)?(e([+\-]?)[0-9]+)?"}}|
  <span style="font-weight:bold;">attribute</span> hex { <span style="font-weight:bold;">xsd:string</span> {<span style="font-weight:bold;">pattern</span> = "[0-9A-F]+"}}

<span style="color:brown;"># apply constructor</span>
<a name="rncOMA" style="color:blue;">OMA</a> = <span style="font-weight:bold;">element</span> OMA { <a href="#rnccompound.attributes">compound.attributes</a>, <a href="#rncomel">omel</a>+ }
<span style="color:brown;"># binding constructor and variable</span>
<a name="rncOMBIND" style="color:blue;">OMBIND</a> = <span style="font-weight:bold;">element</span> OMBIND { <a href="#rnccompound.attributes">compound.attributes</a>, <a href="#rncomel">omel</a>, <a href="#rncOMBVAR">OMBVAR</a>, <a href="#rncomel">omel</a> }
<a name="rncOMBVAR" style="color:blue;">OMBVAR</a> = <span style="font-weight:bold;">element</span> OMBVAR { <a href="#rnccommon.attributes">common.attributes</a>, <a href="#rncomvar">omvar</a>+ }

<span style="color:brown;"># error</span>
<a name="rncOME" style="color:blue;">OME</a> = <span style="font-weight:bold;">element</span> OME { <a href="#rnccommon.attributes">common.attributes</a>, <a href="#rncOMS">OMS</a>, <a href="#rncomel*">omel*</a> }

<span style="color:brown;"># attribution constructor and attribute pair constructor</span>
<a name="rncOMATTR" style="color:blue;">OMATTR</a> = <span style="font-weight:bold;">element</span> OMATTR { <a href="#rnccompound.attributes">compound.attributes</a>, <a href="#rncOMATP">OMATP</a>, <a href="#rncomel">omel</a> }

<span style="color:brown;"># OM2: allow OMFOREIGN </span>
<a name="rncOMATP" style="color:blue;">OMATP</a> = <span style="font-weight:bold;">element</span> OMATP { <a href="#rnccompound.attributes">compound.attributes</a>, (<a href="#rncOMS">OMS</a>, (<a href="#rncomel">omel</a> | <a href="#rncOMFOREIGN">OMFOREIGN</a>) )+ }

<span style="color:brown;"># OM2: OMFOREIGN </span>
<a name="rncOMFOREIGN" style="color:blue;">OMFOREIGN</a> =  <span style="font-weight:bold;">element</span> OMFOREIGN { <a href="#rnccompound.attributes">compound.attributes</a>, (<a href="#rncomel">omel</a>|<a href="#rncnotom">notom</a>)* }

<span style="color:brown;"># Any elements not in the om namespace (valid om is allowed as a descendant)</span>
<a name="rncnotom" style="color:blue;">notom</a> =
  (<span style="font-weight:bold;">element</span> * - <a href="#rncnamespaceom">om:</a>* {<span style="font-weight:bold;">attribute</span> * { <span style="font-weight:bold;">text</span> }*,(<a href="#rncomel">omel</a>|<a href="#rncnotom">notom</a>)*}
   | <span style="font-weight:bold;">text</span>)

<span style="color:brown;"># OM object constructor</span>
<a name="rncOMOBJ" style="color:blue;">OMOBJ</a> = <span style="font-weight:bold;">element</span> OMOBJ { <a href="#rnccompound.attributes">compound.attributes</a>, <a href="#rncomel">omel</a> }
 <a name="rncattlist.OMOBJ" style="color:blue;">attlist.OMOBJ</a> = <span style="font-weight:bold;">attribute</span> version { "1.0" | "1.2" | "2.0" }


<span style="color:brown;"># OM2: OMR</span>
<a name="rncOMR" style="color:blue;">OMR</a> = <span style="font-weight:bold;">element</span> OMR { <a href="#rnccommon.attributes">common.attributes</a>, <a href="#rncattlist.OMR">attlist.OMR</a> }
<a name="rncattlist.OMR" style="color:blue;">attlist.OMR</a> = 
        <span style="font-weight:bold;">attribute</span> <a href="#rncnamespacexlink">xlink:</a>href { <span style="font-weight:bold;">text</span> },
        <span style="font-weight:bold;">attribute</span> <a href="#rncnamespacexlink">xlink:</a>type {"simple"},
        <span style="font-weight:bold;">attribute</span> <a href="#rncnamespacexlink">xlink:</a>show {"embed"}

<a name="rncstart" style="color:blue;">start</a> = <a href="#rncOMOBJ">OMOBJ</a>

</pre></div>
<p><span class="del">the <span>xml</span> encoding of an
<i>OpenMath</i> object is defined by the dtd given in Figure 4.1 below with the
following additional rules not implied by the <span>xml</span>
<span>dtd</span>.</span></p>

<ul class="del">
<li><p class="del">Comments are permitted only between
elements, not within element character data.</p></li>

<li><p class="del">Processing Instructions are
 only allowed before the <span>OMOBJ</span> element.</p></li>

<li><p class="del">The content of an
<span>OMB</span> element, is a valid base64-encoded text.</p></li>

<li><p class="del">The character data forming
element content and attribute values matches the regular expressions
of <a href="#fig_xml">para 

    Grammar for the xml encoding of OpenMath objects.







S           
 &#8594; 
 (space | tab | cr | nl)+  




integer     
 &#8594; 
 
        (- S?)? [0-9]+ (S [0-9]+)*  |
        (- S?)? x S? [0-9A-F]+ (S [0-9A-F]+)* 



 

cdname      
 &#8594; 
  [a-z][a-z0-9_]*




symbname    
 &#8594; 
 [A-Za-z][A-Za-z0-9_]*




fpdec       
 &#8594; 
  
    (-?)([0-9]+)?(.[0-9]+)?(e([+-]?)[0-9]+)?




fphex       
 &#8594; 
  [0-9ABCDEF]+ 




varname        
 &#8594; 
 ([A-Za-z0-9+=(),-./:?!#$%*;@[]^_`{|}])+ 




base64      
 &#8594; 
 ([A-Za-z0-9 +/=] | S)+ 




char  
 &#8594; 
 xml Character Data













symbnameatt
 &#8594;
 
    name S? = S? (" symbname " | ' symbname ') 




cdnameatt
 &#8594;
 cd S? = S? (" cdname " | ' cdname ') 




varnameatt
 &#8594;
 name S? = S? (" varname " | ' varname ') 




fpdecatt
 &#8594;
 dec S? = S? (" fpdec " | ' fpdec ') 




 fphexatt
  &#8594;
 hex S? = S? (" fphex " | ' fphex ') 





PI 
 &#8594;
 &lt;? char ?&gt;



comment
 &#8594;
 &lt;!-- char --&gt;




SC
&#8594;
 S+ | (comment S)+




start  
 &#8594; 
 
 (SC | PI)* &lt;OMOBJ S?&gt; S? object S? &lt;/OMOBJ S?&gt; 




symbol
 &#8594; 
 
  &lt;OMS [[(S  symbnameatt) (S cdnameatt) ]] S? /&gt;





variable
 &#8594; 
&lt;OMV  varnameatt S? /&gt;




|
 &lt;OMATTRx S?&gt; SC? omatp SC? variable SC? &lt;/OMATTR S?&gt;




omatp 
 &#8594; 
     &lt;OMATP  S?&gt; SC? attrs SC? &lt;/#1 S?&gt; 




object 
 &#8594; 
 symbol




|variable



|
&lt;OMI S &gt; S? integer S? &lt;/OMI S?&gt;




| &lt;OMF S fpdecatt  S?/&gt;




  
  | &lt;OMF S fphexatt  S?/&gt;




    
  | &lt;OMSTR  S?&gt; char &lt;/OMSTR S?&gt; 




    
  | &lt;OMB  S?&gt; base64  &lt;/OMB S?&gt; 




  
|
 &lt;OMA  S?&gt; SC? object SC? objects SC? &lt;/OMA S?&gt;




| &lt;OMBIND  S?&gt; SC? object SC? 





 &lt;OMBVAR  S?&gt; SC? variables SC? &lt;/OMBVAR S?&gt; 





 SC? object SC? &lt;/OMBIND S?&gt;




  
|
 &lt;OME  S?&gt; SC? symbol SC? objects SC? &lt;/OME S?&gt; 




  
|
 &lt;OMATTR  S?&gt; SC?  &lt;OMATP S?&gt; SC? attrs SC? &lt;/OMBVAR S?&gt;   





SC? object SC? &lt;/OMATTR S?&gt;  




attrs
 &#8594; 
 symbol S? object   




  
|
 symbol S? object S? attrs 




objects 
 &#8594; 
 SC?     




  
|
 object SC? objects  




variables 
 &#8594; 
 SC?   




  
|
 variable SC? variables  








</a>.</p></li>
</ul>



<p class="del">
    <span>DTD for the <i>OpenMath</i> <span>xml</span> encoding of objects.</span>
<div class="delliteral"><pre>
&lt;!-- DTD for OM Objects - sb 29.10.98 --&gt;
&lt;!-- sb 3.2.99 --&gt;

&lt;!--
     general list of embeddable elements
      : excludes OMATP as this is only embeddable in OMATTR
      : excludes OMBVAR as this is only embeddable in OMBIND
--&gt;

&lt;!ENTITY % omel "OMS | OMV | OMI | OMB | OMSTR
                                | OMF | OMA | OMBIND | OME
                                | OMATTR | "&gt;


&lt;!-- things which can be variables --&gt;

&lt;!ENTITY % omvar "OMV | OMATTR" &gt;



&lt;!-- symbol --&gt;
&lt;!ELEMENT OMS EMPTY&gt;

  &lt;!ATTLIST OMS 
              name CDATA #REQUIRED
              cd CDATA #REQUIRED &gt;

&lt;!-- variable --&gt;
&lt;!ELEMENT OMV EMPTY&gt;
&lt;!ATTLIST OMV  
              name CDATA #REQUIRED &gt;

&lt;!-- integer --&gt;
&lt;!ELEMENT OMI (#PCDATA) &gt;


&lt;!-- byte array --&gt;
&lt;!ELEMENT OMB (#PCDATA) &gt;


&lt;!-- string --&gt;
&lt;!ELEMENT OMSTR (#PCDATA) &gt;


&lt;!-- floating point --&gt;
&lt;!ELEMENT OMF EMPTY&gt;
&lt;!ATTLIST OMF  
              dec CDATA #IMPLIED
               hex CDATA #IMPLIED&gt;

&lt;!-- apply constructor --&gt;
&lt;!ELEMENT OMA (%omel;)+ &gt;



&lt;!-- binding constructor &amp; bound variables --&gt;
&lt;!ELEMENT OMBIND ((%omel;), OMBVAR, (%omel;)) &gt;


&lt;!ELEMENT OMBVAR (%omvar;)+ &gt;


&lt;!-- error --&gt;
&lt;!ELEMENT OME (OMS, (%omel;)* ) &gt;


&lt;!-- attribution constructor &amp; attribute pair constructor --&gt;
&lt;!ELEMENT OMATTR (OMATP, (%omel;)) &gt;


&lt;!ELEMENT OMATP (OMS, (%omel;))+ &gt;




&lt;!-- OM object constructor --&gt;
&lt;!ELEMENT OMOBJ (%omel;) &gt;
&lt;!ATTLIST OMOBJ 
	        xlmns:xlink CDATA #FIXED 'http://www.w3.org/1999/xlink'&gt;
</pre></div>
</p>


<p class="del">In addition, if the <span>xml</span> document
encoding the <i>OpenMath</i> object is linearised into the <span>xml</span> concrete
syntax, the following further constraints apply, which ensure thet the
encoding may be read by <i>OpenMath</i> applications that may not include a full
<span>xml</span> parser.</p> 




<ul class="del">
<li><p class="del">The document should use <span>utf-8</span> encoding.</p></li>
<li><p class="del">A <small><code>&lt;!DOCTYPE</code></small> declaration should not be used.</p></li>

<li><p class="del">Character references should not be used. As
<small><code>&lt;!DOCTYPE</code></small> is not used, the only entity
references that are allowed are the five predefined entity references:
<small><code>&amp;apos;</code></small> ('),
<small><code>&amp;quot;</code></small> ("),
<small><code>&amp;lt;</code></small> (&lt;),
<small><code>&amp;gt;</code></small> (&gt;),
<small><code>&amp;amp;</code></small> (&amp;).
</p></li>

<li><p class="del">The <span>xml</span> empty element form
<small><code>&lt;|#8230;/&gt;</code></small> should
always be used to encode elements such as <span>omf</span> which
are specified in the <span>dtd</span> as being
<span>empty</span>. It should never be used for elements that
may sometimes be empty, such as <span>omstr</span>.</p></li>
</ul>

<p class="del">Such a linearisation of an <span>xml</span> encoded <i>OpenMath</i> Object would
match the match the character based grammar given in <a href="#fig_xml">para 

    Grammar for the xml encoding of OpenMath objects.







S           
 &#8594; 
 (space | tab | cr | nl)+  




integer     
 &#8594; 
 
        (- S?)? [0-9]+ (S [0-9]+)*  |
        (- S?)? x S? [0-9A-F]+ (S [0-9A-F]+)* 



 

cdname      
 &#8594; 
  [a-z][a-z0-9_]*




symbname    
 &#8594; 
 [A-Za-z][A-Za-z0-9_]*




fpdec       
 &#8594; 
  
    (-?)([0-9]+)?(.[0-9]+)?(e([+-]?)[0-9]+)?




fphex       
 &#8594; 
  [0-9ABCDEF]+ 




varname        
 &#8594; 
 ([A-Za-z0-9+=(),-./:?!#$%*;@[]^_`{|}])+ 




base64      
 &#8594; 
 ([A-Za-z0-9 +/=] | S)+ 




char  
 &#8594; 
 xml Character Data













symbnameatt
 &#8594;
 
    name S? = S? (" symbname " | ' symbname ') 




cdnameatt
 &#8594;
 cd S? = S? (" cdname " | ' cdname ') 




varnameatt
 &#8594;
 name S? = S? (" varname " | ' varname ') 




fpdecatt
 &#8594;
 dec S? = S? (" fpdec " | ' fpdec ') 




 fphexatt
  &#8594;
 hex S? = S? (" fphex " | ' fphex ') 





PI 
 &#8594;
 &lt;? char ?&gt;



comment
 &#8594;
 &lt;!-- char --&gt;




SC
&#8594;
 S+ | (comment S)+




start  
 &#8594; 
 
 (SC | PI)* &lt;OMOBJ S?&gt; S? object S? &lt;/OMOBJ S?&gt; 




symbol
 &#8594; 
 
  &lt;OMS [[(S  symbnameatt) (S cdnameatt) ]] S? /&gt;





variable
 &#8594; 
&lt;OMV  varnameatt S? /&gt;




|
 &lt;OMATTRx S?&gt; SC? omatp SC? variable SC? &lt;/OMATTR S?&gt;




omatp 
 &#8594; 
     &lt;OMATP  S?&gt; SC? attrs SC? &lt;/#1 S?&gt; 




object 
 &#8594; 
 symbol




|variable



|
&lt;OMI S &gt; S? integer S? &lt;/OMI S?&gt;




| &lt;OMF S fpdecatt  S?/&gt;




  
  | &lt;OMF S fphexatt  S?/&gt;




    
  | &lt;OMSTR  S?&gt; char &lt;/OMSTR S?&gt; 




    
  | &lt;OMB  S?&gt; base64  &lt;/OMB S?&gt; 




  
|
 &lt;OMA  S?&gt; SC? object SC? objects SC? &lt;/OMA S?&gt;




| &lt;OMBIND  S?&gt; SC? object SC? 





 &lt;OMBVAR  S?&gt; SC? variables SC? &lt;/OMBVAR S?&gt; 





 SC? object SC? &lt;/OMBIND S?&gt;




  
|
 &lt;OME  S?&gt; SC? symbol SC? objects SC? &lt;/OME S?&gt; 




  
|
 &lt;OMATTR  S?&gt; SC?  &lt;OMATP S?&gt; SC? attrs SC? &lt;/OMBVAR S?&gt;   





SC? object SC? &lt;/OMATTR S?&gt;  




attrs
 &#8594; 
 symbol S? object   




  
|
 symbol S? object S? attrs 




objects 
 &#8594; 
 SC?     




  
|
 object SC? objects  




variables 
 &#8594; 
 SC?   




  
|
 variable SC? variables  








</a>.</p>

<p class="del">The notation used in this section and in
<a href="#fig_xml">para 

    Grammar for the xml encoding of OpenMath objects.







S           
 &#8594; 
 (space | tab | cr | nl)+  




integer     
 &#8594; 
 
        (- S?)? [0-9]+ (S [0-9]+)*  |
        (- S?)? x S? [0-9A-F]+ (S [0-9A-F]+)* 



 

cdname      
 &#8594; 
  [a-z][a-z0-9_]*




symbname    
 &#8594; 
 [A-Za-z][A-Za-z0-9_]*




fpdec       
 &#8594; 
  
    (-?)([0-9]+)?(.[0-9]+)?(e([+-]?)[0-9]+)?




fphex       
 &#8594; 
  [0-9ABCDEF]+ 




varname        
 &#8594; 
 ([A-Za-z0-9+=(),-./:?!#$%*;@[]^_`{|}])+ 




base64      
 &#8594; 
 ([A-Za-z0-9 +/=] | S)+ 




char  
 &#8594; 
 xml Character Data













symbnameatt
 &#8594;
 
    name S? = S? (" symbname " | ' symbname ') 




cdnameatt
 &#8594;
 cd S? = S? (" cdname " | ' cdname ') 




varnameatt
 &#8594;
 name S? = S? (" varname " | ' varname ') 




fpdecatt
 &#8594;
 dec S? = S? (" fpdec " | ' fpdec ') 




 fphexatt
  &#8594;
 hex S? = S? (" fphex " | ' fphex ') 





PI 
 &#8594;
 &lt;? char ?&gt;



comment
 &#8594;
 &lt;!-- char --&gt;




SC
&#8594;
 S+ | (comment S)+




start  
 &#8594; 
 
 (SC | PI)* &lt;OMOBJ S?&gt; S? object S? &lt;/OMOBJ S?&gt; 




symbol
 &#8594; 
 
  &lt;OMS [[(S  symbnameatt) (S cdnameatt) ]] S? /&gt;





variable
 &#8594; 
&lt;OMV  varnameatt S? /&gt;




|
 &lt;OMATTRx S?&gt; SC? omatp SC? variable SC? &lt;/OMATTR S?&gt;




omatp 
 &#8594; 
     &lt;OMATP  S?&gt; SC? attrs SC? &lt;/#1 S?&gt; 




object 
 &#8594; 
 symbol




|variable



|
&lt;OMI S &gt; S? integer S? &lt;/OMI S?&gt;




| &lt;OMF S fpdecatt  S?/&gt;




  
  | &lt;OMF S fphexatt  S?/&gt;




    
  | &lt;OMSTR  S?&gt; char &lt;/OMSTR S?&gt; 




    
  | &lt;OMB  S?&gt; base64  &lt;/OMB S?&gt; 




  
|
 &lt;OMA  S?&gt; SC? object SC? objects SC? &lt;/OMA S?&gt;




| &lt;OMBIND  S?&gt; SC? object SC? 





 &lt;OMBVAR  S?&gt; SC? variables SC? &lt;/OMBVAR S?&gt; 





 SC? object SC? &lt;/OMBIND S?&gt;




  
|
 &lt;OME  S?&gt; SC? symbol SC? objects SC? &lt;/OME S?&gt; 




  
|
 &lt;OMATTR  S?&gt; SC?  &lt;OMATP S?&gt; SC? attrs SC? &lt;/OMBVAR S?&gt;   





SC? object SC? &lt;/OMATTR S?&gt;  




attrs
 &#8594; 
 symbol S? object   




  
|
 symbol S? object S? attrs 




objects 
 &#8594; 
 SC?     




  
|
 object SC? objects  




variables 
 &#8594; 
 SC?   




  
|
 variable SC? variables  








</a> should be quite straightforward (+ meaning
<span>"one or more"</span>, ? meaning zero or one, and | meaning
<span>"or"</span>).  The start symbol of the grammar is
<span>"start"</span>, <span>"space"</span> stands for the space
character, <span>"cr"</span> for the carriage return character,
<span>"nl"</span> for the line feed character and <span>"tab"</span>
for the horizontal tabulation character.</p>


<p class="del">

    <span class="del">Grammar for the <span>xml</span> encoding of <i>OpenMath</i> objects.</span>



<table class="del">
<tr>
<td>S           </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> (space | tab | cr | nl)+  
</td>
</tr>

<tr>
<td>integer     </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> 
        (<small><code>-</code></small> S?)? [0-9]+ (S [0-9]+)*  |
        (<small><code>-</code></small> S?)? <small><code>x</code></small> S? [0-9A-F]+ (S [0-9A-F]+)* 
</td>
</tr>
<tr>
<td> 

cdname      </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td>  [a-z][a-z0-9<small><code>_</code></small>]*
</td>
</tr>

<tr>
<td>symbname    </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> [A-Za-z][A-Za-z0-9<small><code>_</code></small>]*
</td>
</tr>

<tr>
<td>fpdec       </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td>  
    (<small><code>-</code></small>?)([0-9]+)?(<small><code>.</code></small>[0-9]+)?(<small><code>e</code></small>([+-]?)[0-9]+)?
</td>
</tr>

<tr>
<td>fphex       </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td>  [0-9ABCDEF]+ 
</td>
</tr>

<tr>
<td>varname        </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> ([A-Za-z0-9+=(),-./:?!#$%*;@[]^_`{|}])+ 
</td>
</tr>

<tr>
<td>base64      </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> ([A-Za-z0-9 +/=] | S)+ 
</td>
</tr>

<tr>
<td>char  </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> <i><span>xml</span> Character Data</i>
</td>
</tr>
</table>




<table class="del">
<tr>
<td>symbnameatt</td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math></td>
<td> 
    <small><code>name</code></small> S? = S? (<small><code>"</code></small> symbname <small><code>"</code></small> <small><code>|</code></small> <small><code>'</code></small> symbname <small><code>'</code></small>) 
</td>
</tr>

<tr>
<td>cdnameatt</td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math></td>
<td> <small><code>cd</code></small> S? = S? (<small><code>"</code></small> cdname <small><code>"</code></small> <small><code>|</code></small> <small><code>'</code></small> cdname <small><code>'</code></small>) 
</td>
</tr>

<tr>
<td>varnameatt</td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math></td>
<td> <small><code>name</code></small> S? = S? (<small><code>"</code></small> varname <small><code>"</code></small> <small><code>|</code></small> <small><code>'</code></small> varname <small><code>'</code></small>) 
</td>
</tr>

<tr>
<td>fpdecatt</td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math></td>
<td> <small><code>dec</code></small> S? = S? (<small><code>"</code></small> fpdec <small><code>"</code></small> <small><code>|</code></small> <small><code>'</code></small> fpdec <small><code>'</code></small>) 
</td>
</tr>

<tr>
 <td>fphexatt</td>
 <td> <m:math><m:mo>&#8594;</m:mo></m:math></td>
 <td><small><code>hex</code></small> S? = S? (<small><code>"</code></small> fphex <small><code>"</code></small> <small><code>|</code></small> <small><code>'</code></small> fphex <small><code>'</code></small>) 
</td>
</tr>


<tr>
<td>PI </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math></td>
<td> &lt;<small><code>?</code></small> char <small><code>?</code></small><small><code>&gt;</code></small></td>
</tr>

<tr>
<td>comment</td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math></td>
<td> &lt;<small><code>!--</code></small> char <small><code>--</code></small><small><code>&gt;</code></small>
</td>
</tr>

<tr>
<td>SC</td>
<td><m:math><m:mo>&#8594;</m:mo></m:math></td>
<td> S+ <small><code>|</code></small> (comment S)+
</td>
</tr>

<tr>
<td>start  </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> 
 (SC <small><code>|</code></small> PI)* <small><code>&lt;OMOBJ</code></small> S?<small><code>&gt;</code></small> S? object S? <small><code>&lt;/OMOBJ</code></small> S?<small><code>&gt;</code></small> 
</td>
</tr>

<tr>
<td>symbol</td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> 
  <small><code>&lt;OMS</code></small> [[(S  symbnameatt) (S cdnameatt) ]] S? <small><code>/&gt;</code></small>
</td>
</tr>


<tr>
<td>variable</td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td><small><code>&lt;OMV</code></small>  varnameatt S? <small><code>/&gt;</code></small>
</td>
</tr>

<tr><td/>
<td>|</td>
<td> <small><code>&lt;OMATTRx</code></small> S?<small><code>&gt;</code></small> SC? omatp SC? variable SC? <small><code>&lt;/OMATTR</code></small> S?<small><code>&gt;</code></small>
</td>
</tr>

<tr>
<td>omatp </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td>     <small><code>&lt;OMATP</code></small>  S?<small><code>&gt;</code></small> SC? attrs SC? <small><code>&lt;/#1</code></small> S?<small><code>&gt;</code></small> 
</td>
</tr>

<tr>
<td>object </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> symbol</td>
</tr>

<tr>
<td/>
<td>|</td><td>variable</td>
</tr>

<tr><td/>
<td>|</td>
<td><small><code>&lt;OMI</code></small> S <small><code>&gt;</code></small> S? integer S? <small><code>&lt;/OMI</code></small> S?<small><code>&gt;</code></small>
</td>
</tr>

<tr><td/>
<td>|</td><td> <small><code>&lt;OMF</code></small> S fpdecatt  S?<small><code>/&gt;</code></small>
</td>
</tr>

<tr>
  <td/>
  <td>|</td><td> <small><code>&lt;OMF</code></small> S fphexatt  S?<small><code>/&gt;</code></small>
</td>
</tr>

<tr>
  <td/>  
  <td>|</td><td> <small><code>&lt;OMSTR</code></small>  S?<small><code>&gt;</code></small> char <small><code>&lt;/OMSTR</code></small> S?<small><code>&gt;</code></small> 
</td>
</tr>

<tr>
  <td/>  
  <td>|</td><td> <small><code>&lt;OMB</code></small>  S?<small><code>&gt;</code></small> base64  <small><code>&lt;/OMB</code></small> S?<small><code>&gt;</code></small> 
</td>
</tr>

<tr>
  <td/>
<td>|</td>
<td> <small><code>&lt;OMA</code></small>  S?<small><code>&gt;</code></small> SC? object SC? objects SC? <small><code>&lt;/OMA</code></small> S?<small><code>&gt;</code></small>
</td>
</tr>

<tr><td/>
<td>|</td><td> <small><code>&lt;OMBIND</code></small>  S?<small><code>&gt;</code></small> SC? object SC? 
</td>
</tr>

<tr><td/>
<td/>
<td> <small><code>&lt;OMBVAR</code></small>  S?<small><code>&gt;</code></small> SC? variables SC? <small><code>&lt;/OMBVAR</code></small> S?<small><code>&gt;</code></small> 
</td>
</tr>

<tr><td/>
<td/>
<td> SC? object SC? <small><code>&lt;/OMBIND</code></small> S?<small><code>&gt;</code></small>
</td>
</tr>

<tr>
  <td/>
<td>|</td>
<td> <small><code>&lt;OME</code></small>  S?<small><code>&gt;</code></small> SC? symbol SC? objects SC? <small><code>&lt;/OME</code></small> S?<small><code>&gt;</code></small> 
</td>
</tr>

<tr>
  <td/>
<td>|</td>
<td> <small><code>&lt;OMATTR</code></small>  S?<small><code>&gt;</code></small> SC?  <small><code>&lt;OMATP</code></small> S?<small><code>&gt;</code></small> SC? attrs SC? <small><code>&lt;/OMBVAR</code></small> S?<small><code>&gt;</code></small>   
</td>
</tr>

<tr><td/>
<td/>
<td>SC? object SC? <small><code>&lt;/OMATTR</code></small> S?<small><code>&gt;</code></small>  
</td>
</tr>

<tr>
<td>attrs</td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> symbol S? object   
</td>
</tr>

<tr>
  <td/>
<td>|</td>
<td> symbol S? object S? attrs 
</td>
</tr>

<tr>
<td>objects </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> SC?     
</td>
</tr>

<tr>
  <td/>
<td>|</td>
<td> object SC? objects  
</td>
</tr>

<tr>
<td>variables </td>
<td> <m:math><m:mo>&#8594;</m:mo></m:math>  </td>
<td> SC?   
</td>
</tr>

<tr>
  <td/>
<td>|</td>
<td> variable SC? variables  
</td>
</tr>

</table>


</p>
</div>

<div><h4 name="sec_xml-desc" id="sec_xml-desc">4.1.2 <span class="new">Informal</span> description of
the <span class="del">Grammar</span><span class="new"><span>xml</span> Encoding</span></h4>


<p>An encoded <i>OpenMath</i> object is placed inside an <small><code>OMOBJ</code></small> element.  This 
element can contain the elements (and integers) described above.
<span class="new"> It can take an optional
<small><code>version</code></small> <span>xml</span>-attribute which indicates to which
version of the <i>OpenMath</i> standard it conforms.  This would allow an older
<i>OpenMath</i> application which, for example, could not parse the full <span>xml</span>
syntax, to accept objects with version "1" or "1.1" but reject objects
with version "2".
</span></p>

<p>We briefly discuss the <span>xml</span> encoding for each type of <i>OpenMath</i> object
starting from the basic objects.</p>

<dl>
<dt>Integers</dt>
<dd>
 <p>are encoded using the
<small><code>OMI</code></small> element around the sequence of their
digits in base 10 or 16 (most significant digit first).  White space
may be inserted between the characters of the integer representation,
this will be ignored.  After ignoring white space, integers written in
base 10 match the regular expression
<small><code>-?[0-9]+</code></small>.  Integers written in base 16 match
<small><code>-?x[0-9A-F]+</code></small>.  The integer 10 can be thus
encoded as <small><code>&lt;OMI&gt; 10 &lt;/OMI&gt; </code></small> or as
<small><code>&lt;OMI&gt; xA &lt;/OMI&gt; </code></small> but neither
<small><code>&lt;OMI&gt; +10 &lt;/OMI&gt;</code></small> nor
<small><code>&lt;OMI&gt; +xA &lt;/OMI&gt;</code></small> can be used.</p>

<p>The negative integer <m:math><m:mn>-120</m:mn></m:math>  can be encoded
       as either as decimal <small><code>&lt;OMI&gt; -120
       &lt;/OMI&gt;</code></small> or as hexadecimal <small><code>&lt;OMI&gt;
       -x78 &lt;/OMI&gt;</code></small>.</p>

  
</dd>

<dt>Symbols</dt><dd><p>are encoded using
  the <small><code>OMS</code></small> element. This element has
  <span class="del">two</span>
  <span class="new">three</span>
  <span>xml</span>-attributes <small><code>cd</code></small>,
  <small><code>name</code></small><span class="new">,  and
    <small><code>cdbase</code></small></span>. The value of
  <small><code>cd</code></small> is the name of the Content Dictionary in
  which the symbol is defined and the value of
  <small><code>name</code></small> is the name of the symbol.
  <span class="new">The optional <small><code>cdbase</code></small>
    attribute is a URI that can be used to disambiguate between two  content
    dictionaries with the same name. The
  <small><code>cdbase</code></small> attribute may be used on any parent
  element, any <small><code>OMS</code></small> elements without an
  explict  <small><code>cdbase</code></small> attribute which is a
  descendent of such an element is taken to
  encode an OpenMath symbol with this CD base.</span>
<span class="del">
  The name
  of the Content Dictionary is compulsory, but a future revision of
  the <i>OpenMath</i> standard might introduce a defaulting mechanism.w
</span> For
  example:
<blockquote><p><small><code>&lt;OMS
 cd="transc" name="sin"/&gt;</code></small></p>
</blockquote>
<blockquote><p><small><code>&lt;OMS
 cdbase="http://www.openmath.org/cd" cd="transc" name="sin"/&gt;</code></small></p>
</blockquote>
  is the encoding of the symbol named <small><code>sin</code></small> in
  the Content Dictionary named <small><code>transc</code></small>,
<span class="new">which is part of the collection
maintained by the <i>OpenMath</i> Society</span>.</p>

<p class="new">The three attributes of the
  <small><code>OMS</code></small> can be used to build a URI reference for the symbol,
for use in contexts where URI-based referencing mechanisms are used. This
canonical URI reference is constructed as follows:</p>
<blockquote>
  <p><small><code>URI = cdbase-value + '/' + cd-value + '#' + name-value</code></small></p>
</blockquote>

<p class="new">For example</p>
<blockquote>
  <div class="literal"><pre>&lt;OMS name="plus" cd="arith1" cdbase="http://www.openmath.org/cd"/&gt;</pre></div>
</blockquote>
<p class="new">
  gives the URI <small><code>"http://www.openmath.org/cd/arith1#plus"</code></small>
  This would allow us to refer uniquely to an openmath symbol from a
MathML document <a href="#MathML_2000">[18]</a>.</p>
<blockquote>
  <div class="literal"><pre>
&lt;mathml:csymbol xmlns:mathml="http://www.w3.org/1998/Math/MathML/"
                definitionURL="http://www.openmath.org/cd/arith1#plus"&gt;Z&lt;/csymbol&gt;
  </pre></div>
</blockquote>
<p class="new">
Note that the role attribute described in <a href="#sec_roles">Section 3.1.4</a> is contained in the Content Dictionary and is not
part of the encoding of a symbol.</p>
</dd>

<dt>Variables</dt><dd><p>are encoded using
  the <small><code>OMV</code></small> element, with only one
  <span>xml</span>-attribute, <small><code>name</code></small>, whose value is the
  variable name. <span class="del">
The variable name is a subset of the printable
  <span>ascii</span> set of characters.  In particular, neither
  spaces nor double-quote <small><code>"</code></small> are allowed
  in variable names.</span>  For instance, the encoding of the object
  representing the variable <m:math><m:mi>x</m:mi></m:math>  is:
  <small><code>&lt;OMV name="x"/&gt;</code></small></p>

<p class="new">
For an enumerated variable the index or indices of the variable are
encoded as a child.  So for example the encoding
   of the object
  representing the variable
<m:math><m:msub><m:mi>x</m:mi><m:mrow><m:mi>i</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:msub></m:math>  is:
<div class="literal"><pre>
            &lt;OMV name="x"&gt;  
              &lt;OMA&gt;
                &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="plus"/&gt; 
                &lt;OMV name="i"/&gt;  
                &lt;OMI&gt;1&lt;/OMI&gt;
              &lt;/OMA&gt;
            &lt;/OMV&gt; 
            </pre></div>
</p>

  
</dd>

<dt>Floating-point numbers</dt><dd><p>are
  encoded using the <small><code>OMF</code></small> element that has
  either the <span>xml</span>-attribute <small><code>dec</code></small> or the
  <span>xml</span>-attribute <small><code>hex</code></small>. The two
  <span>xml</span>-attributes cannot be present simultaneously. The value of
  <small><code>dec</code></small> is the floating-point number expressed
  in base 10, using the common syntax:</p>
  
  <blockquote><p>
  <small><code>(-?)([0-9]+)?("."[0-9]+)?(e(-?)[0-9]+)?</code></small>.
  </p></blockquote>
  
  <p>The value of <small><code>hex</code></small> is the digits of the floating-point number
  expressed in base 16, with digits <small><code>0</code></small>-<small><code>9</code></small>, <small><code>A</code></small>-<small><code>F</code></small>
  (mantissa, exponent, and sign from lowest to highest bits) using a
  least significant byte ordering.  For example, <small><code>&lt;OMF
    dec="1.0e-10"/&gt;</code></small> is a valid floating-point number.</p>
  

</dd>

<dt>Character strings</dt><dd><p>are encoded using the <small><code>OMSTR</code></small> element.
  Its content is  a Unicode text <span class="del">(The default encoding 
  is <span>utf-8</span><a href="#utf8">[20]</a>, although <span>xml</span> encoded <i>OpenMath</i> may be embedded
 in a containing <span>xml</span> document that specifies alternative encoding in
  the <span>xml</span> declaration</span>. Note that as always in <span>xml</span> the
  characters <small><code>&lt;</code></small> and <small><code>&amp;</code></small>  need to be represented by the
  entity references <small><code>&amp;lt;</code></small> and
<small><code>&amp;amp;</code></small> respectively.</p>
  
</dd>

<dt>Bytearrays</dt><dd><p>are encoded using the <small><code>OMB</code></small> element. Its content
  is a sequence of characters that is a base64 encoding of the data.
  The base64 encoding is defined in <span>rfc</span> 1521 <a href="#rfc1521">[2]</a>.
  Basically, it represents an arbitrary sequence of octets using 64
  <span>"digits"</span> (<small><code>A</code></small> through <small><code>Z</code></small>, <small><code>a</code></small> through <small><code>z</code></small>, <small><code>0</code></small> through <small><code>9</code></small>, <small><code>+</code></small> and /, in order of increasing
  value). Three octets are represented as four digits (the <small><code>=</code></small>
  character for padding to the right at the end of the data). All line
  breaks and carriage return, space, form feed and horizontal
  tabulation characters are ignored. The reader is refered to
  <a href="#rfc1521">[2]</a> for more detailed information.</p>

</dd>

</dl>
 
<p>In detail the encoding of an <i>OpenMath</i> object is described below.</p>

<dl>
<dt>Applications</dt><dd><p>are encoded using the <small><code>OMA</code></small> element. The
  application whose root is the <i>OpenMath</i> object <m:math><m:msub><m:mi>e</m:mi><m:mn>0</m:mn></m:msub></m:math>  and whose arguments
  are the <i>OpenMath</i> objects <m:math><m:msub><m:mi>e</m:mi><m:mn>1</m:mn></m:msub></m:math>, <span>&#8230;</span>, <m:math><m:msub><m:mi>e</m:mi><m:mi>n</m:mi></m:msub></m:math>  is encoded as <small><code>&lt;OMA&gt;</code></small>
  <m:math><m:msub><m:mi>C</m:mi><m:mn>0</m:mn></m:msub></m:math>  <m:math><m:msub><m:mi>C</m:mi><m:mn>1</m:mn></m:msub></m:math><span>&#8230;</span> <m:math><m:msub><m:mi>C</m:mi><m:mi>n</m:mi></m:msub></m:math>  <small><code>&lt;/OMA&gt;</code></small> where <m:math><m:msub><m:mi>C</m:mi><m:mi>i</m:mi></m:msub></m:math>  is the encoding of
  <m:math><m:msub><m:mi>e</m:mi><m:mi>i</m:mi></m:msub></m:math>.</p>

<p>For example, <m:math><m:mi mathvariant="bold">application</m:mi><m:mo>(</m:mo><m:mi>sin</m:mi><m:mo>,</m:mo><m:mi>x</m:mi> <m:mo>)</m:mo></m:math>  is encoded as:
<div class="literal"><pre>
            &lt;OMA&gt;  
              &lt;OMS cdbase="http://www.openmath.org/cd" cd="transc1" name="sin"/&gt; 
              &lt;OMV name="x"/&gt;  
            &lt;/OMA&gt; 
            </pre></div>
  provided that the symbol <small><code>sin</code></small> is defined to be a function
  symbol in a Content Dictionary named <small><code>transc1</code></small>.</p>

  
</dd>

<dt>Binding</dt><dd><p>is encoded using the <small><code>OMBIND</code></small> element.  The binding
  by the <i>OpenMath</i> object <m:math><m:mi>b</m:mi></m:math>  of the <i>OpenMath</i> variables <m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub></m:math>, <m:math><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub></m:math>,
  <m:math><m:mi>&#8230;</m:mi></m:math>, <m:math><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub></m:math>  in the object <m:math><m:mi>c</m:mi></m:math>  is encoded as <small><code>&lt;OMBIND&gt;</code></small> <m:math><m:mi>B</m:mi></m:math> 
  <small><code>&lt;OMBVAR&gt;</code></small> <m:math><m:msub><m:mi>X</m:mi><m:mn>1</m:mn></m:msub></m:math>  <m:math><m:mi>&#8230;</m:mi></m:math>  <m:math><m:msub><m:mi>X</m:mi><m:mi>n</m:mi></m:msub></m:math>  <small><code>&lt;/OMBVAR&gt;</code></small> <m:math><m:mi>C</m:mi></m:math>  <small><code>&lt;/OMBIND&gt;</code></small> where <m:math><m:mi>B</m:mi></m:math>, <m:math><m:mi>C</m:mi></m:math>, and <m:math><m:msub><m:mi>X</m:mi><m:mi>i</m:mi></m:msub></m:math>  are the encodings of <m:math><m:mi>b</m:mi></m:math>, <m:math><m:mi>c</m:mi></m:math> 
  and <m:math><m:msub><m:mi>x</m:mi><m:mi>i</m:mi></m:msub></m:math>, respectively.</p>

<p>For instance the encoding of
  <m:math><m:mi mathvariant="bold">binding</m:mi>
       <m:mo>(</m:mo><m:mi>lambda</m:mi><m:mo>,</m:mo>
  <m:mi>x</m:mi><m:mo>,</m:mo><m:mi mathvariant="bold">application</m:mi>
     <m:mo>(</m:mo><m:mi>sin</m:mi><m:mo>,</m:mo> <m:mi>x</m:mi><m:mo>)</m:mo><m:mo>)</m:mo></m:math>  is:
<div class="literal"><pre> 
      &lt;OMBIND&gt;
        &lt;OMS cdbase="http://www.openmath.org/cd" cd="fns1" name="lambda"/&gt;  
        &lt;OMBVAR&gt;
          &lt;OMV name="x"/&gt;
        &lt;/OMBVAR&gt;  
        &lt;OMA&gt;
          &lt;OMS cdbase="http://www.openmath.org/cd" cd="transc1" name="sin"/&gt; 
          &lt;OMV name="x"/&gt;  
        &lt;/OMA&gt;
      &lt;/OMBIND&gt;</pre></div></p>
  
<p>Binders are defined in  Content Dictionaries, in particular,
  the symbol <small><code>lambda</code></small> is defined in the Content Dictionary
  <small><code>fns1</code></small> for functions over functions.</p>
  
</dd>

<dt>Attributions</dt><dd><p>are encoded using the <small><code>OMATTR</code></small> element.  If
  the <i>OpenMath</i> object <m:math><m:mi>e</m:mi></m:math>  is attributed with (<m:math><m:msub><m:mi>s</m:mi><m:mn>1</m:mn></m:msub></m:math>, <m:math><m:msub><m:mi>e</m:mi><m:mn>1</m:mn></m:msub></m:math>), <span>&#8230;</span>, 
  (<m:math><m:msub><m:mi>s</m:mi><m:mi>n</m:mi></m:msub></m:math>, <m:math><m:msub><m:mi>e</m:mi><m:mi>n</m:mi></m:msub></m:math>) pairs (where <m:math><m:msub><m:mi>s</m:mi><m:mi>i</m:mi></m:msub></m:math>  are the attributes), it is encoded
  as <small><code>&lt;OMATTR&gt;</code></small> <small><code>&lt;OMATP&gt;</code></small> <m:math><m:msub><m:mi>S</m:mi><m:mn>1</m:mn></m:msub></m:math>  <m:math><m:msub><m:mi>C</m:mi><m:mn>1</m:mn></m:msub></m:math>  <span>&#8230;</span> <m:math><m:msub><m:mi>S</m:mi><m:mi>n</m:mi></m:msub></m:math>  <m:math><m:msub><m:mi>C</m:mi><m:mi>n</m:mi></m:msub></m:math>  <small><code>&lt;/OMATP&gt;</code></small> <m:math><m:mi>E</m:mi></m:math>  <small><code>&lt;/OMATTR&gt;</code></small> where <m:math><m:msub><m:mi>S</m:mi><m:mi>i</m:mi></m:msub></m:math>  is the encoding of the
  symbol <m:math><m:msub><m:mi>s</m:mi><m:mi>i</m:mi></m:msub></m:math>, <m:math><m:msub><m:mi>C</m:mi><m:mi>i</m:mi></m:msub></m:math>  of the object <m:math><m:msub><m:mi>e</m:mi><m:mi>i</m:mi></m:msub></m:math>  and <m:math><m:mi>E</m:mi></m:math>  is the encoding of
  <m:math><m:mi>e</m:mi></m:math>.</p>

<p>Examples are the use of attribution to decorate a group by its
  automorphism group:
<div class="literal"><pre>
          &lt;OMATTR&gt;    
             &lt;OMATP&gt;
                  &lt;OMS cdbase="http://www.openmath.org/cd" cd="groups" name="automorphism_group" /&gt;  
                  [..group-encoding..] 
             &lt;/OMATP&gt;  
             [..group-encoding..] 
          &lt;/OMATTR&gt;</pre></div>
or to express the type of a variable:
<div class="literal"><pre> 
          &lt;OMATTR&gt;    
             &lt;OMATP&gt;
                  &lt;OMS cdbase="http://www.openmath.org/cd" cd="ecc" name="type" /&gt; 
                  &lt;OMS cdbase="http://www.openmath.org/cd" cd="ecc" name="real" /&gt;
             &lt;/OMATP&gt; 
             &lt;OMV name="x" /&gt;
           &lt;/OMATTR&gt;</pre></div></p>

  
<p class="new">
A special use of attributions is to associate non-<i>OpenMath</i> data with an
<i>OpenMath</i> object.  This is done using the
<small><code>OMFOREIGN</code></small> element.  The children of this
element must be well-formed <span>xml</span>.  For example the attribution of the
<i>OpenMath</i> object 
  <m:math>
     <m:mi>sin</m:mi><m:mfenced><m:mi>x</m:mi></m:mfenced></m:math>  with its
representation in Presentation MathML is:
<div class="literal"><pre> 
      &lt;OMATTR&gt;
        &lt;OMATP&gt;
          &lt;OMS cd="presentation1" name="mathml"/&gt;  
          &lt;OMFOREIGN&gt;
            &lt;math xmlns="http://www.w3.org/1998/Math/MathML"&gt;
              &lt;mi&gt;sin&lt;/mi&gt;&lt;mfenced&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;/mfenced&gt;
            &lt;/math&gt;
          &lt;/OMFOREIGN&gt;  
        &lt;/OMATP&gt;
        &lt;OMA&gt;
          &lt;OMS cdbase="http://www.openmath.org/cd" cd="transc1" name="sin"/&gt; 
          &lt;OMV name="x"/&gt;  
        &lt;/OMA&gt;
      &lt;/OMATTR&gt;</pre></div>
Of course not everything has a natural XML encoding in this way and
often the contents of a <small><code>OMFOREIGN</code></small> will just
be data or some kind of encoded string.  For example the attribution
of the previous object with its LaTeX representation could be achieved
as follows:
<div class="literal"><pre> 
      &lt;OMATTR&gt;
        &lt;OMATP&gt;
          &lt;OMS cd="presentation1" name="latex"/&gt;  
          &lt;OMFOREIGN&gt;
            sin\,(x)
          &lt;/OMFOREIGN&gt;  
        &lt;/OMATP&gt;
        &lt;OMA&gt;
          &lt;OMS cdbase="http://www.openmath.org/cd" cd="transc1" name="sin"/&gt; 
          &lt;OMV name="x"/&gt;  
        &lt;/OMA&gt;
      &lt;/OMATTR&gt;</pre></div>
</p>
</dd>




 <dt>Errors</dt> 
 <dd><p>are encoded using the <small><code>OME</code></small> element. The error whose
  symbol is <m:math><m:mi>s</m:mi></m:math>  and whose arguments are the <i>OpenMath</i> objects <m:math><m:msub><m:mi>e</m:mi><m:mn>1</m:mn></m:msub></m:math>,
  <span>&#8230;</span>, <m:math><m:msub><m:mi>e</m:mi><m:mi>n</m:mi></m:msub></m:math>  is encoded as <small><code>&lt;OME&gt;</code></small> <m:math><m:msub><m:mi>C</m:mi><m:mi>s</m:mi></m:msub></m:math>  <m:math><m:msub><m:mi>C</m:mi><m:mn>1</m:mn></m:msub></m:math><span>&#8230;</span> <m:math><m:msub><m:mi>C</m:mi><m:mi>n</m:mi></m:msub></m:math>  <small><code>&lt;/OME&gt;</code></small> where <m:math><m:msub><m:mi>C</m:mi><m:mi>s</m:mi></m:msub></m:math>  is the encoding of <m:math><m:mi>s</m:mi></m:math>  and <m:math><m:msub><m:mi>C</m:mi><m:mi>i</m:mi></m:msub></m:math>  the encoding
  of <m:math><m:msub><m:mi>e</m:mi><m:mi>i</m:mi></m:msub></m:math>.</p>

<p>If an <small><code>aritherror</code></small> Content Dictionary contained a
  <small><code>DivisionByZero</code></small> symbol, then the object
  <m:math><m:mi mathvariant="bold">error</m:mi><m:mo>(</m:mo><m:mi>DivisionByZero</m:mi><m:mo>,</m:mo> <m:mi mathvariant="bold">application</m:mi>
  <m:mo>(</m:mo><m:mi>divide</m:mi><m:mo>,</m:mo> 
  <m:mi>x</m:mi><m:mo>,</m:mo> <m:mn>0</m:mn><m:mo>)</m:mo><m:mo>)</m:mo></m:math>  would be encoded as follows:

<div class="literal"><pre> 
            &lt;OME&gt;
            &lt;OMS cdbase="http://www.openmath.org/cd" cd="aritherror" name="DivisionByZero"/&gt;  
            &lt;OMA&gt;
                 &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="divide" /&gt;
                 &lt;OMV name="x"/&gt;  
                 &lt;OMI&gt; 0 &lt;/OMI&gt;
            &lt;/OMA&gt; 
            &lt;/OME&gt;</pre></div></p>
  
</dd>



 <dt class="new">References</dt>
 <dd class="new"><p>
 <i>OpenMath</i> integers, floating point numbers, character strings,
 byearrays, applications, binding, attributions can also be encoded
 as an empty <small><code>OMR</code></small> element with an <small><code>xlink:href</code></small>
 attribute whose value is the value of an id attribute of an <i>OpenMath</i> object of
 that type. The <i>OpenMath</i> element represented by this <small><code>OMR</code></small>
 element is a copy of the <i>OpenMath</i> element pointed to in the
 <small><code>xlink:xref</code></small> attribute. Note that the representation of the
 <small><code>OMR</code></small>
 element is <i>structurally equal</i>, but not identical
 to the element it points to. </p>

 <p>For instance, the <i>OpenMath</i> object

 <m:math display="block">
   <m:mrow>
     <m:mi mathvariant="bold">application</m:mi>
     <m:mrow>
       <m:mo fence="true">(</m:mo>
       <m:mrow>
         <m:mi>f</m:mi>
         <m:mo separator="true">,</m:mo>
         <m:mi mathvariant="bold">application</m:mi>
         <m:mrow>
           <m:mo fence="true">(</m:mo>
           <m:mrow>
             <m:mi>f</m:mi>
             <m:mo separator="true">,</m:mo>
             <m:mi mathvariant="bold">application</m:mi>
             <m:mrow>
               <m:mo fence="true">(</m:mo>
               <m:mrow><m:mi>f</m:mi><m:mo separator="true">,</m:mo><m:mi>a</m:mi><m:mo separator="true">,</m:mo><m:mi>a</m:mi></m:mrow>
               <m:mo fence="true">)</m:mo>
             </m:mrow>
             <m:mo separator="true">,</m:mo>
             <m:mi mathvariant="bold">application</m:mi>
             <m:mrow>
               <m:mo fence="true">(</m:mo>
               <m:mrow><m:mi>f</m:mi><m:mo separator="true">,</m:mo><m:mi>a</m:mi><m:mo separator="true">,</m:mo><m:mi>a</m:mi></m:mrow>
               <m:mo fence="true">)</m:mo>
             </m:mrow>
             <m:mo fence="true">)</m:mo>
           </m:mrow>
           <m:mo separator="true">,</m:mo>
           <m:mi mathvariant="bold">application</m:mi>
           <m:mrow>
             <m:mo fence="true">(</m:mo>
             <m:mrow>
               <m:mi>f</m:mi>
               <m:mo separator="true">,</m:mo>
               <m:mi mathvariant="bold">application</m:mi>
               <m:mrow>
                 <m:mo fence="true">(</m:mo>
                 <m:mrow><m:mi>f</m:mi><m:mo separator="true">,</m:mo><m:mi>a</m:mi><m:mo separator="true">,</m:mo><m:mi>a</m:mi></m:mrow>
                 <m:mo fence="true">)</m:mo>
               </m:mrow>
               <m:mo separator="true">,</m:mo>
               <m:mi mathvariant="bold">application</m:mi>
               <m:mrow>
                 <m:mo fence="true">(</m:mo>
                 <m:mrow><m:mi>f</m:mi><m:mo separator="true">,</m:mo><m:mi>a</m:mi><m:mo separator="true">,</m:mo><m:mi>a</m:mi></m:mrow>
                 <m:mo fence="true">)</m:mo>
               </m:mrow>
               <m:mo fence="true">)</m:mo>
             </m:mrow>
           </m:mrow>
           <m:mo fence="true">)</m:mo>
         </m:mrow>
       </m:mrow>
     </m:mrow>
   </m:mrow>
 </m:math>
</p>
<p>can be encoded in the <span>xml</span> encoding as either one of the <span>xml</span> encodings
below (and some intermedidate versions as well).</p>

<div class="figure"><a name="fig_shared_vs_unshared" id="fig_shared_vs_unshared"/>
    
    
 <div class="literal"><pre>
 &lt;OMOBJ&gt;                                &lt;OMOBJ&gt;
  &lt;OMA&gt;                                   &lt;OMA&gt;
    &lt;OMA&gt;                                    &lt;OMA id="t1"&gt;
      &lt;OMV name="f"/&gt;                           &lt;OMV name="f"/&gt;
      &lt;OMA&gt;                                     &lt;OMA id="t11"&gt;
        &lt;OMV name="f"/&gt;                            &lt;OMV name="f"/&gt;
        &lt;OMV name="a"/&gt;                            &lt;OMV name="a"/&gt;
        &lt;OMV name="a"/&gt;                            &lt;OMV name="a"/&gt;
      &lt;/OMA&gt;                                    &lt;/OMA&gt;
      &lt;OMA&gt;                                     &lt;OMR xlink:href="t11"/&gt;
        &lt;OMV name="f"/&gt;
        &lt;OMV name="a"/&gt; 
        &lt;OMV name="a"/&gt;
      &lt;/OMA&gt;                                   &lt;/OMA&gt;
      &lt;OMA&gt;                                     &lt;OMR xlink:href="t1"/&gt;
        &lt;OMV name="f"/&gt;
        &lt;OMA&gt;
          &lt;OMV name="f"/&gt;
          &lt;OMV name="a"/&gt;
          &lt;OMV name="a"/&gt;
        &lt;/OMA&gt;
        &lt;OMA&gt;
          &lt;OMV name="f"/&gt;
          &lt;OMV name="a"/&gt;
          &lt;OMV name="a"/&gt;
        &lt;/OMA&gt;
      &lt;/OMA&gt;
     &lt;/OMA&gt;
   &lt;/OMA&gt;
 &lt;/OMOBJ&gt;                                 &lt;/OMOBJ&gt;
</pre></div>
<div>
  Figure 4.1 Shared vs. unshared representations</div></div>

<p>We say that an <i>OpenMath</i> element dominates all its children and all elements
they dominate. An <small><code>OMR</code></small> element dominates its target,
i.e. the element that carries the <small><code>id</code></small> attribute pointed to
by the <small><code>xref</code></small> attribute. For instance in the representation
in Figure <a href="#fig_shared_vs_unshared">Figure 4.1</a>, the
<small><code>OMA</code></small> element with <small><code>id="t1"</code></small> and
also the second <small><code>OMR</code></small> dominate the
<small><code>OMA</code></small> element with <small><code>id="t11"</code></small>.
</p> </dd>  </dl>

<div class="new"><h5 name="sec_acyclicity" id="sec_acyclicity">4.1.2.1 An Acyclicity Constraint</h5>


<p class="new">The occurrences of the <small><code>OMR</code></small> element must obey the following global
<i>acyclicity constraint</i>: An <i>OpenMath</i> element may not dominate itself.</p>

<p class="new">Consider for instance the following (illegal) <span>xml</span> representation
<div class="literal"><pre>
&lt;OMOBJ&gt;
  &lt;OMA id="foo"&gt;
    &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="divide"/&gt;
    &lt;OMI&gt;1&lt;/OMI&gt;
    &lt;OMA&gt;
       &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="plus"/&gt;
       &lt;OMI&gt;1&lt;/OMI&gt;
       &lt;OMR xref="foo"/&gt;
    &lt;/OMA&gt; 
  &lt;/OMA&gt;
&lt;/OMOBJ&gt;
</pre></div>
</p>

<p class="new">Here, the <small><code>OMA</code></small> element with
<small><code>id="foo"</code></small> dominates its second child, which dominates the
<small><code>OMR</code></small> element, which dominates its target: the element with
<small><code>id="foo"</code></small>. So by transitivity, this element dominates itself, and
by the acyclicity constraint, it is not the <span>xml</span> representation of an <i>OpenMath</i>
element. Even though it could be given the interpretation of the continued fraction
<m:math display="block">
 <m:mfrac>
   <m:mn>1</m:mn>
   <m:mrow>
     <m:mn>1</m:mn>
     <m:mo>+</m:mo>
     <m:mfrac>
       <m:mn>1</m:mn>
       <m:mrow>
	 <m:mn>1</m:mn>
	 <m:mo>+</m:mo>
	 <m:mfrac><m:mn>1</m:mn><m:mi>...</m:mi></m:mfrac>
       </m:mrow>
     </m:mfrac>
   </m:mrow>
 </m:mfrac>
</m:math> this would correspond to an infinite tree of applications,
which is not admitted by the structure of <i>OpenMath</i> objects described
in section 3.</p>

<p class="new">Note that the acyclicity constraints is not restricted to such simple
cases, as the following example shows.</p>

<p><div class="literal"><pre>
&lt;OMOBJ&gt;                                &lt;OMOBJ&gt;
  &lt;OMA id="bar"&gt;                         &lt;OMA id="baz"&gt;
    &lt;OMS cd="arith1" name="plus"/&gt;         &lt;OMS cd="arith1" name="plus"/&gt;
    &lt;OMI&gt;1&lt;/OMI&gt;                           &lt;OMI&gt;1&lt;/OMI&gt;
    &lt;OMR xref="baz"/&gt;                      &lt;OMR xref="bar"/&gt;
  &lt;/OMA&gt;                                 &lt;/OMA&gt;
&lt;/OMOBJ&gt;                               &lt;/OMOBJ&gt;
</pre></div></p>

<p class="new"> Here, the <small><code>OMA</code></small> with
<small><code>id="bar"</code></small> dominates its second child, the
<small><code>OMR</code></small> with <small><code>xref="baz"</code></small>,
which dominates its target <small><code>OMA</code></small> with
<small><code>id="baz"</code></small>, which in turn dominates its second
child, the <small><code>OMR</code></small> with
<small><code>xref="bar"</code></small>, this finally dominates its
target, the original <small><code>OMA</code></small> element with
<small><code>id="bar"</code></small>. So this pair of <i>OpenMath</i> objects
violates the acyclicity constraint and is not the <span>xml</span>
representation of an <i>OpenMath</i> object.</p>
</div>


<div class="new"><h5 name="sec_sharing_bvars" id="sec_sharing_bvars">4.1.2.2 Sharing and Bound Variables</h5>


<p>Note that the <small><code>OMR</code></small> element is a
<i>syntactic</i> referencing mechanism: an
<small><code>OMR</code></small> element stands for the exact <span>xml</span>
element it points to. In particular, referencing does not interact
with binding in a semantically intuitive way, since it allows for
variable capture. Consider for instance the following <span>xml</span>
representation: <div class="literal"><pre>
&lt;OMBIND id="outer"&gt;
  &lt;OMS cdbase="http://www.openmath.org/cd" cd="fns1" name="lambda"/&gt;
  &lt;OMBVAR&gt;&lt;OMV name="X"/&gt;&lt;/OMBVAR&gt;
  &lt;OMA&gt;
    &lt;OMV name="f"/&gt;
    &lt;OMBIND id="inner"&gt;
      &lt;OMS cdbase="http://www.openmath.org/cd" cd="fns1" name="lambda"/&gt;
      &lt;OMBVAR&gt;&lt;OMV name="X"/&gt;&lt;/OMBVAR&gt;
      &lt;OMR id="copy" xlink:href="orig"/&gt;
    &lt;/OMBIND&gt;
    &lt;OMA id="orig"&gt;&lt;OMV name="g"/&gt;&lt;OMV name="X"/&gt;&lt;/OMA&gt;
  &lt;/OMA&gt;
&lt;/OMBIND&gt;
</pre></div>
it represents the <i>OpenMath</i> object
<m:math display="block">
  <m:mi mathvariant="bold">binding</m:mi>
  <m:mrow>
    <m:mo fence="true">(</m:mo>
    <m:mo>&#955;</m:mo>
      <m:mo separator="true">,</m:mo>
    <m:mi>X</m:mi>
    <m:mo separator="true">,</m:mo>
    <m:mrow>
      <m:mi mathvariant="bold">application</m:mi>
      <m:mo fence="true">(</m:mo>
      <m:mi>f</m:mi>
      <m:mo separator="true">,</m:mo>
      <m:mi mathvariant="bold">binding</m:mi>
      <m:mrow>
	<m:mo fence="true">(</m:mo>
	<m:mo>&#955;</m:mo>
	<m:mo separator="true">,</m:mo>
	<m:mi>X</m:mi>
	<m:mo separator="true">,</m:mo>
	<m:mrow>
	  <m:mi mathvariant="bold">application</m:mi>
	  <m:mo fence="true">(</m:mo>
	  <m:mi>g</m:mi>
	  <m:mo separator="true">,</m:mo>
	  <m:mi>X</m:mi>
	  <m:mo fence="true">)</m:mo>
	</m:mrow>
	<m:mo fence="true">)</m:mo>
      </m:mrow>
      <m:mo separator="true">,</m:mo>
      <m:mrow>
	<m:mi mathvariant="bold">application</m:mi>
	<m:mo fence="true">(</m:mo>
	<m:mi>g</m:mi>
	<m:mo separator="true">,</m:mo>
	<m:mi>X</m:mi>
	<m:mo fence="true">)</m:mo>
      </m:mrow>
      <m:mo fence="true">)</m:mo>
    </m:mrow>
    <m:mo fence="true">)</m:mo>
  </m:mrow>
  <m:mo fence="true">)</m:mo> </m:math> which has two subterms of the form
<m:math>
  <m:mi mathvariant="bold">application</m:mi>
  <m:mo fence="true">(</m:mo>
  <m:mi>g</m:mi>
  <m:mo separator="true">,</m:mo>
  <m:mi>X</m:mi>
  <m:mo fence="true">)
  </m:mo> </m:math>, one with <small><code>id="orig"</code></small> (the one explicitly
represented) and one with <small><code>id="copy"</code></small>, represented by the
<small><code>OMR</code></small> element. In the original, the variable
<m:math><m:mi>X</m:mi></m:math>  is bound by the <i>outer</i>
<small><code>OMBIND</code></small> element, and in the copy, the variable
<m:math><m:mi>X</m:mi></m:math>  is bound by the <i>inner</i>
<small><code>OMBIND</code></small> element. We say that the inner
<small><code>OMBIND</code></small> has captured the variable <m:math><m:mi>X</m:mi></m:math>.
</p>

<p>It is well-known that variable capture does not conserve semantics. For
  instance, we could use <m:math><m:mi>&#945;</m:mi></m:math>-conversion to rename the inner occurrence of
  <m:math><m:mi>x</m:mi></m:math>  into - say - 
  <m:math><m:mi>y</m:mi></m:math>  arriving at the (same) object
<m:math display="block">
  <m:mi mathvariant="bold">binding</m:mi>
  <m:mrow>
    <m:mo fence="true">(</m:mo>
    <m:mo>&#955;</m:mo>
      <m:mo separator="true">,</m:mo>
    <m:mi>X</m:mi>
    <m:mo separator="true">,</m:mo>
    <m:mrow>
      <m:mi mathvariant="bold">application</m:mi>
      <m:mo fence="true">(</m:mo>
      <m:mi>f</m:mi>
      <m:mo separator="true">,</m:mo>
      <m:mi mathvariant="bold">binding</m:mi>
      <m:mrow>
	<m:mo fence="true">(</m:mo>
	<m:mo>&#955;</m:mo>
	<m:mo separator="true">,</m:mo>
	<m:mi mathcolor="red">Y</m:mi>
	<m:mo separator="true">,</m:mo>
	<m:mrow>
	  <m:mi mathvariant="bold">application</m:mi>
	  <m:mo fence="true">(</m:mo>
	  <m:mi>g</m:mi>
	  <m:mo separator="true">,</m:mo>
	  <m:mi mathcolor="red">Y</m:mi>
	  <m:mo fence="true">)</m:mo>
	</m:mrow>
	<m:mo fence="true">)</m:mo>
      </m:mrow>
      <m:mo separator="true">,</m:mo>
      <m:mrow>
	<m:mi mathvariant="bold">application</m:mi>
	<m:mo fence="true">(</m:mo>
	<m:mi>g</m:mi>
	<m:mo separator="true">,</m:mo>
	<m:mi>X</m:mi>
	<m:mo fence="true">)</m:mo>
      </m:mrow>
      <m:mo fence="true">)</m:mo>
    </m:mrow>
    <m:mo fence="true">)</m:mo>
  </m:mrow>
  <m:mo fence="true">)</m:mo> </m:math>
 Using references that
capture variables in this way can easily lead to representation errors, and is not
  recommended.
</p>
</div>
</div>

<div><h4 name="xmldoc" id="xmldoc">4.1.3 Embedding <i>OpenMath</i> in <span>xml</span> Documents</h4>


     
<p>The above encoding of <span>xml</span> encoded <i>OpenMath</i> specifies the grammar to be
used in files that encode a single <i>OpenMath</i> object, and specifies the
character streams that a conforming <i>OpenMath</i> application should be able
to accept or produce.</p>

<p>When embedding <span>xml</span> encoded <i>OpenMath</i> objects into a larger <span>xml</span> document
one may wish, or need, to use other <span>xml</span> features. For example use of
extra <span>xml</span> attributes to specify <span>xml</span> Namespaces <a href="#xmlns">[16]</a>
or xml:lang attributes to specify the language used in strings <a href="#xml">[17]</a>.
<span class="del">
Also, the encoding used in the larger document may not be
<span>utf-8</span>.</span>
</p>

 <p class="del">In particular, if <i>OpenMath</i> is used with applications that use the
<span>xml</span> Namespace Recommendation  <a href="#xmlns">[16]</a> then they should ensure
that <i>OpenMath</i> elements are in the <span class="new">namespace
</span> <code>http://www.openmath.org/OpenMath</code>.
This is most conveniently achieved by adding the namespace declaration <div class="literal"><pre>
xmlns="http://www.openmath.org/OpenMath" </pre></div> as an attribute to each
<small><code>OMOBJ</code></small> element in the document.</p>



<p>If such <span>xml</span> features are used then the <span>xml</span> application controlling the
document must, if passing the <i>OpenMath</i> fragment to an <i>OpenMath</i> application,
remove any such extra attributes and must ensure that the
fragment is encoded according to the grammar specified above.</p>
</div>
</div>

<div><h3 name="sec_binary" id="sec_binary">4.2 The Binary Encoding</h3>


<p>The binary encoding was essentially designed to be more compact than
the <span>xml</span> encodings, so that it can be more efficient if large
amounts of data are involved. For the current encoding, we tried to
keep the right balance between compactness, speed of encoding and
decoding and simplicity (to allow a simple specification and easy
implementations).</p>

<div><h4 name="sec_binary_grammar" id="sec_binary_grammar">4.2.1 A Grammar for the Binary Encoding</h4>


     

<div class="figure"><a name="fig_bin-enc" id="fig_bin-enc"/>
    
    
    <table>
	  <tr>
	    <td>start </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [24] object [25] </td>
	    <td class="new">|</td>
	    <td class="new"> [24+64] object [25]</td>
	  </tr>
	  
	  <tr>
	    <td>object </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> integer </td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> float</td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> variable</td>
	  </tr>
	  
	  <tr class="new">
	    <td/>
	    <td>|</td>
	    <td> indexed_variable</td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> symbol</td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> string</td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> bytearray</td>
	  </tr>
	  
	  <tr class="new">
	    <td/>
	    <td>|</td>
	    <td> derived</td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> construct</td>
	  </tr>
	  
	  <tr class="new">
	    <td/>
	    <td>|</td>
	    <td>internal_reference</td>
	  </tr>
	  
	  <tr class="new">
	    <td/>
	    <td>|</td>
	    <td>external_reference</td>
	  </tr>
	  
	  <tr>
	    <td>integer </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [1] [_] </td>
	    <td class="new">|</td>
	    <td class="new"> [1+64]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      id:<m:math><m:mi>n</m:mi></m:math> 
	      [_]
	    </td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [1+128] {_} </td>
	    <td class="new">|</td>
	    <td class="new"> [1+64+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      id:<m:math><m:mi>n</m:mi></m:math> 
	      {_}
	    </td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [2]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      [_] digits:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [2+64]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      [<m:math><m:mi>m</m:mi></m:math>]
	      [_] digits:<m:math><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>m</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [2+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      [_] digits:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [2+64+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      {<m:math><m:mi>n</m:mi></m:math>}
	      [_]
	      digits:<m:math><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr>
	    <td>float </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [3] {_}{_} </td>
	    <td class="new">|</td>
	    <td class="new"> [3+64]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      id:<m:math><m:mi>n</m:mi></m:math> 
	      {_}{_}</td>
	  </tr>
	  
	  <tr>
	    <td>variable </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [5]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      varname:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [5+64]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      [<m:math><m:mi>m</m:mi></m:math>]
	      varname:<m:math><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>m</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [5+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      varname:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	    <td>|</td>
	    <td class="new"> [5+64+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      {<m:math><m:mi>m</m:mi></m:math>}
	      varname:<m:math><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>m</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr class="new">
	    <td>indexed_variable</td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [10]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      varname:<m:math><m:mi>n</m:mi></m:math> 
	      object [11]
	    </td>
	    <td><m:math><m:mo>|</m:mo></m:math></td>
	    <td> [10+64]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      [<m:math><m:mi>m</m:mi></m:math>]
	      varname:<m:math><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>m</m:mi></m:math> 
	      object [11]
	    </td>
	  </tr>
	  
	  
	  <tr class="new">
	    <td/>
	    <td><m:math><m:mo>|</m:mo></m:math></td>
	    <td> [10+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      varname:<m:math><m:mi>n</m:mi></m:math> 
	      object [11]
	    </td>
	    <td><m:math><m:mo>|</m:mo></m:math></td>
	    <td> [10+64+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      {<m:math><m:mi>m</m:mi></m:math>}
	      varname:<m:math><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>m</m:mi></m:math> 
	      object [11]
	    </td>
	  </tr>
	  
	  <tr>
	    <td>symbol</td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [8]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      [<m:math><m:mi>m</m:mi></m:math>]
	      cdname:<m:math><m:mi>n</m:mi></m:math> 
	      symbname:<m:math><m:mi>m</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [8+64]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      [<m:math><m:mi>m</m:mi></m:math>]
	      [<m:math><m:mi>k</m:mi></m:math>]
	      cdname:<m:math><m:mi>n</m:mi></m:math> 
	      symbname:<m:math><m:mi>m</m:mi></m:math> 
	      id:<m:math><m:mi>k</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [8+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      {<m:math><m:mi>m</m:mi></m:math>}
	      cdname:<m:math><m:mi>n</m:mi></m:math> 
	      symbname:<m:math><m:mi>m</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [8+64+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      {<m:math><m:mi>m</m:mi></m:math>}
	      {<m:math><m:mi>k</m:mi></m:math>}
	      cdname:<m:math><m:mi>n</m:mi></m:math> 
	      symbname:<m:math><m:mi>m</m:mi></m:math> 
	      id:<m:math><m:mi>k</m:mi></m:math></td>
	  </tr>
	  
	  <tr class="new">
	    <td/>
	    <td>|</td>
	    <td> [9]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      [<m:math><m:mi>m</m:mi></m:math>]
	      [<m:math><m:mi>k</m:mi></m:math>]
	      cdname:<m:math><m:mi>n</m:mi></m:math> 
	      symbname:<m:math><m:mi>m</m:mi></m:math> 
	      uri:<m:math><m:mi>k</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [9+64]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      [<m:math><m:mi>m</m:mi></m:math>]
	      [<m:math><m:mi>k</m:mi></m:math>]
	      [<m:math><m:mi>l</m:mi></m:math>]
	      cdname:<m:math><m:mi>n</m:mi></m:math> 
	      symbname:<m:math><m:mi>m</m:mi></m:math> 
	      uri:<m:math><m:mi>k</m:mi></m:math> 
	      id:<m:math><m:mi>l</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr class="new">
	    <td/>
	    <td>|</td>
	    <td> [9+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      {<m:math><m:mi>m</m:mi></m:math>}
	      {<m:math><m:mi>k</m:mi></m:math>}
	      cdname:<m:math><m:mi>n</m:mi></m:math> 
	      symbname:<m:math><m:mi>m</m:mi></m:math> 
	      uri:<m:math><m:mi>k</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [9+64+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      {<m:math><m:mi>m</m:mi></m:math>}
	      {<m:math><m:mi>k</m:mi></m:math>}
	      {<m:math><m:mi>l</m:mi></m:math>}
	      cdname:<m:math><m:mi>n</m:mi></m:math> 
	      symbname:<m:math><m:mi>m</m:mi></m:math> 
	      uri:<m:math><m:mi>k</m:mi></m:math> 
	    id:<m:math><m:mi>l</m:mi></m:math></td>
	  </tr>
	  
	  <tr>
	    <td>string </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [6]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      <span class="del">chars</span>
	      <span class="new">bytes</span>:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [6+64]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      <span class="del">chars</span>
	      <span class="new">bytes</span>:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [6+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      <span class="del">chars</span>
	      <span class="new">bytes</span>:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [6+64+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      {<m:math><m:mi>m</m:mi></m:math>}
	      <span class="del">chars</span>
	      <span class="new">bytes</span>:<m:math><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>m</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [7]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      <span class="del">chars</span>
	      <span class="new">bytes</span>:<m:math><m:mn>2</m:mn><m:mi>n</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [7+64]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      [<m:math><m:mi>m</m:mi></m:math>]
	      <span class="del">chars</span>
	      <span class="new">bytes</span>:<m:math><m:mn/><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>m</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [7+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      <span class="del">chars</span>
	      <span class="new">bytes</span>:<m:math><m:mn>2</m:mn><m:mi>n</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [7+64+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      {<m:math><m:mi>m</m:mi></m:math>}
	      <span class="del">chars</span>
	      <span class="new">bytes</span>:<m:math><m:mn>2</m:mn><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>m</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr>
	    <td>bytearray </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [4]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      bytes:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [4+64]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      [<m:math><m:mi>m</m:mi></m:math>]
	      bytes:<m:math><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>m</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [4+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      bytes:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [4+64+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      {<m:math><m:mi>m</m:mi></m:math>}
	      bytes:<m:math><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>m</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  
	  <tr class="new">
	    <td>derived</td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [12]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      bytes:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [12+64]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      [<m:math><m:mi>m</m:mi></m:math>]
	      bytes:<m:math><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>m</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr class="new">
	    <td/>
	    <td>|</td>
	    <td> [12+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      bytes:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	    <td class="new">|</td>
	    <td class="new"> [12+64+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      {<m:math><m:mi>m</m:mi></m:math>}
	      bytes:<m:math><m:mi>n</m:mi></m:math> 
	      id:<m:math><m:mi>m</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr>
	    <td>construct </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [16] object objects [17] </td>
	    <td class="new">|</td>
	    <td class="new"> [16+64]
	      {<m:math><m:mi>m</m:mi></m:math>}
	      id:<m:math><m:mi>m</m:mi></m:math> 
	      object objects [17]
	    </td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [22] symbol objects [23] </td>
	    <td class="new">|</td>
	    <td class="new"> [22+64]
	      {<m:math><m:mi>m</m:mi></m:math>}
	      id:<m:math><m:mi>m</m:mi></m:math> 
	      symbol objects [23]</td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [18] attrpairs object [19] </td>
	    <td class="new">|</td>
	    <td class="new"> [18+64]
	      {<m:math><m:mi>m</m:mi></m:math>}
	      id:<m:math><m:mi>m</m:mi></m:math> 
	      attrpairs object [19]
	    </td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [26] object bvars object [27] </td>
	    <td class="new">|</td>
	    <td class="new"> [26+64]
	      {<m:math><m:mi>m</m:mi></m:math>}
	      id:<m:math><m:mi>m</m:mi></m:math> 
	      object bvars object [27]
	    </td>
	  </tr>
	  
	  <tr>
	    <td>attrpairs </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [20] pairs [21] </td>
	    <td class="new">|</td>
	    <td class="new"> [20+64]
	      {<m:math><m:mi>m</m:mi></m:math>}
	      id:<m:math><m:mi>m</m:mi></m:math> 
	      pairs [21]
	    </td>
	  </tr>
	  
	  <tr>
	    <td>pairs </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> symbol object</td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> symbol object pairs</td>
	  </tr>
	  
	  <tr>
	    <td>bvars </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [28] vars [29] </td>
	    <td class="new">|</td>
	    <td class="new"> [28+64]
	      {<m:math><m:mi>m</m:mi></m:math>}
	      id:<m:math><m:mi>m</m:mi></m:math> 
	      vars [29]
	    </td>
	  </tr>
	  
	  <tr>
	    <td>vars </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> attrvar</td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> attrvar vars</td>
	  </tr>
	  
	  <tr>
	    <td>attrvar </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> variable</td>
	  </tr>
	  
	  <tr>
	    <td/>
	    <td>|</td>
	    <td> [18] attrpairs attrvar [19] </td>
	    <td class="new">|</td>
	    <td class="new"> [18+64]
	      {<m:math><m:mi>m</m:mi></m:math>}
	      id:<m:math><m:mi>m</m:mi></m:math> 
	      attrpairs attrvar [19]
	    </td>
	  </tr>
	  
	  <tr>
	    <td>objects </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> object objects</td>
	  </tr>
	  
	  <tr class="new">
	    <td>internal_reference </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [30] [_] </td>
	  </tr>
	  
	  <tr class="new">
	    <td/>
	    <td>|</td>
	    <td> [30+128] {_}</td>
	  </tr>
	  
	  <tr class="new">
	    <td>external_reference </td>
	    <td><m:math><m:mo>&#8594;</m:mo></m:math></td>
	    <td> [31]
	      [<m:math><m:mi>n</m:mi></m:math>]
	      uri:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	  </tr>
	  
	  <tr class="new">
	    <td/>
	    <td>|</td>
	    <td> [31+128]
	      {<m:math><m:mi>n</m:mi></m:math>}
	      uri:<m:math><m:mi>n</m:mi></m:math> 
	    </td>
	  </tr>
	</table>
  <div>
  Figure 4.2 Grammar of the binary encoding of <i>OpenMath</i> objects.</div></div>
  
  <p>Figure <a href="#fig_bin-enc">Figure 4.2</a> gives a grammar for the binary
    encoding <span class="new"> (<span>"start"</span> is the start
      symbol).</span>.</p>
  <p>The following conventions are used in this section:
    [<m:math><m:mi>n</m:mi></m:math>] denotes a byte whose value is the integer
    <m:math><m:mi>n</m:mi></m:math>  (<m:math><m:mi>n</m:mi></m:math>  can range from 0 to 255),
    {<m:math><m:mi>m</m:mi></m:math>} denotes four bytes representing the (unsigned) integer
    <m:math><m:mi>m</m:mi></m:math>  in network byte order, [_] denotes an arbitrary byte, {_}
    denotes an arbitrary sequence of four bytes.
    <span class="del">
      <i>name</i>:<m:math><m:mi>n</m:mi></m:math>  denotes a sequence of
      <m:math><m:mi>n</m:mi></m:math>  bytes named <i>name</i>.
      <i>name</i>:2<m:math><m:mi>n</m:mi></m:math>  denotes a sequence of
      <m:math><m:mn>2</m:mn><m:mi>n</m:mi></m:math>  bytes.  <span>"start"</span> is the start symbol of the
      grammar.</span></p>
  
  <p class="new"><i>xxxx</i>:<m:math><m:mi>n</m:mi></m:math>,
    where <i>xxxx</i> is one of <i>symbname</i>,
    <i>cdname</i>, <i>varname</i>,
    <i>uri</i>, <i>id</i>, <i>digits</i>, or
    <i>bytes</i> denotes a sequence of <m:math><m:mi>n</m:mi></m:math>  bytes
    that conforms to the constraints on <i>xxxx</i> strings. For
    instance, for <i>symbname</i>, <i>varname</i>, or
    <i>cdname</i>this is the regular expression described in
    <a href="#sec_names">Section 3.3</a>, for <i>uri</i> it is the grammar for
    URIs in <a href="#IETF2396">[9]</a>.</p>
</div>

<div><h4 name="sec_bin-desc" id="sec_bin-desc">4.2.2 Description of the Grammar</h4>
  
  
<p>An <i>OpenMath</i> object is encoded as a sequence of bytes starting with the begin object tag
(<span class="del">value 24</span>
<span class="new">values 24 and 88</span>) and ending with the end
object tag (<span class="del">value 25</span>
<span class="new">values 25 and 89</span>). These are similar to
the <small><code>&lt;OMOBJ&gt;</code></small> and <small><code>&lt;/OMOBJ&gt;</code></small> tags of
the <span>xml</span> encoding.</p>

<p>The encoding of each kind of <i>OpenMath</i> object begins with a tag that is a single byte,
holding a <span><i>token identifier</i></span>
<span class="new"> that describes the kind of object</span> and two flags, the <span><i>long</i></span> flag and the <span><i>shared</i></span> flag. The
identifier is stored in the first 6 bits (1 to 6). The long flag is the eighth bit
<span class="new">and the shared flag is the seventh bit. If the long
  flag is set, this signifies that  the names, strings, and data fields in the
  encoded <i>OpenMath</i> object are longer than 255 byte or characters. The sharing flag
  indicates that the encoded object is shared in another (part of an) object
  somewhere else (see <a href="#sec_sharing_references">Section 4.2.3</a>). Note that if the sharing
  flag is set (in the right column of the grammar in Figure
  <a href="#fig_bin-enc">Figure 4.2</a>, then the encoding includes a representation of
  the identifier.</span>
</p> 

<p>Here is a description of the binary encodings of every kind of <i>OpenMath</i> object:


<dl>

  <dt>Integers</dt><dd><p>are encoded depending on how large they
      are. There are four possible formats.  Integers between -128 and 127 are
      encoded as the small integer (<span class="new">token identifier</span> 1) followed by a single byte that is the
      value of the integer (interpreted as a signed character). For
      example 16 is encoded as <small><code>0x01 0x10</code></small>.  Integers between
      <m:math>
	<m:msup>
	  <m:mn>-2</m:mn>
	  <m:mn>31</m:mn>
	</m:msup>
      </m:math> 
      (<m:math><m:mn>-2147483648</m:mn></m:math>) and
      <m:math>
	<m:msup>
	  <m:mn>2</m:mn>
	  <m:mn>31</m:mn>
	</m:msup>
	<m:mo>-</m:mo>
	<m:mn>1</m:mn>
      </m:math> 
      (<m:math><m:mn>2147483647</m:mn></m:math>) are encoded as
      the small integer tag with the long flag set followed by the integer
      encoded in little endian format on four bytes (network byte order:
      the most significant byte comes first). For example, 128 is encoded
      as <small><code>0x81</code></small> <small><code>0x00000080</code></small>.  The most
      general encoding begins 
      with the big integer tag (token identifier 2) with the long flag set
      if the number of bytes in the encoding of the digits is greater or
      equal than 256. It is followed by the length (in bytes) of the
      sequence of digits, encoded on one byte (0 to 255, if the long flag
      was not set) or four bytes (network byte order, if the long flag was
      set).  It is then followed by a byte describing the sign and the
      base.  This 'sign/base' byte is <small><code>+</code></small> (0x2B) or
      <small><code>-</code></small> (0x2D) 
      for the sign ored with the base mask bits that can be 0 for base 10
      or 0x40 for base 16.  It is followed by the strings of digits (as
      characters) in their natural order (as in the <span>xml</span>
      encoding).  For example, 8589934592
      (<m:math><m:msup><m:mn>2</m:mn><m:mn>33</m:mn></m:msup></m:math>) is encoded <small><code>0x02 
	0x0A 0x2B 0x38353839393334353932</code></small> and
      xfffffff1 is 
      encoded as <small><code>0x02 0x08 0x6b 0x6666666666666631</code></small>.  Note that it is
      permitted to encode a <span>"small"</span> integer in any <span>"bigger"</span>
      format.
    </p>
</dd>



<dt>Symbols</dt>
<dd><p>are encoded as the symbol tags
    (<span class="new">token identifier</span> 8) with the long flag
    set if the maximum of the length <span class="new">in bytes in the UTF-8 encoding</span> of the Content Dictionary name,
    <span class="del">and</span>
  the symbol name <span class="new">or the CD base </span>
  is greater than or equal to 256<span class="del"> (note that this
  should never be the case if the rules on symbols and Content
  Dictionary names are applied), followed by the length of the
  Content Dictionary name as a byte (if the long flag was not set)
  or a four byte integer (in network byte order) followed by the
  length of the symbol name as a byte (if the long flag was not set)
  or a four byte integer (in network byte order), followed by the
  characters of the Content Dictionary name, followed by the
  characters of the symbol name.</span>
<span class="new">. The symbol tags [8] and [8+128] are deprecated in <i>OpenMath</i>2 since
  symbols now have an optional role field, but are
  kept for backwards compatibility. The symbol tag is  followed by the length <span class="new">in bytes in the UTF-8 encoding</span> of the
  Content Dictionary name, the symbol name, and the CD base as a byte (if the long flag was not set)
  or a four byte integers (in network byte order). These are followed by the
  <span class="del">characters</span>
  <span class="new">bytes of the UTF-8 encoding</span> of the Content Dictionary name, the symbol name, and the CD base.</span></p>
</dd>



<dt>Variables</dt>
<dd><p>are encoded using the variable tags
    (<span class="new">token identifiers</span> 5) with the long
  flag set if the number of bytes in the UTF-8 encoding of the variable name is
  greater than or equal to 256 (this should never happen if the rules
  on variables are followed).  Then, there is the number of characters
  as a byte (if the long flag was not set) or a four byte integer
  (in network byte order), followed by the characters of the name of
  the variable. For example, the variable x is encoded as <small><code>0x05
    0x01 0x78</code></small>.</p>
</dd>



<dt class="new">Indexed Variables</dt>
<dd class="new"><p>are encoded using the indexed variable tags
    (token identifiers 10 and 11) as begin and end tags. The long
  flag set on the begin tag if the number of bytes (characters) in the variable name is
  greater than or equal to 256.  The start tag is followed by the number of
  bytes
  as a byte (if the long flag was not set) or a four byte integer
  (in network byte order), followed by the bytes 
  of  the UTF-8 encoding of the name of
  the variable. This is followed by the encoding of an <i>OpenMath</i> object and the end tag
  [11].</p>
</dd>




<dt>Floating-point number</dt>
<dd><p>are encoded using the floating-point
  number tags (<span class="new">token identifier</span> 3) followed by eight bytes that are the IEEE 754
  representation <a href="#ieee754_85">[8]</a>, most significant bytes first. For
  example, 0.1 is encoded as <small><code>0x03 0x000000000000f03f</code></small>.</p>
</dd>



<dt>Character string</dt>
<dd><p>are encoded in two ways depending on whether
  <span class="del">the string contains <span>utf-16</span> characters or not. If the
  string contains only 8 bit characters</span>,
  <span class="new">The string is encoded in
  <span>utf-16</span> or <span>iso-859-1</span>
  (<span>latin-1</span>).
  In the case of <span>latin-1</span></span> it is encoded as the one
  byte character string tags (<span class="new">token identifier</span> 6) with the long flag set if the number
  of bytes (characters) in the string is greater than or equal to 256.
  Then, there is the number of characters as a byte (if the length
  flag was not set) or a four byte integer (in network byte order),
  followed by the characters in the string. If the string <span class="del">contains two
  byte characters</span><span class="new"> is encoded in
  <span>utf-16</span></span>, it is encoded as the two byte character string
  tags (<span class="new">token identifier</span> 7) with the long flag set if the number of characters in the
  string is greater or equal to 256. Then, there is the number of
  <span class="del">characters</span><span class="new"><span>utf-16</span> units, which will be the
  number of characters unless characters in the higher planes of
  Unicode are used.</span> as a byte (if the long flag was not set) or a four byte
  integer (in network byte order), followed by the characters
  (<span>utf-16</span> encoded  Unicode).</p>
</dd>



<dt>Bytearrays</dt>
<dd><p>are encoded using the bytearray tags (<span class="new">token identifier</span> 4) with the
  long flag set if the number <span class="del">of bytes in the
    number of </span> elements is
  greater than or equal to 256. Then, there is the number of elements,
  as a byte (if the long flag was not set) or a four byte integer
  (in network byte order), followed by the elements of the arrays in
  their normal order.</p>
</dd>



<dt class="new">Derived Objects</dt>
<dd class="new">
  <p>are encoded using the derived object tags (token identifier 12) with the
  long flag set if the number of bytes is
  greater than or equal to 256. Then, there is the number of elements,
  as a byte (if the long flag was not set) or a four byte integer
  (in network byte order), followed by the elements of the arrays in
  their normal order.</p>
</dd>



<dt>Applications</dt>
<dd><p>are encoded using the application tags (<span class="new">token identifier</span> 16). More
  precisely, the application of <m:math><m:msub><m:mi>E</m:mi><m:mn>0</m:mn></m:msub></m:math>  to
  <m:math><m:msub><m:mi>E</m:mi><m:mn>1</m:mn></m:msub></m:math><span>&#8230;</span>
  <m:math><m:msub><m:mi>E</m:mi><m:mi>n</m:mi></m:msub></m:math>  is encoded
  using the application tags (<span class="new">token identifier</span> 16), the sequence of the encodings of
  <m:math><m:msub><m:mi>E</m:mi><m:mn>0</m:mn></m:msub></m:math>  to
  <m:math><m:msub><m:mi>E</m:mi><m:mi>n</m:mi></m:msub></m:math>  and the end application tags (<span class="new">token identifier</span> 17).</p>
</dd>



 <dt>Bindings</dt>
 <dd><p>are encoded using the binding tags (<span class="new">token identifier</span> 26). More
  precisely, the binding by <m:math><m:mi>B</m:mi></m:math>  of variables <m:math><m:msub><m:mi>V</m:mi><m:mn>1</m:mn></m:msub></m:math><span>&#8230;</span> <m:math><m:msub><m:mi>V</m:mi><m:mi>n</m:mi></m:msub></m:math>  in
  <m:math><m:mi>C</m:mi></m:math>  is encoded as the binding tags (<span class="new">token identifier</span> 26), followed by the encoding of
  <m:math><m:mi>B</m:mi></m:math>, followed by the binding variables tags (<span class="new">token identifier</span> 28), followed by the
  encodings of the variables <m:math><m:msub><m:mi>V</m:mi><m:mn>1</m:mn></m:msub></m:math>  <span>&#8230;</span> <m:math><m:msub><m:mi>V</m:mi><m:mi>n</m:mi></m:msub></m:math>, followed by the end
  binding variables tags (<span class="new">token identifier</span> 29), followed by the encoding of <m:math><m:mi>C</m:mi></m:math>,
  followed by the end binding tags (<span class="new">token identifier</span> 27).</p>
</dd>



 <dt>Attribution</dt>
 <dd><p>are encoded using the attribution
tags (<span class="new">token identifier</span> 18). More
  precisely, attribution of the object <m:math><m:mi>E</m:mi></m:math>  with
  (<m:math><m:msub><m:mi>S</m:mi><m:mn>1</m:mn></m:msub></m:math>,
  <m:math><m:msub><m:mi>E</m:mi><m:mn>1</m:mn></m:msub></m:math>),
  <m:math><m:mi>&#8230;</m:mi></m:math>  (<m:math><m:msub><m:mi>S</m:mi><m:mi>n</m:mi></m:msub></m:math>, <m:math><m:msub><m:mi>E</m:mi><m:mi>n</m:mi></m:msub></m:math>) pairs (where <m:math><m:msub><m:mi>S</m:mi><m:mi>i</m:mi></m:msub></m:math>  are the attributes) is
  encoded as the attributed object tags (<span class="new">token identifier</span> 18), followed by the encoding
  of the attribute pairs as the attribute pairs tags (<span class="new">token identifier</span> 20), followed by
  the encoding of each symbol and value, followed by the end attribute
  pairs tags (<span class="new">token identifier</span> 21), followed by the encoding of <m:math><m:mi>E</m:mi></m:math>, followed by the end
  attributed object tags (<span class="new">token identifier</span> 19).</p>
</dd>



<dt>Error</dt>
<dd><p>are encoded using the error tags (<span class="new">token identifier</span> 22). More precisely,
  <m:math><m:msub><m:mi>S</m:mi><m:mn>0</m:mn></m:msub></m:math>  applied to
  <m:math><m:msub><m:mi>E</m:mi><m:mn>1</m:mn></m:msub></m:math><span>&#8230;</span>
  <m:math><m:msub><m:mi>E</m:mi><m:mi>n</m:mi></m:msub></m:math>  is encoded as the error tags (<span class="new">token identifier</span> 22),
  the encoding of <m:math><m:msub><m:mi>S</m:mi><m:mn>0</m:mn></m:msub></m:math>, the sequence of the
  encodings of <m:math><m:msub><m:mi>E</m:mi><m:mn>0</m:mn></m:msub></m:math>  to
  <m:math><m:msub><m:mi>E</m:mi><m:mi>n</m:mi></m:msub></m:math>  and the end error tags (<span class="new">token identifier</span> 23).</p>
</dd>



<dt class="new">Internal References</dt>
<dd class="new">
  <p>are encoded using the internal reference tags [30] and [30+128] (the sharing flag cannot
  be set on this tag, since chains of references are not allowed in the <i>OpenMath</i>
  binary encoding.) with   long flag set if the number of <i>OpenMath</i> sub-objects in the
  encoded <i>OpenMath</i> is
  greater than or equal to 256. Then, there is the ordinal number of the
  referenced <i>OpenMath</i> object as a byte (if the long flag was not set) or a four byte integer
  (in network byte order).</p>
</dd>



<dt class="new">External References</dt>
<dd class="new">
  <p>are encoded using the external reference tags [31] and [31+128] (the sharing flag cannot
  be set on this tag, since chains of references are not allowed in the <i>OpenMath</i>
  binary encoding) with the
  long flag set if the number of bytes in the reference URI is
  greater than or equal to 256. Then, there is the number of bytes in the URI used
  for the external reference 
  as a byte (if the long flag was not set) or a four byte integer
  (in network byte order), followed by the URI.</p>
</dd>


</dl> 
</p>

<div><h5 name="sec_sharing" id="sec_sharing">4.2.2.1 Sharing <span class="new">in Objects begining with the identifier [24]</span></h5>

 
<p>This binary encoding supports the sharing of symbols, variables and strings
(up to a certain length for strings) within one object. That is, sharing between
objects is not supported.  A reference to a shared symbol, variable or string is
encoded as the corresponding tag with the long flag not set and the shared flag
set, followed by a positive integer <m:math><m:mi>n</m:mi></m:math>  coded on one byte (0
to 255). This integer references the <m:math><m:mi>n</m:mi> <m:mo>+</m:mo>
<m:mn>1</m:mn></m:math>-th such sharable sub-object (symbol, variable or string up to
255 characters) in the current <i>OpenMath</i> object (counted in the order they are
generated by the encoding).  For example, <small><code>0x48 0x01</code></small>
references a symbol that is identical to the second symbol that was found in the
current object.  Strings with 8 bit characters and strings with 16 bit characters
are two different kinds of objects for this sharing. Only strings containing less
than 256 characters can be shared (i.e. only strings up to 255 characters).</p>
</div>
</div>

<div class="new"><h4 name="sec_sharing_references" id="sec_sharing_references">4.2.3 Sharing with References (beginning with [24+64])</h4>
  

  <p>In the binary encoding specified in the last section (which we keep
for compatibility reasons, but deprecate in favor of the more
efficient binary encoding specified in this section) only symbols,
variables, and short strings could be shared. In this section, we will
present a second binary encoding, which shares most of the identifiers
with the one in the last one, but handles sharing differently. This
  encoding is signaled by the shared object tags [88].</p>

  <p>The main difference is the interpretation of the sharing flag (bit 7),
which can be set on all objects that allow it. Instead of encoding a reference to a
previous occurrence of an object of the same type, it indicates
whether an object will be referenced later in the encoding. This
  corresponds to the information, whether an <small><code>id</code></small>
 attribute is set
in the <span>xml</span> encoding. On the object identifier (where sharing does not
make sense), the shared flag signifies the encoding described here
([88]=[24+64]).
</p>

<p>Otherwise integers, floats, variables, symbols, strings, bytearrays, and constructs
are treated exactly as in the binary encoding described in the last section.</p>

<p>The binary encoding with references uses the additional reference tags [30]
for (short) internal references, [30+128] for long internal references, [30] for
(short) external references, [30+128] for long external references. Internal
references are used to share sub-objects in the encoded object (see <a href="#fig_bin-enc2">Figure 4.3</a> for an example) by referencing their position; external
references allow to reference <i>OpenMath</i> objects in other documents by an URI.</p>

<p>Identifiers [30+64] and [30+64+128] are not used, since they would encode
references that are shared themselves. Chains of references are redundant, and
decrease both space and time efficiency, therefore they are not allowed in the
<i>OpenMath</i> binary encoding.</p>

<p>References consist of the identifier [30] ([30+128] for long references)
followed by a positive integer <m:math><m:mi>n</m:mi></m:math>  coded on one byte (4 bytes for long
references). This integer references the
<m:math><m:mrow><m:mi>n</m:mi><m:mo>+</m:mo><m:mn>1</m:mn></m:mrow></m:math>th shared sub-object (one
where the 
shared flag is set) in the current object (counted in the order they are generated
in the encoding). For example <small><code>Ox7E Ox01</code></small> references the
second shared sub-object. Figure <a href="#fig_bin-enc2">Figure 4.3</a> shows the binary
encoding of the object in figure <a href="#fig_shared_vs_unshared">Figure 4.1</a>
above.</p>


<div class="figure"><a name="fig_bin-enc2" id="fig_bin-enc2"/>
    
<table>
<tr>
<th>Hex </th>
<th>Meaning </th>
<th>Hex </th>
<th>Meaning </th>
</tr>

<tr><td>58</td><td>begin object tag</td>
   <td>05</td><td>variable tag</td></tr>
<tr><td>10</td><td>begin application tag</td>
  <td>01</td><td>variable length</td></tr>
<tr><td>05</td><td>variable tag</td>
  <td>61</td><td>a  (variable name)</td></tr>
<tr><td>01</td><td>variable length</td>
  <td>05</td><td>variable tag</td></tr>
<tr><td>66</td><td>f  (variable name)</td>
  <td>01</td><td>variable length</td></tr>
<tr><td>50</td><td>begin application tag (shared)</td>
  <td>61</td><td>a  (variable name)</td></tr>
<tr><td>05</td><td>variable tag</td>
  <td>11</td><td>end application tag</td></tr>
<tr><td>01</td><td>variable length</td>
  <td>1E</td><td>short reference</td></tr>
<tr><td>66</td><td>f  (variable name)</td>
  <td>00</td><td>to the first shared object</td></tr>
<tr><td>50</td><td>begin application tag (shared)</td>
  <td>11</td><td>end application tag</td></tr>
<tr><td>05</td><td>variable tag</td>
  <td>1E</td><td>short reference</td></tr>
<tr><td>01</td><td>variable length</td>
  <td>00</td><td>to the second shared object</td></tr>
<tr><td>66</td><td>f  (variable name)</td>
  <td>11</td><td>end application tag</td></tr>
<tr><td/><td/><td>19</td><td>end object tag</td></tr>
</table>
<div>
  Figure 4.3 A binary encoding of the <i>OpenMath</i> object from figure <a href="#fig_shared_vs_unshared">Figure 4.1</a>.</div></div>

<p>It is easy to see that in this binary encoding, the size of the encoding is
<m:math><m:mn>13</m:mn><m:mo>+</m:mo><m:mn>7</m:mn><m:mo fence="true">(</m:mo><m:mi>d</m:mi><m:mo>-</m:mo><m:mn>1</m:mn><m:mo fence="true">)</m:mo></m:math>  bytes,
where <m:math><m:mi>d</m:mi></m:math>  is the depth of the tree, while a totally unshared encoding
is <m:math><m:mn>8</m:mn><m:mo>*</m:mo><m:msup><m:mn>2</m:mn><m:mi>d</m:mi></m:msup><m:mo>-</m:mo><m:mn>8</m:mn></m:math> 
bytes (sharing variables saves up to 256 bytes for trees up to depth 8 and wastes space
for greater depths). The shared <span>xml</span> encoding only uses
<m:math><m:mn>32</m:mn><m:mi>d</m:mi><m:mo>+</m:mo><m:mn>29</m:mn></m:math>  bytes, which is more space
efficient starting at depth 9.</p>

<p>Note that in conversion to binary encoding the identifiers on the
objects are not preserved. Morever, even though the <span>xml</span> encoding
allows references across objects, as in figure ???, the binary
encoding does not (the binary encoding has no notion of a multi-object
collection, which is implicit by embedding <i>OpenMath</i> objects into <span>xml</span>
documents in the <span>xml</span> encoding.).</p>

<p>Note that objects need not be fully shared (or shared at all) in the
binary encoding with sharing.</p>
</div>

<div><h4 name="sec_impl_note" id="sec_impl_note">4.2.4 Implementation Note</h4>


<p>A typical implementation of the binary encoding comes in two parts. The
  first part deals with the unshared encodings, i.e. objects starting with the
  identifier <small><code>[24]</code></small>.</p>

<p>This part uses four tables, each of 256 entries, for symbol, variables, 8
  bit character strings whose lengths are less than 256 characters and 16 bit
  character strings whose lengths are less than 256 characters.  When an object is
  read, all the tables are first flushed. Each time a sharable sub-object is read,
  it is entered in the corresponding table if it is not full. When a reference to
  the shared <m:math><m:mi>i</m:mi></m:math>-th object of a given type is read, it stands
  for the <m:math><m:mi>i</m:mi></m:math>-th entry in the corresponding table. It is an
  encoding error if the <m:math><m:mi>i</m:mi></m:math>-th position in the table has not
  already been assigned (i.e. forward references are not allowed).  Sharing is not
  mandatory, there may be duplicate entries in the tables (if the application that
  wrote the object chose not to share optimally).
</p>

<p class="new">
  The part for the shared representations of <i>OpenMath</i> objects uses an unbounded
  array for storing shared sub-objects. Whenever an object has the shared flag
  set, then it is read and a pointer to the generated data structure is stored at
  the next position of the array. Whenever a reference of the form 
  <small><code>[30] [_]</code></small> is
  encountered, the array is queried for the value at <small><code>[_]</code></small>
  and analogously for or <small><code>[30+128] {_}</code></small>. Note that the
  application can decide to copy the value or share it among subterms as long as
  it respects the identity conditions given by the tree-nature of the <i>OpenMath</i>
  objects.  The implementation must take care to ensure that no variables
  are captured during this process (see section
  <a href="#sec_sharing_bvars">Section 4.1.2.2</a>), and possibly have methods for recovering
  from cyclic dependency relations (this can be done by standard loop-checking
  methods).
</p>

<p>Writing an object is simple. The tables are first flushed. Each time a
sharable sub-object is encountered (in the natural order of output given by the
encoding), it is either entered in the corresponding table (if it is not full) and
output in the normal way or replaced by the right reference if it is already
present in the table.</p>
</div>

<div><h4 name="sec_bin_example" id="sec_bin_example">4.2.5 Example of Binary Encoding</h4>


<p>As an example of this binary encoding, we can consider the <i>OpenMath</i> object
whose <span>xml</span> encoding is
<div class="literal"><pre> 
&lt;OMOBJ&gt;
  &lt;OMA&gt;
    &lt;OMS cdbase="http://www.openmath.org/cd" name="times" cd="arith1"/&gt;
    &lt;OMA&gt;
      &lt;OMS cdbase="http://www.openmath.org/cd" name="plus" cd="arith1"/&gt;
      &lt;OMV name="x"/&gt;
      &lt;OMV name="y"/&gt;
    &lt;/OMA&gt;
    &lt;OMA&gt;
      &lt;OMS cdbase="http://www.openmath.org/cd" name="plus" cd="arith1"/&gt;
      &lt;OMV name="x"/&gt;
      &lt;OMV name="z"/&gt;
    &lt;/OMA&gt;
  &lt;/OMA&gt;
&lt;/OMOBJ&gt;
</pre></div> 
It is binary encoded as the sequence of bytes given by  the following table.</p>

<table>
<tr>
<th>Hex </th>
<th>Meaning </th>
<th> Hex </th>
<th>Meaning 
</th>
</tr>

<tr><td>18</td><td>begin object tag</td>
  <td>68</td><td>h  .)</td></tr>
<tr><td>10</td><td> begin application tag</td>
  <td>31</td><td>1  .)</td></tr>
<tr><td>08</td><td>symbol tag</td>
  <td>70</td><td>p (symbol name begin</td></tr>
<tr><td>06</td><td>cd length </td>
  <td>6c</td><td>   l  .</td></tr>
<tr><td>05  </td><td>   name length</td>
  <td>75  </td><td>   u  . </td></tr>
<tr><td>61  </td><td>    a (cd name begin</td>
  <td>73  </td><td>   s  .) </td></tr>
<tr><td>72  </td><td>    r  .</td>
  <td>05  </td><td>   variable tag </td></tr>
<tr><td>69  </td><td>   i  .</td>
  <td>01  </td><td>   name length </td></tr>
<tr><td>74  </td><td>   t  .</td>
  <td>78  </td><td>   x (name) </td></tr>
<tr><td>68  </td><td>   h  .</td>
  <td>05  </td><td>   variable tag </td></tr>
<tr><td>31  </td><td>   1  .)</td>
  <td>01  </td><td>   name length </td></tr>
<tr><td>74  </td><td>   t (symbol name begin</td>
  <td>79  </td><td>   y (variable name) </td></tr>
<tr><td>69  </td><td>   i  .</td>
  <td>11  </td><td>   end application tag </td></tr>
<tr><td>6d  </td><td>   m  .</td>
  <td>10  </td><td>   begin application tag </td></tr>
<tr><td>65  </td><td>   e  .</td>
  <td>48  </td><td>   symbol tag (with share bit on) </td></tr>
<tr><td>73  </td><td>   s  .)</td>
  <td>01</td><td>reference to second symbol seen (arith1:plus)</td></tr>
<tr><td>10  </td><td>   begin application tag</td>
  <td>45  </td><td>   variable tag (with share bit on) </td></tr>
<tr><td>08  </td><td>   symbol tag</td>
  <td>00  </td><td>   reference to first variable seen (x) </td></tr>
<tr><td>06  </td><td>   cd length</td>
  <td>05  </td><td>   variable tag </td></tr>
<tr><td>04  </td><td>   name length</td>
  <td>01  </td><td>   name length </td></tr>
<tr><td>61  </td><td>   a (cd name begin</td>
  <td>7a  </td><td>   z (variable name) </td></tr>
<tr><td>72  </td><td>   r  .</td>
  <td>11  </td><td>   end application tag </td></tr>
<tr><td>69  </td><td>   i  .</td>
  <td>11  </td><td>   end application tag </td></tr>
<tr><td>74  </td><td>   t  .</td>
  <td>19  </td><td>   end object tag </td></tr>
</table> 

</div>

<div class="new"><h4 name="sec_relation_OM1_binary" id="sec_relation_OM1_binary">4.2.6 Relation to the <i>OpenMath</i>1 binary encoding</h4>
  
  <p>The <i>OpenMath</i>2 binary encoding significantly extends the
    <i>OpenMath</i>1 binary encoding to accomodate the new features and in particular sharing of
    sub-objects. The tags and structure of the  <i>OpenMath</i>1 binary encoding are still
    present in the current <i>OpenMath</i> binary encoding, so that binary encoded <i>OpenMath</i>1 objects
    are still valid in the <i>OpenMath</i>2 binary encoding and correspond to the same abstract
    <i>OpenMath</i> objects. In some cases, the binary encoding tags without the shared flag
    can still be used as more compact representations of the objects (which are
    not shared, and do not have an identifier).
  </p>
  <p>As the binary encoding is geared towards compactness, <i>OpenMath</i> objects should
    be maximally internally shared (if computationally feasible). Note that since
    sharing is done only at the
    encoding level, this does not alter the meaning of an <i>OpenMath</i> object, only allow
    to represent it more compactly.
  </p>
</div>
</div>

<div><h3 name="sec_enc_summary" id="sec_enc_summary">4.3 Summary</h3>


<p>The key points of this chapter are:
<ul>
<li><p>The <span>xml</span> encoding for <i>OpenMath</i> objects uses most common
  character sets.</p></li>
<li><p>The <span>xml</span> encoding is readable, writable and can be
  embedded in most documents and transport protocols.</p></li>
<li><p>The binary encoding for <i>OpenMath</i> objects should be used when
  efficiency is a key issue. It is compact yet simple enough to allow
  fast encoding and decoding of objects.</p></li>
</ul>
</p>
</div>


<h2 name="cha_cd" id="cha_cd">
  Chapter 5<br/>Content Dictionaries</h2>



<p>In this chapter we give a brief overview of Content Dictionaries
before explicitly stating their functionality and encoding.</p>
<div><h3 name="sec_cd_summary" id="sec_cd_summary">5.1 Introduction</h3>


<p>Content Dictionaries (CDs) are central to the <i>OpenMath</i> philosophy of
transmitting mathematical information. It is the <i>OpenMath</i> Content
Dictionaries which actually hold the meanings of the objects being
transmitted.</p>

<p>For example if application <m:math><m:mi>A</m:mi></m:math>  is talking to
application <m:math><m:mi>B</m:mi></m:math>, and sends, say, an equation
involving multiplication of matrices, then <m:math><m:mi>A</m:mi></m:math>  and
<m:math><m:mi>B</m:mi></m:math>  must agree on what a matrix is, and on what
matrix multiplication is, and even on what constitutes an
equation. All this information is held within some Content
Dictionaries which both applications agree upon.</p>

<p>A <i> Content Dictionary</i> holds the meanings of
(various) mathematical <span>"words"</span>. These words are <i>OpenMath</i>
basic objects referred to as <i>symbols</i> in <a href="#sec_omabs">Section 3.1</a>.</p>

<p>With a set of symbol definitions (perhaps from several Content
Dictionaries), <m:math><m:mi>A</m:mi></m:math>  and <m:math><m:mi>B</m:mi></m:math>  can
now talk in a common <span>"language"</span>.</p>

<p>It is important to stress that it is not Content Dictionaries
themselves which are being transmitted, but some <span>"mathematics"</span>
whose definitions are held within the Content Dictionaries. This means
that the applications must have already agreed on a set of Content
Dictionaries which they <span>"understand"</span> (i.e., can cope with
to some degree).</p>

 <p>In many cases, the Content
Dictionaries that an application understands will be constant, and be
intrinsic to the application's mathematical use. However the above
approach can also be used for applications which can handle every
Content Dictionary (such as an <i>OpenMath</i> parser, or perhaps a typesetting
system), or alternatively for applications which understand a
changeable number of Content Dictionaries (perhaps after being sent
Content Dictionaries in some way).</p>

<p>The primary use of Content Dictionaries is thought to be for
designers of Phrasebooks,the programs which translate between the <i>OpenMath</i>
mathematical object and the corresponding (often internal) structure
of the particular application in question. For such a use the Content
Dictionaries have themselves been designed to be as readable and
precise as possible.</p>

<p>Another possible use for <i>OpenMath</i> Content Dictionaries could rely on
their automatic comprehension by a machine (e.g., when given
definitions of objects defined in terms of previously understood
ones), in which case Content Dictionaries may have to be passed as
data. Towards this end, a Content Dictionary has been written which
contains a set of symbols sufficient to represent any other Content
Dictionary. This means that Content Dictionaries may be passed in the
same way as other (<i>OpenMath</i>) mathematical data.</p>

 <p>Finally, the syntax of the
<span class="new">reference encoding for</span>
Content Dictionaries has been designed to be relatively easy to learn
and to write, and also free from the need for any specialist
software. This is because it is acknowledged that there is an enormous
amount of mathematical information to represent, and so most of the
Content Dictionaries will be written by <span>"ordinary"</span>
mathematicians, encoding their particular fields of expertise.  A
further reason is that the mathematics conveyed by a specific Content
Dictionary should be understandable independently of any
application.</p>

<p>The key points from this section are:
<ul>
<li><p>Content Dictionaries should be readable and precise to help
  Phrasebook designers,</p></li>
<li><p>Content Dictionaries should be readily write-able to encourage
  widespread use,</p></li>
<li><p>It ought to be possible for a machine to understand a Content
  Dictionary to some degree.</p></li>
</ul>
</p>
</div>

<div><h3 name="sect_func" id="sect_func">5.2 Abstract Content Dictionaries</h3>


<p>In this section we define the <span class="del">overall</span><span class="new">abstract</span> structure of Content
Dictionaries.</p>


<p class="del">Other than Content Dictionary comments (which have no real semantics),
Content Dictionaries have been designed to hold two types of
information: that which is pertinent to the whole Content Dictionary,
and that which is restricted to a particular symbol definition.
Specific information pertaining to the symbols like the signature and
the defining mathematical properties is conveyed in additional files
associated to Content Dictionaries.</p>

<p class="del">Information that is pertinent to the whole Content Dictionary
includes:
<ul class="del">
<li><p>The name of the Content Dictionary.</p></li>
<li><p>A description of the Content Dictionary.</p></li>
<li><p>A date when the Content Dictionary is next planned to be reviewed.</p></li>
<li><p>A date on which the Content Dictionary was last edited.</p></li>
<li><p>The current version and revision  numbers of the Content Dictionary.</p></li>
<li><p>The status of the Content Dictionary.</p></li>
<li><p>An optional URL for this Content Dictionary.</p></li>
<li><p>An optional list of Content Dictionaries on which this Content
  Dictionary depends. That is, those named in Examples and FMP
  in this Content Dictionary.</p></li>
<li><p>An optional comment, possibly containing the author's name.</p></li>
</ul>
</p>

<p class="del">Information that is restricted to a particular symbol includes:
<ul class="del">
<li><p>The name of the symbol.</p></li>
<li><p>A description of this symbol.</p></li>
<li><p>An optional comment.</p></li>
<li><p>Optional properties that this symbol should obey.</p></li>
<li><p>Optional examples of the use of this symbol.</p></li>
</ul>
</p>





<p class="new">A Content Dictionary consists of the
following mandatory pieces of information:
<ol class="new">
<li><p>A <i>name</i> corresponding to the rules
described in <a href="#sec_names">Section 3.3</a>.</p></li>
<li><p>A <i>description</i> of the Content
Dictionary.
</p></li>
<li><p>A <i>revision date</i>, the date of the
last change to the Content Dictionary.  Dates should be stored in the
ISO-compliant format YYYY-MM-DD, e.g. 1966-02-03. 
</p></li>
<li><p>A <i>review date</i>, a date until which
the content dictionary is guarenteed to remain unchanged. 
</p></li>
<li><p>A <i>version number</i> which consists
of a major and minor part (see <a href="#sec_version">Section 5.2.2</a>). 
</p></li>
<li><p>A <i>status</i>, as described in <a href="#sec_status">Section 5.2.1</a>. 
</p></li>
<li><p>A <i>CD base</i> which is a unique
identifier for the Content Dictionary, and may or may not refer to an
actual location from which it can be retrieved.   
</p></li>
<li><p>A series of <i>symbol definitions</i> as
described below.
</p></li>
</ol>
</p>

<p class="new">A symbol definition consists of the
following pieces of information:
<ol class="new">
<li><p>A mandatory <i>name</i> corresponding to the rules
described in <a href="#sec_names">Section 3.3</a>.</p></li>
<li><p>A mandatory <i>description</i> of the symbol,
which can be as formal or informal as the author likes.
</p></li>
<li><p>An optional <i>role</i> as described in
<a href="#sec_roles">Section 3.1.4</a>.
</p></li>
<li><p>Zero or more <i>commented mathematical
properties</i> which are mathematical properties of the symbol
expressed in a mechanism other than <i>OpenMath</i>.
</p></li>
<li><p>Zero or more <i>formal mathematical
properties</i> which are mathematical properties of the symbol
expressed in <i>OpenMath</i>.  Note that it is common for commented and formal
mathematical properties to be introduced in pairs, with the former
describing the latter.
</p></li>
<li><p>Zero or more <i>examples</i> which are
intended to demonstrate the use of the symbol within an <i>OpenMath</i> object.
</p></li>
</ol>
</p>

<p class="del">As mentioned earlier, certain kinds of data pertaining to
symbols may be conveyed in files other than a Content Dictionary.  In
particular, information on signatures according to a type system may
be described in <i>Signature Files</i> whose format is
given in <a href="#sigfiles">Section 5.4.1</a>. Other information such as
presentation forms, extra defining mathematical properties may be
associated with Content Dictionaries using files whose format is not
specified by this standard. It is expected that a common method of
defining the presentation for <i>OpenMath</i> symbols is via
<span>xsl</span> <a href="#XSL_99">[19]</a> stylesheets
giving transformations to MathML.</p>

<p class="new">
Some pieces of information which might logically be thought to be part
of a Content Dictionary, such as the types or signatures of symbols,
are better represented externally.  This allows for new varients to be
associated with Content Dictionaries without the Dictionaries
themselves being changed.  A model for signatures is given in <a href="#sigfiles">Section 5.4.1</a>.</p>


<p>Content Dictionaries may be grouped into <i>CD
Groups</i>. These groups allow applications to easily refer to
collections of Content Dictionaries. One particular CDGroup of
interest is the <span>"MathML CDGroup"</span>. This group expresses
the collection of the core Content Dictionaries that is designed to
have the same semantic scope as the content elements of
MathML 2 <a href="#MathML_2000">[18]</a>.  <i>OpenMath</i> objects
built from symbols that come from Content Dictionaries in this CDGroup
may be expected to be eaily transformed between <i>OpenMath</i> and MathML
encodings.  The detailed structure of a CDGroup is described in
<a href="#ssec_cdgroups">Section 5.4.2</a> below.</p>

<div class="new"><h4 name="sec_status" id="sec_status">5.2.1 Content Dictionary Status</h4>


  <p>The status of a Content Dictionary can be either
<ul>
<li><p>
  <small><code>official</code></small>: approved by the <i>OpenMath</i> Society
  according to the procedure outlined in <a href="#cdapprove">Section 5.5</a>;
</p></li>

<li><p>
  <small><code>experimental</code></small>: under development and thus
liable to change;
</p></li>
<li><p>
  <small><code>private</code></small>: used by a private group of <i>OpenMath</i>
  users;
</p></li>
<li><p>
<small><code>obsolete</code></small>: an obsolete Content
  Dictionary kept only for archival purposes.
</p></li>
</ul>
</p>
</div>

<div class="new"><h4 name="sec_version" id="sec_version">5.2.2 Content Dictionary Version Numbers</h4>


<p>A version number must consist of two parts, a major version and
a revision, both of which should be non-negative integers.  In CDs
that do not have status <i>experimental</i>, the version
number should be a positive integer.</p>

<p>Unless a CD has status <i>experimental</i>,
no changes should ever be
  introduced that invalidate objects built with previous versions.
  Any change that influences phrasebook compliance, like adding a new
  symbol to a Content Dictionary, is considered a major change
  and should be reflected by an increase in the major version number. Other
  changes, like adding an example or correcting a description, are
  considered minor changes. For minor changes the version number is not
  changed, but an increase should be made to the revision number.
  Note that a change such as removing a symbol should
  not be made unless the CD has status
<i>experimental</i>.
Should this be required then a new CD with a different name should be
  produced so as not to invalidate existing objects.</p>

<p>
   When the major version number
   is increased, the revision number is normally reset to zero.</p>

<p>As detailed in chapter <a href="#cha_comp">Chapter 6</a>, <i>OpenMath</i>
compliant applications state which versions of which CDs they support.
</p>

</div>

</div>

<div><h3 name="sec_xml_cd" id="sec_xml_cd">5.3 The <span class="del"><span>xml</span></span><span class="new">Reference</span> Encoding for Content Dictionaries</h3>





<p><span class="new">The reference encoding of</span>
Content Dictionaries are as <span>xml</span> documents.  A valid Content Dictionary
document should 
	<ul class="del">
	  <li><p>be valid according to the DTD given in <a href="#fig_cd-dtd">Figure </a>,</p></li>
	  <li><p>adhere to the extra conditions on the
	      content of the elements given in <a href="#sect_pcdata">Section 5.3.2</a>.</p></li>
	</ul>
<span class="new">conform to the Relax NG Schema for
Content Dictionaries given in <a href="#sec_cd_schema">Section 5.3.1</a>.
</span>
</p>



<p>An example of a complete Content Dictionary is given in
Appendix <a href="#app_cdcd">Appendix A.1</a>, which is the
<small><code>Meta</code></small> Content Dictionary for describing
Content Dictionaries themselves. A more typical Content Dictionary is
given in Appendix <a href="#arith1.ocd">Appendix A.2</a>, the
<small><code>arith1</code></small> Content Dictionary for basic
arithmetic functions.</p>

<div class="new"><h4 name="sec_cd_schema" id="sec_cd_schema">5.3.1 The RelaxNG Schema for Content Dictionaries</h4>


<div class="literal"><pre>
<span style="color:brown;"># *********************************************</span>
<span style="color:brown;"># </span>
<span style="color:brown;"># Relax NG Schema for OpenMath CD</span>
<span style="color:brown;"># </span>
<span style="color:brown;"># *********************************************</span>

<span style="font-weight:bold;">default</span> <span style="font-weight:bold;">namespace</span> = "http://www.openmath.org/OpenMathCD"

<span style="font-weight:bold;">include</span> "openmath2.rnc"
<a name="rncCDComment" style="color:blue;">CDComment</a> = <span style="font-weight:bold;">element</span> CDComment { <span style="font-weight:bold;">text</span> }
<a name="rncCDName" style="color:blue;">CDName</a> = <span style="font-weight:bold;">element</span> CDName { <span style="font-weight:bold;">text</span> }
<a name="rncCDURL" style="color:blue;">CDURL</a> = <span style="font-weight:bold;">element</span> CDURL { <span style="font-weight:bold;">text</span> }
<a name="rncCDBASE" style="color:blue;">CDBASE</a> = <span style="font-weight:bold;">element</span> CDBASE { <span style="font-weight:bold;">text</span> }
<a name="rnctext-or-om" style="color:blue;">text-or-om</a> = (<span style="font-weight:bold;">text</span> | <a href="#rncOMOBJ">OMOBJ</a>)*
<a name="rncCDReviewDate" style="color:blue;">CDReviewDate</a> = <span style="font-weight:bold;">element</span> CDReviewDate { <span style="font-weight:bold;">text</span> }
<a name="rncCDStatus" style="color:blue;">CDStatus</a> = <span style="font-weight:bold;">element</span> CDStatus { <span style="font-weight:bold;">text</span> }
<a name="rncDescription" style="color:blue;">Description</a> = <span style="font-weight:bold;">element</span> Description { <span style="font-weight:bold;">text</span> }
<a name="rncName" style="color:blue;">Name</a> = <span style="font-weight:bold;">element</span> Name { <span style="font-weight:bold;">text</span> }
<a name="rncRole" style="color:blue;">Role</a> = <span style="font-weight:bold;">element</span> Role { <span style="font-weight:bold;">text</span> }
<a name="rncCMP" style="color:blue;">CMP</a> = <span style="font-weight:bold;">element</span> CMP { <span style="font-weight:bold;">text</span> }
<a name="rncFMP" style="color:blue;">FMP</a> = <span style="font-weight:bold;">element</span> FMP { <a href="#rnctext-or-om">text-or-om</a> }
<span style="color:brown;"># allow embedded OM</span>
<a name="rncExample" style="color:blue;">Example</a> = <span style="font-weight:bold;">element</span> Example { <a href="#rnctext-or-om">text-or-om</a> }
<a name="rncCDDefinition" style="color:blue;">CDDefinition</a> =
  <span style="font-weight:bold;">element</span> CDDefinition {
    (<a href="#rncCDComment">CDComment</a> | <a href="#rncName">Name</a> | <a href="#rncDescription">Description</a> | <a href="#rncExample">Example</a> | <a href="#rncFMP">FMP</a> | <a href="#rncCMP">CMP</a>)*
  }
<a name="rncCD" style="color:blue;">CD</a> =
  <span style="font-weight:bold;">element</span> CD {
    <a href="#rncCDComment*">CDComment*</a>,
    (<a href="#rncCDName">CDName</a> &amp; <a href="#rncCDURL">CDURL</a> &amp; <a href="#rncCDReviewDate">CDReviewDate</a> &amp; <a href="#rncCDStatus">CDStatus</a>),
    (<a href="#rncCDComment">CDComment</a> | <a href="#rncDescription">Description</a> | <a href="#rncCDDefinition">CDDefinition</a> | <a href="#rncExample">Example</a>)*
  }
<a name="rncstart" style="color:blue;">start</a> = <a href="#rncCD">CD</a>

</pre></div>

</div>
<div class="del"><h4 name="sec_dtd_cd" id="sec_dtd_cd"> The DTD Specification of  Content Dictionaries</h4>



<div class="figure"><a name="fig_cd-dtd" id="fig_cd-dtd"/>
    
<div class="literal"><pre>
&lt;!-- DTD for OpenMath object -sb-29.10.1998 -&gt;

&lt;!--  general list of embeddable elements
      : excludes OMATP as this is only embeddable in OMATTR
      : excludes OMBVAR as this is only embeddable in OMBIND
--&gt;
&lt;!ENTITY % omel "OMS | OMV | OMI | OMB | OMSTR
                     | OMF | OMA | OMBIND | OME  | OMATTR  "&gt;

&lt;!-- things which can be variables --&gt;
&lt;!ENTITY % omvar        "OMV | OMATTR" &gt;

&lt;!-- symbol --&gt;
&lt;!ELEMENT OMS EMPTY&gt;
&lt;!ATTLIST OMS name CDATA #REQUIRED  cd CDATA #REQUIRED &gt;

&lt;!-- variable --&gt;
&lt;!ELEMENT OMV EMPTY&gt;
&lt;!ATTLIST OMV name CDATA #REQUIRED &gt;

&lt;!-- integer --&gt;
&lt;!ELEMENT OMI (#PCDATA) &gt;

&lt;!-- byte array --&gt;
&lt;!ELEMENT OMB (#PCDATA) &gt;

&lt;!-- string --&gt;
&lt;!ELEMENT OMSTR (#PCDATA) &gt;

&lt;!-- floating point --&gt;
&lt;!ELEMENT OMF EMPTY&gt;
&lt;!ATTLIST OMF dec CDATA #IMPLIED  hex CDATA #IMPLIED&gt;

&lt;!-- apply constructor --&gt;
&lt;!ELEMENT OMA (%omel;)+ &gt;

&lt;!-- binding constructor &amp; variable --&gt;
&lt;!ELEMENT OMBIND ((%omel;), OMBVAR, (%omel;)) &gt;
&lt;!ELEMENT OMBVAR (%omvar;)+ &gt;

&lt;!-- error --&gt;
&lt;!ELEMENT OME    (OMS, (%omel;)* ) &gt;

&lt;!-- attribution constructor &amp; attribute pair constructor --&gt;
&lt;!ELEMENT OMATTR (OMATP, (%omel;)) &gt;
&lt;!ELEMENT OMATP (OMS, (%omel;))+ &gt;

&lt;!-- OM object constructor --&gt;
&lt;!ELEMENT OMOBJ (%omel;) &gt;

&lt;!-- end of DTD for OM object --&gt;


</pre></div>


<div>
  Figure  DTD Specification of  Content Dictionaries</div></div>


<p>The <span>xml</span> DTD for Content Dictionaries is given in
<a href="#fig_cd-dtd">Figure </a>. The allowed elements are further
described in the following section.</p>
</div>

<div><h4 name="sect_pcdata" id="sect_pcdata">5.3.2 Further <span class="del">Requirements of an <i>OpenMath</i>
Content Dictionary</span><span class="new">Description of
the CD Schema</span></h4>



<p class="del">The notion of being a valid Content Dictionary is stronger than merely
being successfully parsed by the DTD. This is because the content of
the elements, referred to in <a href="#fig_cd-dtd">Figure </a> as PCDATA and
CDATA, must actually make sense to, say, a Phrasebook designer. In
this section we define exactly the format of the elements used in
Content Dictionaries.</p>

<p class="new">
We now describe the elements used in the above schema in terms of the
abstract description of CDs in <a href="#sect_func">Section 5.2</a>.  Unless
stated otherwise the information is encoded as the content of the
element.
</p>



<dl>
<dt><small><code>CDName</code></small></dt><dd><p>The
<span class="del">
  text occurring in the <small><code>CDName</code></small> element
  corresponds to the</span> name of the Content Dictionary.
</p>

</dd>


<dt><small><code>Description</code></small></dt>
<dd><p>The text occurring in the <small><code>Description</code></small>
  element is used to give a description of the enclosing element, which
  could be a symbol or the entire Content Dictionary. The content of
  this element can be any <span>xml</span> text.</p>
  
</dd>

<dt><small><code>CDReviewDate</code></small></dt><dd><p>The
<span class="del">
  text occurring in the <small><code>CDReviewDate</code></small> element
  corresponds to the earliest possible
</span>
review date of the Content
  Dictionary. <span class="del">The date formats should be ISO-compliant in the form
  YYYY-MM-DD, e.g. 1953-09-26.</span></p>
  
</dd>

<dt><small><code>CDDate</code></small></dt><dd><p>The
<span class="del">
text occurring in the <small><code>CDDate</code></small> element
  corresponds to the
</span>
revision date of this version of the Content Dictionary.
<span class="del">
  The date formats should be ISO-compliant in the form YYYY-MM-DD,
  e.g. 1953-09-26.
</span>
</p>
  
</dd>

<dt><small><code>CDVersion</code></small></dt><dd>
   
   

<p class="new">The major version number of the CD.</p>
   <p class="del">The text occurring in the <small><code>CDVersion</code></small> element corresponds to
   the version number of the current version of a Content Dictionary.
   It should be a non negative integer.</p>

<p class="del">In CDs that do not have status <i>experimental</i>, CD version
  numbering should adhere to the following. The version number should
  be a positive integer.</p>

<p class="del">No changes can be
  introduced that invalidate objects built with previous versions.
  Any change that influences phrasebook compliance, like adding a new
  symbol to a Content Dictionary, is considered a major change.
  and should be reflected by an increase in this version number. Other
  changes, like adding an example or correcting a description, are
  considered minor changes. For minor changes the version number is not
  changed, but an increas should be made to the revision number, as
  described below. A change such as removing a symbol should
  not be made, instead a new CD, with a different name should be
  produced, so as not to invalidate existing objects.</p>

<p class="del">As detailed in chapter <a href="#cha_comp">Chapter 6</a>, <i>OpenMath</i> compliant applications
  state which versions of which CDs they support.

  <i>Experimental</i> CDs may expect to have changes such as adding
  or removing symbols as they are developed, without requiring the name
  of the CD to be changed.</p>

  
</dd>

<dt><small><code>CDRevision</code></small></dt><dd>
    <p class="del">The text
   occurring in the <small><code>CDRevision</code></small> element
   corresponds to the revision, or `minor version number' of the
   current version of a Content Dictionary.  It should be a non
   negative integer.</p>

<p class="del">Minor changes to a CD that do not warrant the release of a CD with
   an increased version number should be marked by increasing the
   revision number specified in this field. When the Cd Version number
   is increased, the Revision number is normally reset to zero.</p>

<p class="new">The minor version number of the
CD.</p>
  
</dd>

<dt><small><code>CDStatus</code></small></dt><dd><p>The
<span class="del">
  text occurring in the <small><code>CDStatus</code></small> element
  corresponds to the
</span>
status of the Content Dictionary.
<span class="del">
, and can be either
  <small><code>official</code></small> (approved by the <i>OpenMath</i> Society
  according to the procedure outlined in <a href="#cdapprove">Section 5.5</a>),
  <small><code>experimental</code></small> (currently being tested),
  <small><code>private</code></small> (used by a private group of <i>OpenMath</i>
  users) or <small><code>obsolete</code></small> (an obsolete Content
  Dictionary kept only for archival purposes).
</span>
</p>
  
</dd>

<dt class="new"><small><code>CDCDBASE</code></small></dt><dd class="new"><p>The
CD base of the CD.

</p>
</dd>

<dt><small><code>CDURL</code></small></dt><dd><p>The
  text occurring in the <small><code>CDURL</code></small> element should
  be a valid URL where the source file for the Content Dictionary
  encoding can be found (if it exists). The filename should conform to
  ISO 9660 <a href="#iso9660">[13]</a>.

</p>

</dd>

<dt><small><code>CDUses</code></small></dt><dd>
    <p>The content of this element should
   be a series of <small><code>CDName</code></small> elements, each
   naming a Content Dictionary used in the
   <small><code>Example</code></small> and <small><code>FMP</code></small>s
   of the current Content Dictionary. <span class="new">This element is optional and deprecated since
the information can easily be extracted automatically.</span></p>
   
 </dd>

<dt><small><code>CDComment</code></small></dt><dd><p>The
   content of this element should be text that does not convey any
   crucial information concerning the current Content Dictionary. It
   can be used in the Content Dictionary header to report the author
   of the Content Dictionary and to log change information. In the
   body of the Content Dictionary, it can be used to attach extra
   remarks to certain symbols.</p> 
   
 </dd>

<dt class="new"><small><code>CDDefinition</code></small></dt><dd class="new"><p>The
element which contains the definition of an individual symbol.
</p>
  
</dd>

<dt><small><code>Name</code></small></dt><dd><p>The
<span class="del">
  text occurring in the <small><code>Name</code></small> element
  corresponds to the
</span>
name of a symbol.
<span class="del">
, and is specified as in <a href="#cha_enco">Chapter 4</a>.
</span>
</p>
  
</dd>

<dt><small><code>Example</code></small></dt>
<dd>
 <p>The text occurring in the
<small><code>Example</code></small> element is used to give examples of
the enclosing symbol, and can be any <span>xml</span> text. In addition to text
the element may contain examples as <span>xml</span> encoded <i>OpenMath</i>, inside
<small><code>OMOBJ</code></small> elements.  Note that
<small><code>Examples</code></small> must be with respect to some symbol
and cannot be <span>"loose"</span> in the Content Dictionary.</p>
  
</dd>

<dt><small><code>CMP</code></small></dt>
<dd><p>

<span class="del">
The text occurring in the <small><code>CMP</code></small> element
  corresponds to a property of the symbol. An application which says
  it understands a Content Dictionary symbol need not understand a
  commented property of the symbol.
</span>
<span class="new">
A Commented Mathematical Property.
</span>

</p>
  
</dd>

<dt><small><code>FMP</code></small></dt><dd><p>

<span class="del">
The
  content of the <small><code>FMP</code></small> element also corresponds
  to a property<sup><a href="#ftn_theory">*1</a></sup> of the
  symbol, however the content of this element must be a valid <i>OpenMath</i>
  object in the <span>xml</span> encoding.  An application which says it
  understands a Content Dictionary symbol need not understand a formal
  property of the symbol.
</span>
<span class="new">
A Formal Mathematical Property.
</span>

</p>
</dd>

</dl>
</div>
</div>


<div><h3 name="addfiles" id="addfiles">5.4 Additional Information</h3>



  <p>Content
Dictionaries contain just one part of the information that can be
associated to a symbol in order to stepwise define its meaning and its
functionality. <i>OpenMath</i> Signature 
<span class="del">files</span><span class="new">dictionaries</span>, CDGroups, and possibly
<span class="del">files</span><span class="new">collections</span>
of extra mathematical properties, are used to convey the different
aspects that as a whole make up a mathematical definition.</p>

<div><h4 name="sigfiles" id="sigfiles">5.4.1 Signature
<span class="del">Files</span><span class="new">Dictionaries</span>
</h4>





<p><i>OpenMath</i> may be used with any type system. One just needs to produce
a Content Dictionary which gives the constructors of the type system,
and then one may build <i>OpenMath</i> objects representing types in the given
type system. These are typically associated with <i>OpenMath</i> objects via the
<i>OpenMath</i> <b>attribution</b> constructor.</p>

<p>A Small Type System, called STS, has been designed to give
semi-formal signatures to <i>OpenMath</i> symbols and is documented
in <a href="#OM_D132c">[6]</a>.  The signature file given in
<a href="#arith1.sts">Appendix A.3</a> is based on this formalism. Using the
same mechanism, <a href="#OMD132b">[4]</a> shows how pure type
systems can also be employed to assign types to <i>OpenMath</i> symbols.</p>


<div class="del"><h5 name="sec_dtd_sig" id="sec_dtd_sig"> The  DTD Specification of Signature Files</h5>


<p>Signature Files are <span>xml</span> documents, hence a valid Signature
 File should
<ul>
<li><p>be valid according to the <span>dtd</span> given in
  <a href="#fig_omcdsig.dtd">Figure </a>,</p></li>
<li><p>adhere to the extra conditions on the content of the elements
  given in <a href="#sect_sigpcdata">Section 5.4.1.1</a>.</p></li>
</ul></p>


<p>Signature files have a header which specifies the Content
Dictionary and determines the type system being used, and the Content
Dictionary which contains the symbols for which the signatures are
being given. Each signature takes the form of an <span>xml</span> encoded <i>OpenMath</i>
object.</p>


<div class="figure"><a name="fig_omcdsig.dtd" id="fig_omcdsig.dtd"/>
    
<div class="literal"><pre>
&lt;!-- omcdsig.dtd --&gt;
&lt;!-- ********************************************* --&gt;
&lt;!--                                               --&gt;
&lt;!-- DTD for OpenMath CD Signatures                --&gt;
&lt;!-- (c) EP24969 the ESPRIT OpenMath Consortium    --&gt;
&lt;!-- David Carlisle 1999-04-13                     --&gt;
&lt;!-- David Carlisle 1999-05-21                     --&gt;
&lt;!-- David Carlisle 1999-06-22                     --&gt;
&lt;!--                                               --&gt;
&lt;!--                                               --&gt;
&lt;!-- ********************************************* --&gt;

&lt;!-- include dtd for OM objects --&gt;
&lt;!ENTITY  % omobjectdtd SYSTEM "omobj.dtd" &gt;
%omobjectdtd;

&lt;!ELEMENT CDSComment      (#PCDATA) &gt;
&lt;!ELEMENT CDSReviewDate    (#PCDATA) &gt;
&lt;!ELEMENT CDSStatus    (#PCDATA) &gt;

&lt;!ELEMENT CDSignatures   (CDComment |CDSComment | CDSReviewDate |
                         CDSStatus | Signature )* &gt;

&lt;!ATTLIST CDSignatures cd CDATA #REQUIRED
                       type CDATA #REQUIRED &gt;

&lt;!ELEMENT Signature      (OMOBJ?) &gt;

&lt;!ATTLIST  Signature  name CDATA #REQUIRED &gt;

&lt;!-- end of DTD for OM CD Signatures --&gt;
</pre></div>
<div>
  Figure  DTD Specification of Signature Files</div></div>
</div>

<div><h5 name="sect_sigpcdata" id="sect_sigpcdata">5.4.1.1 <span class="del">Further
Requirements
</span>
<span class="new">
Abstract Specification</span>
 of a Signature File</h5>




<p class="new">Signature files have a header which specifies the
type system being used, and the Content
Dictionary which contains the symbols for which the signatures are
being given. Each signature takes the form of an <i>OpenMath</i>
object in an appropriate encoding.</p>

<p class="del">The notion of being a valid Signature File is stronger than
merely being successfully parsed by the <span>dtd</span> in
<a href="#fig_omcdsig.dtd">Figure </a>.  In this section we define exactly
the format of the elements used in Signature Files. Several of the
requirements are the same as those on elements of Contents
Dictionaries.</p>


<dl class="del">
<dt><small><code>CDSignatures</code></small></dt><dd><p>The
  outermost element of the Signature File is characterized by two
  required attributes that identify the type system and the Content
  Dictionary whose signatures are defined. The value of the <span>xml</span>
  attribute <small><code>type</code></small> is the name of the Content
  Dictionary or of the CDGroup (cfg. <a href="#ssec_cdgroups">Section 5.4.2</a>)
  that represents the type system. The value of the <span>xml</span> attribute
  <small><code>cd</code></small> is the name of the Content Dictionary
  whose symbols are assigned signatures in this Signature File. Both
  values are of the form specified in <a href="#cha_enco">Chapter 4</a>.</p>
  
</dd>

<dt><small><code>CDSComment</code></small></dt><dd><p>See
  <small><code>CDComment</code></small> in <a href="#sect_pcdata">Section 5.3.2</a>.</p>

</dd>


<dt><small><code>CDSreviewDate</code></small></dt><dd><p>The
  text occurring in the <small><code>CDSReviewDate</code></small> element
  corresponds to the earliest possible revision date of the Signature
  File.  The date formats should be ISO-compliant in the form
  YYYY-MM-DD, e.g. 2000-02-29.</p>
  </dd>


<dt><small><code>CDSStatus</code></small></dt><dd><p>The
  text occurring in the <small><code>CDSStatus</code></small> element
  corresponds to the status of the Signature File, and can be either
  <small><code>official</code></small> (approved by the <i>OpenMath</i> Society
  according to the procedure outlined in <a href="#cdapprove">Section 5.5</a>),
  <small><code>experimental</code></small> (currently being tested),
  <small><code>private</code></small> (used by a private group of <i>OpenMath</i>
  users) or <small><code>obsolete</code></small> (an obsolete Signature
  File kept only for archival purposes).</p>
  
</dd>

<dt><small><code>Signature</code></small></dt>
<dd>

<p>The content of the <small><code>Signature</code></small> element
  has to be a valid <i>OpenMath</i> object in <span>xml</span> encoding as specified in
  <a href="#cha_enco">Chapter 4</a>. Additionally, the object must represent
  a valid type in the type system identified by the <span>xml</span> attribute
  <small><code>type</code></small> of the
  <small><code>CDSignature</code></small> element. See <a href="#sect_sigex">Section 5.4.1.3</a> for examples.</p>

</dd>

</dl>

<ol class="new">
<li><p>
A <i>type definition</i>: the
  name of the Content
  Dictionary or of the CDGroup (cfg. <a href="#ssec_cdgroups">Section 5.4.2</a>)
  that represents the type system being used.

</p></li>
<li><p>
A <i>CD name</i>: the name of the CD for which
signatures are being defined.

</p></li>
<li><p>
A <i>review date</i>
as defined in <a href="#sect_func">Section 5.2</a>.
</p></li>
<li><p>
A <i>status</i>:
as defined in <a href="#sect_func">Section 5.2</a>.
</p></li>
<li><p>
A series of <i>signatures</i> which are <i>OpenMath</i> objects in
some encoding.  The objects must represent types as defined by the
type definition.
</p></li>
</ol>

</div>


<div class="new"><h5 name="sect_sigschema" id="sect_sigschema">5.4.1.2 A RelaxNG Schema for a Signature File</h5>


<p>
The following is a reference encoding of a signature dictionary,
designed to be used with Content Dictionaries in the <span>xml</span> encoding.
</p>

<div class="literal"><pre>
<span style="color:brown;"># *********************************************</span>
<span style="color:brown;"># </span>
<span style="color:brown;"># Relax NG Schema for OpenMath CD Signatures</span>
<span style="color:brown;"># </span>
<span style="color:brown;"># *********************************************</span>

<span style="font-weight:bold;">default</span> <span style="font-weight:bold;">namespace</span> = "http://www.openmath.org/OpenMathCDS"

<span style="font-weight:bold;">include</span> "openmath2.rnc"
<a name="rncCDSComment" style="color:blue;">CDSComment</a> = <span style="font-weight:bold;">element</span> CDSComment { <span style="font-weight:bold;">text</span> }
<a name="rncCDSReviewDate" style="color:blue;">CDSReviewDate</a> = <span style="font-weight:bold;">element</span> CDSReviewDate { <span style="font-weight:bold;">text</span> }
<a name="rncCDSStatus" style="color:blue;">CDSStatus</a> = <span style="font-weight:bold;">element</span> CDSStatus { <span style="font-weight:bold;">text</span> }
<a name="rncCDSignatures" style="color:blue;">CDSignatures</a> =
  <span style="font-weight:bold;">element</span> CDSignatures {
    <a href="#rncattlist.CDSignatures">attlist.CDSignatures</a>,
    (<a href="#rncCDComment">CDComment</a> | <a href="#rncCDSComment">CDSComment</a>)*,
    (<a href="#rncCDSReviewDate">CDSReviewDate</a>? &amp; <a href="#rncCDSStatus">CDSStatus</a>?),
    (<a href="#rncCDComment">CDComment</a> | <a href="#rncCDSComment">CDSComment</a> | <a href="#rncSignature">Signature</a>)*
  }
<a name="rncattlist.CDSignatures" style="color:blue;">attlist.CDSignatures</a> =
  <span style="font-weight:bold;">attribute</span> cd { <span style="font-weight:bold;">text</span> },
  <span style="font-weight:bold;">attribute</span> type { <span style="font-weight:bold;">text</span> }
<a name="rncSignature" style="color:blue;">Signature</a> = <span style="font-weight:bold;">element</span> Signature { <a href="#rncattlist.Signature">attlist.Signature</a>, <a href="#rncOMOBJ">OMOBJ</a>? }
<a name="rncattlist.Signature" style="color:blue;">attlist.Signature</a> = <span style="font-weight:bold;">attribute</span> name { <span style="font-weight:bold;">text</span> }
<a name="rncstart" style="color:blue;">start</a> = <a href="#rncCDSignatures">CDSignatures</a>

</pre></div>

</div>


<div><h5 name="sect_sigex" id="sect_sigex">5.4.1.3 Examples</h5>


<p>An example of a signature file for the type system STS and the
<small><code>arith1</code></small> Content Dictionary is given in <a href="#arith1.sts">Appendix A.3</a>. Each signature entry is similar to the
following one for the <i>OpenMath</i> symbol <small><code>&lt;OMS cd="arith1"
name="plus"/&gt;</code></small>: <div class="literal"><pre>
&lt;Signature name="plus"&gt;
&lt;OMOBJ&gt;
 &lt;OMA&gt;
  &lt;OMS cdbase="http://www.openmath.org/cd" name="mapsto" cd="sts"/&gt;
  &lt;OMA&gt;
   &lt;OMS cdbase="http://www.openmath.org/cd" name="nassoc" cd="sts"/&gt; 
   &lt;OMV name="AbelianSemiGroup"/&gt;
  &lt;/OMA&gt;
  &lt;OMV name="AbelianSemiGroup"/&gt;
 &lt;/OMA&gt;
&lt;/OMOBJ&gt;
&lt;/Signature&gt;
</pre></div>
</p>
</div>



</div>

<div><h4 name="ssec_cdgroups" id="ssec_cdgroups">5.4.2 CDGroups</h4>




  <p>The CD
Group mechanism is a convenience mechanism for identifying collections
of CDs.  A CD Group file is an <span>xml</span> document used in the (static or
dynamic) negotiation phase where communicating applications declare
and agree on the Content Dictionaries which they process.  It is a
complement, or an alternative, to the individual declaration of
Content Dictionaries understood by an application.  Note that CD
Groups do <i>not</i> affect the <i>OpenMath</i> objects themselves.
Symbols in an object always refer to content dictionaries, not
groups.</p>

 <p>For an application to declare that
it <span>"understands CDGroup G"</span> is exactly equivalent to, and
interchangable with, the declaration that it <span>"understands
Content Dictionaries <m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub></m:math>,
<m:math><m:msub><m:mi>x</m:mi><m:mn>2</m:mn></m:msub></m:math>, <span>&#8230;</span>
<m:math><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub></m:math>"</span>, where
<m:math><m:msub><m:mi>x</m:mi><m:mn>1</m:mn></m:msub></m:math>, <span>&#8230;</span>
<m:math><m:msub><m:mi>x</m:mi><m:mi>n</m:mi></m:msub></m:math>  are the members of
CDGroup G.</p>


<div><h5 name="sec_dtd_cdg" id="sec_dtd_cdg">5.4.2.1 The DTD Specification of CDGroups</h5>



<p>CDGroups are <span>xml</span> documents, hence  a valid  CDGroup
 should 
<ul>
<li><p>be valid according to the DTD given in
  <a href="#fig_cdgroup.dtd">Figure 5.1</a>,</p></li>
<li><p>adhere to the extra conditions on the content of the elements
  given in <a href="#sect_cdgpcdata">Section 5.4.2.2</a>.</p></li>
</ul>
</p>

<p>Apart from some header information such as <small><code>CDGroupName</code></small> and
<small><code>CDGroup</code></small> version, a CDGroup is simply an unordered list of
CDs, identified by name and optionally version number and URL.</p>


<div class="figure"><a name="fig_cdgroup.dtd" id="fig_cdgroup.dtd"/>
    
<div class="literal"><pre>

<span style="color:brown;"># Schema for OpenMath CD groups</span>

<span style="color:brown;"># info on the CD group itself</span>

<a name="rncCDGroupName" style="color:blue;">CDGroupName</a> = <span style="font-weight:bold;">element</span> CDGroupName { <span style="font-weight:bold;">text</span> }
<a name="rncCDGroupVersion" style="color:blue;">CDGroupVersion</a> = <span style="font-weight:bold;">element</span> CDGroupVersion { <span style="font-weight:bold;">text</span> }
<a href="#rncattlist.CDGroupVersion">attlist.CDGroupVersion</a> &amp;= <a href="#rncempty">empty</a>
<a name="rncCDGroupRevision" style="color:blue;">CDGroupRevision</a> = <span style="font-weight:bold;">element</span> CDGroupRevision { <span style="font-weight:bold;">text</span> }
<a name="rncCDGroupURL" style="color:blue;">CDGroupURL</a> = <span style="font-weight:bold;">element</span> CDGroupURL { <span style="font-weight:bold;">text</span> }
<a name="rncCDGroupDescription" style="color:blue;">CDGroupDescription</a> = <span style="font-weight:bold;">element</span> CDGroupDescription { <span style="font-weight:bold;">text</span> }
<span style="color:brown;"># info on the CDs in the group</span>
<a name="rncCDComment" style="color:blue;">CDComment</a> = <span style="font-weight:bold;">element</span> CDComment { <span style="font-weight:bold;">text</span> }
<a name="rncCDGroupMember" style="color:blue;">CDGroupMember</a> =
  <span style="font-weight:bold;">element</span> CDGroupMember {
    <a href="#rncattlist.CDGroupMember">attlist.CDGroupMember</a>, <a href="#rncCDComment">CDComment</a>?, <a href="#rncCDName">CDName</a>, <a href="#rncCDVersion">CDVersion</a>?, <a href="#rncCDURL">CDURL</a>?
  }
<a name="rncCDName" style="color:blue;">CDName</a> = <span style="font-weight:bold;">element</span> CDName { <span style="font-weight:bold;">text</span> }
<a name="rncCDVersion" style="color:blue;">CDVersion</a> = <span style="font-weight:bold;">element</span> CDVersion { <span style="font-weight:bold;">text</span> }
<a name="rncCDURL" style="color:blue;">CDURL</a> = <span style="font-weight:bold;">element</span> CDURL { <span style="font-weight:bold;">text</span> }
<span style="color:brown;"># structure of the group</span>
<a name="rncCDGroup" style="color:blue;">CDGroup</a> =
  <span style="font-weight:bold;">element</span> CDGroup {
    <a href="#rncCDGroupName">CDGroupName</a>,
    <a href="#rncCDGroupVersion">CDGroupVersion</a>,
    <a href="#rncCDGroupRevision">CDGroupRevision</a>?,
    <a href="#rncCDGroupURL">CDGroupURL</a>,
    <a href="#rncCDGroupDescription">CDGroupDescription</a>,
    (<a href="#rncCDGroupMember">CDGroupMember</a> | <a href="#rncCDComment">CDComment</a>)*
  }
<a name="rncstart" style="color:blue;">start</a> = <a href="#rncCDGroup">CDGroup</a>


</pre></div>

<div>
  Figure 5.1 <span class="del">DTD</span><span class="new">Relax NG</span>Specification of CDGroups</div></div>
</div>

<div><h5 name="sect_cdgpcdata" id="sect_cdgpcdata">5.4.2.2 Further Requirements of a CDGroup</h5>





<p>The notion of being a valid CDGroup implies that the following
requirements on the content of the elements described by the DTD in
<a href="#fig_omcdsig.dtd">Figure </a> are also met.</p>


<dl>
<dt><small><code>CDGroup</code></small></dt>
<dd><p>The <span>xml</span> element <small><code>CDGroup</code></small> is the outermost
  element in a CDGroup document.</p>
  
</dd>

<dt><small><code>CDGroupName</code></small></dt>
<dd>

<p>The text occurring in the <small><code>CDGroupName</code></small>
  element corresponds to the name of the CDGroup. For the syntactical
  requirements, see <small><code>CDName</code></small> in <a href="#sect_pcdata">Section 5.3.2</a>.</p>
  
</dd>

<dt class="new"><small><code>CDGroupVersion</code></small></dt>
<dt class="new"><small><code>CDGroupRevision</code></small></dt>
<dd class="new">
<p>The text occurring in these elements contains the major and minor
version numbers of the CDGroup.
</p>
</dd>

<dt><small><code>CDGroupURL</code></small></dt>
<dd><p>The text occurring in the <small><code>CDGroupURL</code></small>
  element identifies the location of the CDGroup file, not necessarily
  of the member Content Dictionaries. For the syntactical
  requirements, see <small><code>CDURL</code></small> in <a href="#sect_pcdata">Section 5.3.2</a>.</p>
  
</dd>

<dt><small><code>CDGroupDescription</code></small></dt>
<dd><p>The text occurring in the
<small><code>CDGroupDescription</code></small> element describes the
mathematical area of the CDGroup.</p>
  
</dd>

<dt><small><code>CDGroupMember</code></small></dt>
<dd><p>The <span>xml</span> element <small><code>CDGroupMember</code></small>
  encloses the data identifying each member of the CDGroup.</p>
  
</dd>

<dt><small><code>CDName</code></small></dt><dd><p>The
  text occurring in the <small><code>CDName</code></small> element
  corresponds to the name of a Content Dictionary in the CDGroup. For
  the syntactical requirements, see <small><code>CDName</code></small> in
  <a href="#sect_pcdata">Section 5.3.2</a>.</p>
  
</dd>

<dt><small><code>CDVersion</code></small></dt><dd><p>The
  text occurring in the <small><code>CDVersion</code></small> element
  identifies which version of the Content Dictionary isto be taken as
  member of the CDGroup. This element is optional. In case it is
  missing, the latest version is the one included in the CDGroup.  For
  the syntactical requirements, see <small><code>CDVersion</code></small>
  in <a href="#sect_pcdata">Section 5.3.2</a>.</p>
  
</dd>

<dt><small><code>CDURL</code></small></dt>
<dd>

<p>The text occurring in the <small><code>CDURL</code></small> element
  identifies the location of the Content Dictionary to be taken as
  member of the CDGroup. This element is optional. In case it is
  missing, the location of the CDGroup identified by the element
  <small><code>CDGroupURL</code></small> is assumed.  For the syntactical
  requirements, see <small><code>CDURL</code></small> in <a href="#sect_pcdata">Section 5.3.2</a>.</p>
  
</dd>

<dt><small><code>CDComment</code></small></dt><dd><p>See
  <small><code>CDComment</code></small> in <a href="#sect_pcdata">Section 5.3.2</a>.</p>



</dd>

</dl>








</div>
</div>
</div>

<div><h3 name="cdapprove" id="cdapprove">5.5 Content Dictionaries Reviewing Process</h3>




<p>The <i>OpenMath</i> Society is responsible  for implementing a
review and referee process to assess the accuracy of the mathematical
content of Content Dictionaries.  The status (see <small><code>CDStatus</code></small>)
and/or the version number (see <small><code>CDVersion</code></small> ) of a Content
Dictionary may change as a result of this review process.</p>
</div>






<h2 name="cha_comp" id="cha_comp">
  Chapter 6<br/><i>OpenMath</i> Compliance</h2>



<p>Applications that meet the requirements specified in this chapter may
label themselves as <i><i>OpenMath</i> compliant</i>. <i>OpenMath</i> compliancy is
defined so as to maximize the potential for interoperability amongst
<i>OpenMath</i> applications.</p>

<div><h3 name="sec_compl_encoding" id="sec_compl_encoding">6.1 Encoding</h3>

<p>This standard defines two reference encodings for <i>OpenMath</i>, the binary
encoding and <span>xml</span> encoding,  defined in <a href="#cha_enco">Chapter 4</a>.</p>

<p>As a minimum, an <i>OpenMath</i> compliant application, which accepts or generates
<i>OpenMath</i> objects, <i>must</i> be capable of doing so using  the <span>xml</span> encoding.
The ability to use other encodings is optional.</p>
</div>

<div><h3 name="sec_compl_cd" id="sec_compl_cd">6.2 Content Dictionaries</h3>


<p>An <i>OpenMath</i> compliant application <i>must</i> be able
to support the error Content Dictionary defined in <a href="#errorcd">Appendix A.5</a>.</p>

<p>A compliant application must declare the names and version numbers of
the Content Dictionaries that it supports. Equivalently it may declare
the Content Dictionary Group (or groups) and major version number (not
revision number), rather than listing individual Content Dictionaries.
Applications that support all Content Dictionaries (e.g. renderers)
should refer to the implicit CD Group <small><code>all</code></small>.</p>

<p>If a compliant application supports a Content Dictionary then it must
explicitly declare any symbols in the Content Dictionaries that are not
supported. Phrasebooks are encouraged to support every symbol in the 
Content Dictionaries.</p>

<p>Symbols which are not listed as unsupported are
<i>supported</i> by the application. The meaning of
<i>supported</i> will depend on the application
domain. For example an <i>OpenMath</i> renderer should provide a default display
for any <i>OpenMath</i> object that only references supported symbols, whereas a
Computer Algebra System will be expected to map such an object to a
suitable internal representation, in this system, of this mathematical
object. It is expected that the application's
<i>phrasebooks</i> for supported Content Dictionaries
will be constructed such that propertes of the symbol expressed in the
Content Dictionary are respected as far as possible for the given
application domain. However <i>OpenMath</i> compliance does
<i>not</i> imply any guarantee by the <i>OpenMath</i> Society on
the accuracy of these representations.</p>


<p>Content Dictionaries available from the official <i>OpenMath</i> repository
at www.openmath.org need only be referenced by name, other Content
Dictionaries <i>should</i> be referenced <span class="del">by the URL declared in the
<small><code>CDURL</code></small> field of the Dictionary. This URL may
be used to retrieve the Content Dictionary.</span> <span class="new"/> using the
<small><code>CDBASE</code></small> and the
<small><code>CDName</code></small>.  </p>

<p>When receiving an <i>OpenMath</i> symbol, e.g. <m:math><m:mi>s</m:mi></m:math>,
 that is not supported from a supported Content Dictionary, a
 compliant application will act as if it had received the <i>OpenMath</i> object
 <m:math display="block"><m:mi mathvariant="bold">error</m:mi><m:mo>(</m:mo><m:mi>Unhandled_Symbol</m:mi><m:mo separator="true">,</m:mo><m:mi>s</m:mi><m:mo>)</m:mo></m:math> where
 <small><code>Unhandled_Symbol</code></small> is the symbol from the
 error Content Dictionary.</p>


<p>Similarly if it receives a symbol, e.g. <m:math><m:mi>s</m:mi></m:math>,
from an unsupported Content Dictionary, it will act as if it had
received the <i>OpenMath</i> object <m:math display="block"><m:mi mathvariant="bold">error</m:mi><m:mo>(</m:mo><m:mi>Unsupported_CD</m:mi><m:mo separator="true">,</m:mo><m:mi>s</m:mi><m:mo>)</m:mo></m:math></p>

<p>Finally if the compliant application receives a symbol from a
supported Content Dictionary but with an unknown name, then this must
either be an incorrect object, or possibly the object has been built
using a later version of the Content Dictionary. In either case, the
application will act as if it had received the <i>OpenMath</i> object <m:math display="block"><m:mi mathvariant="bold">error</m:mi><m:mo>(</m:mo><m:mi>Unexpected_Symbol</m:mi><m:mo separator="true">,</m:mo><m:mi>s</m:mi><m:mo>)</m:mo></m:math></p>
</div>

<div><h3 name="sec_comp_lex" id="sec_comp_lex">6.3 Lexical Errors</h3>


<p>The previous section defines the behaviour of a compliant
application upon receiving well formed <i>OpenMath</i> objects containing
unexpected symbols.  This standard does not specify any behaviour for
an application upon receiving ill-formed objects.</p>
</div>


<h2 name="cha_conc" id="cha_conc">
  Chapter 7<br/>Conclusion</h2>



<p>The goal of this document is to define the <i>OpenMath</i> standard. The
things are addressed by the <i>OpenMath</i> standard are:
<ul>
<li><p>Informal and formal definition of the <i>OpenMath</i> objects.</p></li>
<li><p>Informal and formal definition of the notion of Content
  Dictionaries.</p></li>
</ul>
To do this, <i>OpenMath</i> objects are precisely defined and two encodings are
described to represent these objects using <span>xml</span> and
binary code. Furthermore, the Document Type Definition for validating
Content Dictionaries and <i>OpenMath</i> objects is given.</p>





<div><h2 name="app_cdfiles" id="app_cdfiles">
  Appendix A<br/>CD Files</h2>


<div><h3 name="app_cdcd" id="app_cdcd">A.1 The <b>meta</b> Content Dictionary</h3>


<div class="literal"><pre>
&lt;CD&gt;

  &lt;CDName&gt; meta &lt;/CDName&gt;

  &lt;Description&gt; 
    
    This is a content dictionary to represent content dictionaries, so
    that they may be passed between &amp;OM; compliant application in a
    similar way to mathematical objects.  It is acknowledged that this is
    not the only way to do this, but it seems a natural way.
    
    This can be viewed as updating the previous Meta-CD.
    
    The information written here is taken from "The &amp;OM; Standard".
    This document is a slightly stronger statement than "the following
    symbols are defined as in the DTD at
    http://www.nag.co.uk/projects/OpenMath/omstd/dtds/cd.dtd", since the
    DTD often only says that the information inside the elements is PCDATA
    without saying what this actually corresponds to. However this is the
    only way this document is better than the DTD, and thus this is the
    only extra information we give here.
    
    Author: N. Howgrave-Graham
  &lt;/Description&gt;
  
  &lt;CDReviewDate&gt; 1998-10-01 &lt;/CDReviewDate&gt;
  &lt;CDStatus&gt; experimental &lt;/CDStatus&gt;
  &lt;CDURL&gt; http://www.nag.co.uk/projects/OpenMath/omstd/cds/meta.ocd &lt;/CDURL&gt;
  
  &lt;CDComment&gt;
    This is how one uses comments.
    
    This whole document must be valid &amp;exml; which means that we cannot have
    sub-elements inside elements where we are expecting PCDATA. For this
    reason it is suggested that one use the unicode characters when
    clashes occur. For example &amp;lt; and &amp;gt; for less than and more than.
  &lt;/CDComment&gt;
  
  &lt;CDDefinition&gt;
    &lt;Name&gt; CD &lt;/Name&gt;
    &lt;Description&gt;
      The DTD fully specifies the use of the CD tag
    &lt;/Description&gt;
  &lt;/CDDefinition&gt;
  
  &lt;CDDefinition&gt;
    &lt;Name&gt; CDDescription &lt;/Name&gt;
    &lt;Description&gt;
      The DTD fully specifies the use of the CDDescription tag
    &lt;/Description&gt;
  &lt;/CDDefinition&gt;
  
  &lt;CDComment&gt;
    For those that do not have access to the DTD, the tagged entries
    are the following (in no particular order):
    
    &amp;lt;CD&amp;gt;
    &amp;lt;CDName&amp;gt; &amp;lt;/CDName&amp;gt;
    &amp;lt;Description&amp;gt; &amp;lt;/Description&amp;gt;
    &amp;lt;CDReviewDate&amp;gt; &amp;lt;/CDReviewDate&amp;gt;
    &amp;lt;CDStatus&amp;gt; &amp;lt;/CDStatus&amp;gt;
    &amp;lt;CDURL&amp;gt;? &amp;lt;/CDURL&amp;gt;
    &amp;lt;CDUses&amp;gt;? &amp;lt;CDUses&amp;gt;
    &amp;lt;CDDefinition&amp;gt;*
    &amp;lt;Name&amp;gt; &amp;lt;/Name&amp;gt;
    &amp;lt;Description&amp;gt; &amp;lt;/Description&amp;gt;
    &amp;lt;Signature&amp;gt;? &amp;lt;/Signature&amp;gt;
    &amp;lt;Example&amp;gt;* &amp;lt;/Example&amp;gt;
    &amp;lt;FMP&amp;gt;* &amp;lt;/FMP&amp;gt;
    &amp;lt;CMP&amp;gt;* &amp;lt;/CMP&amp;gt;
    &amp;lt;Presentation&amp;gt;? &amp;lt;/Presentation&amp;gt;
    &amp;lt;/CDDefinition&amp;gt;
    
    where an asterisk (?) denotes it can repeated 0 or 1 times, and a star
    (*) denotes 0 or more times.
  &lt;/CDComment&gt;
  
  &lt;CDDefinition&gt;
    &lt;Name&gt; CDName &lt;/Name&gt;
    &lt;Description&gt;
      A tag which contains PCDATA corresponding to the name of the CD.
    &lt;/Description&gt;
  &lt;/CDDefinition&gt;
  
  &lt;CDDefinition&gt;
    &lt;Name&gt; CDURL &lt;/Name&gt;
    &lt;Description&gt;
      An optional tag which contains PCDATA corresponding to the URL where
      the CD is stored.
    &lt;/Description&gt;
  &lt;/CDDefinition&gt;
  
  &lt;CDDefinition&gt;
    &lt;Name&gt; Example &lt;/Name&gt;
    &lt;Description&gt;
      A tag which contains PCDATA to give an example of the
      enclosing symbol definition.
    &lt;/Description&gt;
  &lt;/CDDefinition&gt;
  
  &lt;CDDefinition&gt;
    &lt;Name&gt; CDReviewDate &lt;/Name&gt;
    &lt;Description&gt;
      A tag which contains PCDATA to give an expiry date of
      the CD.  It should be in the form of ISO-8601, i.e. YYYY-MM-DD
    &lt;/Description&gt;
  &lt;/CDDefinition&gt;
  
  &lt;CDDefinition&gt;
    &lt;Name&gt; CDStatus &lt;/Name&gt;
    &lt;Description&gt;
      A tag which contains PCDATA to give information on the
      status of the CD. This can be either official (approved by the
      &amp;OM; steering committee), experimental (currently being tested),
      private (used by a private group of &amp;OM; users) or obsolete
      (an obsolete CD kept only for archival purposes).
    &lt;/Description&gt;
  &lt;/CDDefinition&gt;
  
  &lt;CDDefinition&gt;
    &lt;Name&gt; CDUses &lt;/Name&gt;
    &lt;Description&gt;
      A tag which contains zero or more CDNames which correspond
      to the CD's that this CD depends on. This makes an inheritance
      structure for CD's. If the CD is dependent on any other CD's they must
be present here.
&lt;/Description&gt;
&lt;/CDDefinition&gt;

&lt;CDDefinition&gt;
  &lt;Name&gt; CDTypeUses &lt;/Name&gt;
  &lt;Description&gt;
    A tag which contains zero or more CDNames which correspond
    to the CD's that hold type information that this CD depends on. This
    makes an inheritance type structure for CD's. If the CD types are
    dependent on any other CD's they must be present here. For application
    that do not respect types, this symbol can be ignored.
  &lt;/Description&gt;
&lt;/CDDefinition&gt;

&lt;CDDefinition&gt;
  &lt;Name&gt; Description &lt;/Name&gt;
  &lt;Description&gt;
    A tag which contains PCDATA corresponding to the
    description of either the CD or the symbol (depending on which is the
    enclosing element).
  &lt;/Description&gt;
&lt;/CDDefinition&gt;

&lt;CDDefinition&gt;
  &lt;Name&gt; Name &lt;/Name&gt;
  &lt;Description&gt;
    A tag which contains PCDATA corresponding to the name of
    the symbol being defined.
  &lt;/Description&gt;
&lt;/CDDefinition&gt;

&lt;CDDefinition&gt;
  &lt;Name&gt; Signature &lt;/Name&gt;
  &lt;Description&gt;
    An optional tag which contains PCDATA corresponding to
    the type of the symbol being defined. This type information will be
    an &amp;OM; type object as defined in chapter 5 of "First Draft of the
    &amp;OM; Standard".
  &lt;/Description&gt;
&lt;/CDDefinition&gt;

&lt;CDDefinition&gt;
  &lt;Name&gt; Presentation &lt;/Name&gt;
  &lt;Description&gt;
    An optional tag (which may be repeated many times) which contains
    PCDATA corresponding to a way of presenting the symbol being defined.
  &lt;/Description&gt;
&lt;/CDDefinition&gt;

&lt;CDDefinition&gt;
  &lt;Name&gt; CMP &lt;/Name&gt;
  &lt;Description&gt;
    An optional tag (which may be repeated many times) which contains
    PCDATA corresponding to a property of the symbol being
    defined.
  &lt;/Description&gt;
&lt;/CDDefinition&gt;

&lt;CDDefinition&gt;
  &lt;Name&gt; FMP &lt;/Name&gt;
  &lt;Description&gt;
    An optional tag (which may be repeated many times) which contains
    PCDATA corresponding to a property of the symbol being
    defined. This property must be a valid &amp;OM; object.
  &lt;/Description&gt;
&lt;/CDDefinition&gt;

&lt;/CD&gt;
</pre></div>
</div>

<div><h3 name="arith1.ocd" id="arith1.ocd">A.2 The  <b>arith1</b> Content Dictionary File</h3>
  
  
  
  <div class="literal"><pre>
  &lt;CD&gt;
    &lt;CDName&gt; arith1 &lt;/CDName&gt;
    &lt;CDURL&gt; http://www.openmath.org/cd/arith1.ocd &lt;/CDURL&gt;
    &lt;CDReviewDate&gt; 2003-04-01 &lt;/CDReviewDate&gt;
    &lt;CDStatus&gt; official &lt;/CDStatus&gt;
    &lt;CDDate&gt; 2001-03-12 &lt;/CDDate&gt;
    &lt;CDVersion&gt; 2 &lt;/CDVersion&gt;
    &lt;CDRevision&gt; 0 &lt;/CDRevision&gt;
    
    &lt;Description&gt; 
      This CD defines symbols for common arithmetic functions.
    &lt;/Description&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; lcm &lt;/Name&gt;
      &lt;Description&gt; 
	The symbol to represent the n-ary function to return the least common
	multiple of its arguments.
      &lt;/Description&gt;
      
      &lt;CMP&gt; lcm(a,b) = a*b/gcd(a,b) &lt;/CMP&gt;
      
      &lt;FMP&gt;
	&lt;OMOBJ&gt;
	  &lt;OMA&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="lcm"/&gt;
	      &lt;OMV name="a"/&gt;
	      &lt;OMV name="b"/&gt;
	    &lt;/OMA&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="divide"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="times"/&gt;
		&lt;OMV name="a"/&gt;
		&lt;OMV name="b"/&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="gcd"/&gt;
		&lt;OMV name="a"/&gt;
		&lt;OMV name="b"/&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMA&gt;
	&lt;/OMOBJ&gt;
      &lt;/FMP&gt;
      &lt;CMP&gt;
	for all integers a,b |
	There does not exist a c&gt;0 such that c/a is an Integer and c/b is an
	Integer and lcm(a,b) &gt; c.
      &lt;/CMP&gt;
      
      &lt;FMP&gt;
	&lt;OMOBJ&gt;
	  &lt;OMBIND&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="quant1" name="forall"/&gt;
	    &lt;OMBVAR&gt;
	      &lt;OMV name="a"/&gt;
	      &lt;OMV name="b"/&gt;
	    &lt;/OMBVAR&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="implies"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="and"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="set1" name="in"/&gt;
		  &lt;OMV name="a"/&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="setname1" name="Z"/&gt;
		&lt;/OMA&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="set1" name="in"/&gt;
		  &lt;OMV name="b"/&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="setname1" name="Z"/&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="not"/&gt;
		&lt;OMBIND&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="quant1" name="exists"/&gt;
		  &lt;OMBVAR&gt;
		    &lt;OMV name="c"/&gt;
		  &lt;/OMBVAR&gt;
		  &lt;OMA&gt;
		    &lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="and"/&gt;
		    &lt;OMA&gt;
		      &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="gt"/&gt;
		      &lt;OMV name="c"/&gt;
		      &lt;OMI&gt;0&lt;/OMI&gt;
		    &lt;/OMA&gt;
		    &lt;OMA&gt;
		      &lt;OMS cdbase="http://www.openmath.org/cd" cd="integer1" name="factorof"/&gt;
		      &lt;OMV name="a"/&gt;
		      &lt;OMV name="c"/&gt;
		    &lt;/OMA&gt;
		    &lt;OMA&gt;
		      &lt;OMS cdbase="http://www.openmath.org/cd" cd="integer1" name="factorof"/&gt;
		      &lt;OMV name="b"/&gt;
		      &lt;OMV name="c"/&gt;
		    &lt;/OMA&gt;
		    &lt;OMA&gt;
		      &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="lt"/&gt;
		      &lt;OMV name="c"/&gt;
		      &lt;OMA&gt;
			&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="lcm"/&gt;
			&lt;OMV name="a"/&gt;
			&lt;OMV name="b"/&gt;
		      &lt;/OMA&gt;
		    &lt;/OMA&gt;
		  &lt;/OMA&gt;
		&lt;/OMBIND&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMBIND&gt;
	&lt;/OMOBJ&gt;
      &lt;/FMP&gt;
    &lt;/CDDefinition&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; gcd &lt;/Name&gt;
      &lt;Description&gt; 
	The symbol to represent the n-ary function to return the gcd (greatest
	common divisor) of its arguments.
      &lt;/Description&gt;
      
      &lt;CMP&gt;
	for all integers a,b |
	There does not exist a c such that a/c is an Integer and b/c is an
	Integer and c &gt; gcd(a,b).
	
	Note that this implies that gcd(a,b) &gt; 0
      &lt;/CMP&gt;
      
      &lt;FMP&gt;
	&lt;OMOBJ&gt;
	  &lt;OMBIND&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="quant1" name="forall"/&gt;
	    &lt;OMBVAR&gt;
	      &lt;OMV name="a"/&gt;
	      &lt;OMV name="b"/&gt;
	    &lt;/OMBVAR&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="implies"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="and"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="set1" name="in"/&gt;
		  &lt;OMV name="a"/&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="setname1" name="Z"/&gt;
		&lt;/OMA&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="set1" name="in"/&gt;
		  &lt;OMV name="b"/&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="setname1" name="Z"/&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="not"/&gt;
		&lt;OMBIND&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="quant1" name="exists"/&gt;
		  &lt;OMBVAR&gt;
		    &lt;OMV name="c"/&gt;
		  &lt;/OMBVAR&gt;
		  &lt;OMA&gt;
		    &lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="and"/&gt;
		    &lt;OMA&gt;
		      &lt;OMS cdbase="http://www.openmath.org/cd" cd="set1" name="in"/&gt;
		      &lt;OMA&gt;
			&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="divide"/&gt;
			&lt;OMV name="a"/&gt;
			&lt;OMV name="c"/&gt;
		      &lt;/OMA&gt;
		      &lt;OMS cdbase="http://www.openmath.org/cd" cd="setname1" name="Z"/&gt;
		    &lt;/OMA&gt;
		    &lt;OMA&gt;
		      &lt;OMS cdbase="http://www.openmath.org/cd" cd="set1" name="in"/&gt;
		      &lt;OMA&gt;
			&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="divide"/&gt;
			&lt;OMV name="b"/&gt;
			&lt;OMV name="c"/&gt;
		      &lt;/OMA&gt;
		      &lt;OMS cdbase="http://www.openmath.org/cd" cd="setname1" name="Z"/&gt;
		    &lt;/OMA&gt;
		    &lt;OMA&gt;
		      &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="gt"/&gt;
		      &lt;OMV name="c"/&gt;
		      &lt;OMA&gt;
			&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="gcd"/&gt;
			&lt;OMV name="a"/&gt;
			&lt;OMV name="b"/&gt;
		      &lt;/OMA&gt;
		    &lt;/OMA&gt;
		  &lt;/OMA&gt;
		&lt;/OMBIND&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMBIND&gt;
	&lt;/OMOBJ&gt;
      &lt;/FMP&gt;
      
      &lt;Example&gt;
	gcd(6,9) = 3
	&lt;OMOBJ&gt;
	  &lt;OMA&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="gcd"/&gt;
	      &lt;OMI&gt; 6 &lt;/OMI&gt;
	      &lt;OMI&gt; 9 &lt;/OMI&gt;
	    &lt;/OMA&gt;
	    &lt;OMI&gt; 3 &lt;/OMI&gt;
	  &lt;/OMA&gt;
	&lt;/OMOBJ&gt;
      &lt;/Example&gt;
    &lt;/CDDefinition&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; plus &lt;/Name&gt;
      &lt;Description&gt;
	The symbol representing an n-ary commutative function plus.
      &lt;/Description&gt;
      &lt;CMP&gt; for all a,b | a + b = b + a &lt;/CMP&gt;
      &lt;FMP&gt;
	&lt;OMOBJ&gt;
	  &lt;OMBIND&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="quant1" name="forall"/&gt;
	    &lt;OMBVAR&gt;
	      &lt;OMV name="a"/&gt;
	      &lt;OMV name="b"/&gt;
	    &lt;/OMBVAR&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="plus"/&gt;
		&lt;OMV name="a"/&gt;
		&lt;OMV name="b"/&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="plus"/&gt;
		&lt;OMV name="b"/&gt;
		&lt;OMV name="a"/&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMBIND&gt;
	&lt;/OMOBJ&gt;
      &lt;/FMP&gt;
    &lt;/CDDefinition&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; unary_minus &lt;/Name&gt;
      &lt;Description&gt; 
	This symbol denotes unary minus, i.e. the additive inverse.
      &lt;/Description&gt;
      &lt;CMP&gt; for all a | a + (-a) = 0 &lt;/CMP&gt;
      &lt;FMP&gt;
	&lt;OMOBJ&gt;
	  &lt;OMBIND&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="quant1" name="forall"/&gt;
	    &lt;OMBVAR&gt;
	      &lt;OMV name="a"/&gt;
	    &lt;/OMBVAR&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="plus"/&gt;
		&lt;OMV name="a"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="unary_minus"/&gt;
		  &lt;OMV name="a"/&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="alg1" name="zero"/&gt;
	    &lt;/OMA&gt;
	  &lt;/OMBIND&gt;
	&lt;/OMOBJ&gt;
      &lt;/FMP&gt;
    &lt;/CDDefinition&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; minus &lt;/Name&gt;
      &lt;Description&gt; 
	The symbol representing a binary minus function. This is equivalent to
	adding the additive inverse.
      &lt;/Description&gt;
      &lt;CMP&gt; for all a,b | a - b = a + (-b) &lt;/CMP&gt;
      &lt;FMP&gt;
	&lt;OMOBJ&gt;
	  &lt;OMBIND&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="quant1" name="forall"/&gt;
	    &lt;OMBVAR&gt;
	      &lt;OMV name="a"/&gt;
	      &lt;OMV name="b"/&gt;
	    &lt;/OMBVAR&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="minus"/&gt;
		&lt;OMV name="a"/&gt;
		&lt;OMV name="b"/&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="plus"/&gt;
		&lt;OMV name="a"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="unary_minus"/&gt;
		  &lt;OMV name="b"/&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMBIND&gt;
	&lt;/OMOBJ&gt;
      &lt;/FMP&gt;
    &lt;/CDDefinition&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; times &lt;/Name&gt;
      &lt;Description&gt; 
	The symbol representing an n-ary multiplication function.
      &lt;/Description&gt;
      &lt;Example&gt;
	&lt;OMOBJ&gt;
	  &lt;OMA&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="times"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrix"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrixrow"/&gt;
		  &lt;OMI&gt; 1 &lt;/OMI&gt;
		  &lt;OMI&gt; 2 &lt;/OMI&gt;
		&lt;/OMA&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrixrow"/&gt;
		  &lt;OMI&gt; 3 &lt;/OMI&gt;
		  &lt;OMI&gt; 4 &lt;/OMI&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrix"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrixrow"/&gt;
		  &lt;OMI&gt; 5 &lt;/OMI&gt;
		  &lt;OMI&gt; 6 &lt;/OMI&gt;
		&lt;/OMA&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrixrow"/&gt;
		  &lt;OMI&gt; 7 &lt;/OMI&gt;
		  &lt;OMI&gt; 8 &lt;/OMI&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrix"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrixrow"/&gt;
		&lt;OMI&gt; 19 &lt;/OMI&gt;
		&lt;OMI&gt; 20 &lt;/OMI&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrixrow"/&gt;
		&lt;OMI&gt; 43 &lt;/OMI&gt;
		&lt;OMI&gt; 50 &lt;/OMI&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMA&gt;
	&lt;/OMOBJ&gt;
      &lt;/Example&gt;
      &lt;CMP&gt; for all a,b | a * 0 = 0 and a * b = a * (b - 1) + a &lt;/CMP&gt;
      
      &lt;FMP&gt;&lt;OMOBJ&gt;
	  &lt;OMBIND&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="quant1" name="forall"/&gt;
	    &lt;OMBVAR&gt;
	      &lt;OMV name="a"/&gt;
	      &lt;OMV name="b"/&gt;
	    &lt;/OMBVAR&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="and"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="times"/&gt;
		  &lt;OMV name="a"/&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="alg1" name="zero"/&gt;
		&lt;/OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="alg1" name="zero"/&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="times"/&gt;
		  &lt;OMV name="a"/&gt;
		  &lt;OMV name="b"/&gt;
		&lt;/OMA&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="plus"/&gt;
		  &lt;OMA&gt;
		    &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="times"/&gt;
		    &lt;OMV name="a"/&gt;
		    &lt;OMA&gt;
		      &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="minus"/&gt;
		      &lt;OMV name="b"/&gt;
		      &lt;OMS cdbase="http://www.openmath.org/cd" cd="alg1" name="one"/&gt;
		    &lt;/OMA&gt;
		  &lt;/OMA&gt;
		  &lt;OMV name="a"/&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMBIND&gt;
	&lt;/OMOBJ&gt;&lt;/FMP&gt;
      
      &lt;CMP&gt; for all a,b,c | a*(b+c) = a*b + a*c &lt;/CMP&gt;
      &lt;FMP&gt;&lt;OMOBJ&gt;
	  &lt;OMBIND&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="quant1" name="forall"/&gt;
	    &lt;OMBVAR&gt;
	      &lt;OMV name="a"/&gt;
	      &lt;OMV name="b"/&gt;
	      &lt;OMV name="c"/&gt;
	    &lt;/OMBVAR&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="times"/&gt;
		&lt;OMV name="a"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="plus"/&gt;
		  &lt;OMV name="b"/&gt;
		  &lt;OMV name="c"/&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="plus"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="times"/&gt;
		  &lt;OMV name="a"/&gt;
		  &lt;OMV name="b"/&gt;
		&lt;/OMA&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="times"/&gt;
		  &lt;OMV name="a"/&gt;
		  &lt;OMV name="c"/&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMBIND&gt;
	&lt;/OMOBJ&gt;&lt;/FMP&gt;
    &lt;/CDDefinition&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; divide &lt;/Name&gt;
      &lt;Description&gt;
	This symbol represents a (binary) division function denoting the first argument
	right-divided by the second, i.e. divide(a,b)=a*inverse(b). It is the
	inverse of the multiplication function defined by the symbol times in this CD.
      &lt;/Description&gt;
      &lt;CMP&gt; whenever not(a=0) then a/a = 1 &lt;/CMP&gt;
      &lt;FMP&gt;
	&lt;OMOBJ&gt;
	  &lt;OMBIND&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="quant1" name="forall"/&gt;
	    &lt;OMBVAR&gt;
	      &lt;OMV name="a"/&gt;
	    &lt;/OMBVAR&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="implies"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="neq"/&gt;
		&lt;OMV name="a"/&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="alg1" name="zero"/&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="divide"/&gt;
		  &lt;OMV name="a"/&gt;
		  &lt;OMV name="a"/&gt;
		&lt;/OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="alg1" name="one"/&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMBIND&gt;
	&lt;/OMOBJ&gt;
      &lt;/FMP&gt;
    &lt;/CDDefinition&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; power &lt;/Name&gt;
      &lt;Description&gt;
	This symbol represents a power function. The first argument is raised
	to the power of the second argument. When the second argument is not
	an integer, powering is defined in terms of exponentials and 
	logarithms for the complex and real numbers.
	This operator can represent general powering.
      &lt;/Description&gt;
      
      &lt;CMP&gt;
	x\in C implies x^a = exp(a ln x)
      &lt;/CMP&gt;
      
      &lt;FMP&gt;
	&lt;OMOBJ&gt;
	  &lt;OMA&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="implies"/&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="set1" name="in"/&gt;
	      &lt;OMV name="x"/&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="setname1" name="C"/&gt;
	    &lt;/OMA&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" name="power" cd="arith1"/&gt;
		&lt;OMV name="x"/&gt;
		&lt;OMV name="a"/&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" name="exp" cd="transc1"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" name="times" cd="arith1"/&gt;
		  &lt;OMV name="a"/&gt;
		  &lt;OMA&gt;
		    &lt;OMS cdbase="http://www.openmath.org/cd" name="ln" cd="transc1"/&gt;
		    &lt;OMV name="x"/&gt;
		  &lt;/OMA&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMA&gt;
	&lt;/OMOBJ&gt;
      &lt;/FMP&gt;
      
      &lt;CMP&gt;
	if n is an integer then
	x^0 = 1,
	x^n = x * x^(n-1)
      &lt;/CMP&gt;
      &lt;FMP&gt;
	&lt;OMOBJ&gt;
	  &lt;OMA&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="implies"/&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="set1" name="in"/&gt;
	      &lt;OMV name="n"/&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="setname1" name="Z"/&gt;
	    &lt;/OMA&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="and"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="power"/&gt;
		  &lt;OMV name="x"/&gt;
		  &lt;OMI&gt;0&lt;/OMI&gt;
		&lt;/OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="alg1" name="one"/&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="power"/&gt;
		  &lt;OMV name="x"/&gt;
		  &lt;OMV name="n"/&gt;
		&lt;/OMA&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="times"/&gt;
		  &lt;OMV name="x"/&gt;
		  &lt;OMA&gt;
		    &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="power"/&gt;
		    &lt;OMV name="x"/&gt;
		    &lt;OMA&gt;
		      &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="minus"/&gt;
		      &lt;OMV name="n"/&gt;
		      &lt;OMI&gt;1&lt;/OMI&gt;
		    &lt;/OMA&gt;
		  &lt;/OMA&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMA&gt;
	&lt;/OMOBJ&gt;
      &lt;/FMP&gt;
      &lt;Example&gt;
	&lt;OMOBJ&gt;
	  &lt;OMA&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="power"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrix"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrixrow"/&gt;
		  &lt;OMI&gt; 1 &lt;/OMI&gt;
		  &lt;OMI&gt; 2 &lt;/OMI&gt;
		&lt;/OMA&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrixrow"/&gt;
		  &lt;OMI&gt; 3 &lt;/OMI&gt;
		  &lt;OMI&gt; 4 &lt;/OMI&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	      &lt;OMI&gt;3&lt;/OMI&gt;
	    &lt;/OMA&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrix"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrixrow"/&gt;
		&lt;OMI&gt; 37 &lt;/OMI&gt;
		&lt;OMI&gt; 54 &lt;/OMI&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="linalg2" name="matrixrow"/&gt;
		&lt;OMI&gt; 81 &lt;/OMI&gt;
		&lt;OMI&gt; 118 &lt;/OMI&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMA&gt;
	&lt;/OMOBJ&gt;
      &lt;/Example&gt;
      &lt;Example&gt;
	&lt;OMOBJ&gt;
	  &lt;OMA&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="power"/&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="nums1" name="e"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="times"/&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="nums1" name="i"/&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="nums1" name="pi"/&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="unary_minus"/&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="alg1" name="one"/&gt;
	    &lt;/OMA&gt;
	  &lt;/OMA&gt;
	&lt;/OMOBJ&gt;
      &lt;/Example&gt;
    &lt;/CDDefinition&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; abs &lt;/Name&gt;
      &lt;Description&gt; 
	A unary operator which represents the absolute value of its
	argument. The argument should be numerically valued.
	In the complex case this is often referred to as the modulus.
      &lt;/Description&gt;
      &lt;CMP&gt; for all x,y | abs(x) + abs(y) &gt;= abs(x+y) &lt;/CMP&gt;
      &lt;FMP&gt;
	&lt;OMOBJ&gt;
	  &lt;OMBIND&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="quant1" name="forall"/&gt;
	    &lt;OMBVAR&gt;
	      &lt;OMV name="x"/&gt;
	      &lt;OMV name="y"/&gt;
	    &lt;/OMBVAR&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="geq"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="plus"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="abs"/&gt;
		  &lt;OMV name="x"/&gt;
		  &lt;OMV name="y"/&gt;
		&lt;/OMA&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="abs"/&gt;
		  &lt;OMV name="x"/&gt;
		  &lt;OMV name="y"/&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="abs"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="plus"/&gt;
		  &lt;OMV name="x"/&gt;
		  &lt;OMV name="y"/&gt;
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMBIND&gt;
	&lt;/OMOBJ&gt;
      &lt;/FMP&gt;
    &lt;/CDDefinition&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; root &lt;/Name&gt;
      &lt;Description&gt; 
	A binary operator which represents its first argument "lowered" to its
	n'th root where n is the second argument. This is the inverse of the operation
	represented by the power symbol defined in this CD.
	
	Care should be taken as to the precise meaning of this operator, in
	particular which root is represented, however it is here to represent
	the general notion of taking n'th roots. As inferred by the signature
	relevant to this symbol, the function represented by this symbol is
	the single valued function, the specific root returned is the one
	indicated by the first CMP. Note also that the converse of the second
	CMP is not valid in general.
      &lt;/Description&gt;
      
      &lt;CMP&gt; x\in C implies root(x,n) = exp(ln(x)/n) &lt;/CMP&gt;
      &lt;FMP&gt;
	&lt;OMOBJ&gt;
	  &lt;OMA&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="logic1" name="implies"/&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="set1" name="in"/&gt;
	      &lt;OMV name="x"/&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="setname1" name="C"/&gt;
	    &lt;/OMA&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="root"/&gt;
		&lt;OMV name="x"/&gt;
		&lt;OMV name="n"/&gt;          
	      &lt;/OMA&gt;
	      &lt;OMA&gt;
		&lt;OMS name="exp" cd="transc1"/&gt;
		&lt;OMA&gt;
		  &lt;OMS name="divide" cd="arith1"/&gt;
		  &lt;OMA&gt;
		    &lt;OMS name="ln" cd="transc1"/&gt;
		    &lt;OMV name="x"/&gt;
		  &lt;/OMA&gt;
		  &lt;OMV name="n"/&gt;          
		&lt;/OMA&gt;
	      &lt;/OMA&gt;
	    &lt;/OMA&gt;
	  &lt;/OMA&gt;
	&lt;/OMOBJ&gt;
      &lt;/FMP&gt;
      
      &lt;CMP&gt; for all a,n | power(root(a,n),n) = a (if the root exists!) &lt;/CMP&gt;
      &lt;FMP&gt;
	&lt;OMOBJ&gt;
	  &lt;OMBIND&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="quant1" name="forall"/&gt;
	    &lt;OMBVAR&gt;
	      &lt;OMV name="a"/&gt;
	      &lt;OMV name="n"/&gt;
	    &lt;/OMBVAR&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="power"/&gt;
		&lt;OMA&gt;
		  &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="root"/&gt;
		  &lt;OMV name="a"/&gt;
		  &lt;OMV name="n"/&gt;
		&lt;/OMA&gt;
		&lt;OMV name="n"/&gt;
	      &lt;/OMA&gt;
	      &lt;OMV name="a"/&gt;
	    &lt;/OMA&gt;
	  &lt;/OMBIND&gt;
	&lt;/OMOBJ&gt;
      &lt;/FMP&gt;
    &lt;/CDDefinition&gt;
    
    
    
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; sum &lt;/Name&gt;
      &lt;Description&gt;
	An operator taking two arguments, the first being the range of summation,
	e.g. an integral interval, the second being the function to be
	summed. Note that the sum may be over an infinite interval.
      &lt;/Description&gt;
      &lt;Example&gt;
	This represents the summation of the reciprocals of all the integers between
	1 and 10 inclusive.
	&lt;OMOBJ&gt;
	  &lt;OMA&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="sum"/&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="interval1" name="integer_interval"/&gt;
	      &lt;OMI&gt; 1 &lt;/OMI&gt;
	      &lt;OMI&gt; 10 &lt;/OMI&gt;
	    &lt;/OMA&gt;
	    &lt;OMBIND&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="fns1" name="lambda"/&gt;
	      &lt;OMBVAR&gt;
		&lt;OMV name="x"/&gt;
	      &lt;/OMBVAR&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="divide"/&gt;
		&lt;OMI&gt; 1 &lt;/OMI&gt;
		&lt;OMV name="x"/&gt;
	      &lt;/OMA&gt;
	    &lt;/OMBIND&gt;
	  &lt;/OMA&gt;
	&lt;/OMOBJ&gt;
      &lt;/Example&gt;
    &lt;/CDDefinition&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; product &lt;/Name&gt;
      &lt;Description&gt;
	An operator taking two arguments, the first being the range of multiplication
	e.g. an integral interval, the second being the function to
	be multiplied. Note that the product may be over an infinite interval. 
      &lt;/Description&gt;
      &lt;Example&gt;
	This represents the statement that the factorial of n is equal to the product
	of all the integers between 1 and n inclusive.
	&lt;OMOBJ&gt;
	  &lt;OMA&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="relation1" name="eq"/&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="integer1" name="factorial"/&gt;
	      &lt;OMV name="n" /&gt;
	    &lt;/OMA&gt;
	    &lt;OMA&gt;
	      &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="product"/&gt;
	      &lt;OMA&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="interval1" name="integer_interval"/&gt;
		&lt;OMI&gt; 1 &lt;/OMI&gt;
		&lt;OMV name="n"/&gt;
	      &lt;/OMA&gt;
	      &lt;OMBIND&gt;
		&lt;OMS cdbase="http://www.openmath.org/cd" cd="fns1" name="lambda"/&gt;
		&lt;OMBVAR&gt;
		  &lt;OMV name="i"/&gt;
		&lt;/OMBVAR&gt;
		&lt;OMV name="i"/&gt;
	      &lt;/OMBIND&gt;
	    &lt;/OMA&gt;
	  &lt;/OMA&gt;
	&lt;/OMOBJ&gt;
      &lt;/Example&gt;
    &lt;/CDDefinition&gt;
    
  &lt;/CD&gt;
</pre></div>

</div>

<div><h3 name="arith1.sts" id="arith1.sts">A.3 The  <b>arith1</b> STS Signature File</h3>
  
  
  
  
  <div class="literal"><pre>
  &lt;CDSignatures type="sts" cd="arith1"&gt;
    
    &lt;CDSComment&gt;
      Date:  1999-11-26
      Author: David Carlisle
    &lt;/CDSComment&gt;
    
    &lt;Signature name="lcm" &gt;
      &lt;OMOBJ&gt;
	&lt;OMA&gt;
	  &lt;OMS name="mapsto" cd="sts" /&gt;
	  &lt;OMA&gt;
	    &lt;OMS name="nassoc" cd="sts"/&gt;
	    &lt;OMV name="SemiGroup"/&gt;
	  &lt;/OMA&gt;
	  &lt;OMV name="SemiGroup" /&gt;
	&lt;/OMA&gt;
      &lt;/OMOBJ&gt;
    &lt;/Signature&gt;
    
    &lt;Signature name="gcd" &gt;
      &lt;OMOBJ&gt;
	&lt;OMA&gt;
	  &lt;OMS name="mapsto" cd="sts" /&gt;
	  &lt;OMA&gt;
	    &lt;OMS name="nassoc" cd="sts"/&gt;
	    &lt;OMV name="SemiGroup"/&gt;
	  &lt;/OMA&gt;
	  &lt;OMV name="SemiGroup" /&gt;
	&lt;/OMA&gt;
      &lt;/OMOBJ&gt;
    &lt;/Signature&gt;
    
    &lt;Signature name="plus"&gt;
      &lt;OMOBJ&gt;
	&lt;OMA&gt;
	  &lt;OMS name="mapsto" cd="sts"/&gt;
	  &lt;OMA&gt;
	    &lt;OMS name="nassoc" cd="sts"/&gt; 
	    &lt;OMV name="AbelianSemiGroup"/&gt;
	  &lt;/OMA&gt;
	  &lt;OMV name="AbelianSemiGroup"/&gt;
	&lt;/OMA&gt;
      &lt;/OMOBJ&gt;
    &lt;/Signature&gt;
    
    &lt;Signature name="unary_minus"&gt;
      &lt;OMOBJ&gt;
	&lt;OMA&gt;
	  &lt;OMS name="mapsto" cd="sts"/&gt;
	  &lt;OMV name="AbelianGroup"/&gt; 
	  &lt;OMV name="AbelianGroup"/&gt; 
	&lt;/OMA&gt;
      &lt;/OMOBJ&gt;
    &lt;/Signature&gt;
    
    &lt;Signature name="minus"&gt;
      &lt;OMOBJ&gt;
	&lt;OMA&gt;
	  &lt;OMS name="mapsto" cd="sts"/&gt;
	  &lt;OMV name="AbelianGroup"/&gt; 
	  &lt;OMV name="AbelianGroup"/&gt; 
	  &lt;OMV name="AbelianGroup"/&gt; 
	&lt;/OMA&gt;
      &lt;/OMOBJ&gt;
    &lt;/Signature&gt;
    
    &lt;Signature name="times"&gt;
      &lt;OMOBJ&gt;
	&lt;OMA&gt;
	  &lt;OMS name="mapsto" cd="sts"/&gt;
	  &lt;OMA&gt;
	    &lt;OMS name="nassoc" cd="sts"/&gt; 
	    &lt;OMV name="SemiGroup"/&gt;
	  &lt;/OMA&gt;
	  &lt;OMV name="SemiGroup"/&gt;
	&lt;/OMA&gt;
      &lt;/OMOBJ&gt;
    &lt;/Signature&gt;
    
    &lt;Signature name="divide"&gt;
      &lt;OMOBJ&gt;
	&lt;OMA&gt;
	  &lt;OMS name="mapsto" cd="sts"/&gt;
	  &lt;OMV name="AbelianGroup"/&gt; 
	  &lt;OMV name="AbelianGroup"/&gt; 
	  &lt;OMV name="AbelianGroup"/&gt; 
	&lt;/OMA&gt;
      &lt;/OMOBJ&gt;
    &lt;/Signature&gt;
    
    &lt;Signature name="power"&gt;
      &lt;OMOBJ&gt;
	&lt;OMA&gt;
	  &lt;OMS name="mapsto" cd="sts"/&gt;
	  &lt;OMS name="NumericalValue" cd="sts"/&gt; 
	  &lt;OMS name="NumericalValue" cd="sts"/&gt; 
	  &lt;OMS name="NumericalValue" cd="sts"/&gt; 
	&lt;/OMA&gt;
      &lt;/OMOBJ&gt;
    &lt;/Signature&gt;
    
    &lt;Signature name="abs"&gt;
      &lt;OMOBJ&gt;
	&lt;OMA&gt;
	  &lt;OMS name="mapsto" cd="sts"/&gt;
	  &lt;OMS name="C" cd="setname1"/&gt; 
	  &lt;OMS name="R" cd="setname1"/&gt; 
	&lt;/OMA&gt;
      &lt;/OMOBJ&gt;
    &lt;/Signature&gt;
    
    &lt;Signature name="root"&gt;
      &lt;OMOBJ&gt;
	&lt;OMA&gt;
	  &lt;OMS name="mapsto" cd="sts"/&gt;
	  &lt;OMS name="NumericalValue" cd="sts"/&gt; 
	  &lt;OMS name="NumericalValue" cd="sts"/&gt; 
	  &lt;OMS name="NumericalValue" cd="sts"/&gt; 
	&lt;/OMA&gt;
      &lt;/OMOBJ&gt;
    &lt;/Signature&gt;
    
    
    &lt;Signature name="sum" &gt;
      &lt;OMOBJ&gt;
	&lt;OMA&gt;
	  &lt;OMS name="mapsto" cd="sts" /&gt;
	  &lt;OMV name="IntegerRange" /&gt;
	  &lt;OMA&gt;
	    &lt;OMS name="mapsto" cd="sts" /&gt;
	    &lt;OMS name="Z" cd="setname1" /&gt;
	    &lt;OMV name="AbelianMonoid" /&gt;
	  &lt;/OMA&gt;
	  &lt;OMV name="AbelianMonoid" /&gt;
	&lt;/OMA&gt;
      &lt;/OMOBJ&gt;
    &lt;/Signature&gt;
    
    &lt;Signature name="product" &gt;
      &lt;OMOBJ&gt;
	&lt;OMA&gt;
	  &lt;OMS name="mapsto" cd="sts" /&gt;
	  &lt;OMV name="IntegerRange" /&gt;
	  &lt;OMA&gt;
	    &lt;OMS name="mapsto" cd="sts" /&gt;
	    &lt;OMS name="Z" cd="setname1" /&gt;
	    &lt;OMV name="AbelianMonoid" /&gt;
	  &lt;/OMA&gt;
	  &lt;OMV name="AbelianMonoid" /&gt;
	&lt;/OMA&gt;
      &lt;/OMOBJ&gt;
    &lt;/Signature&gt;
    
  &lt;/CDSignatures&gt;
</pre></div>

</div>

<div><h3 name="mathml.cdg" id="mathml.cdg">A.4 The  <b>MathML</b> CDGroup</h3>
  
  
  
  <div class="literal"><pre>
  &lt;CDGroup&gt;
    &lt;CDGroupName&gt;mathml&lt;/CDGroupName&gt;
    &lt;CDGroupVersion&gt; 2 &lt;/CDGroupVersion&gt;
    &lt;CDGroupRevision&gt; 0 &lt;/CDGroupRevision&gt;
    &lt;CDGroupURL&gt;
      http://www.openmath.org/cdfiles/cdgroups/mathml.ocd&lt;/CDGroupURL&gt;
    &lt;CDGroupDescription&gt; MathML compatibility CD Group &lt;/CDGroupDescription&gt;
    &lt;CDComment&gt;This is the first version of the Core CD group.
      It was created by D Carlisle based on MathML CD Group.&lt;/CDComment&gt;
    &lt;CDComment&gt;Algebra&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;alg1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/alg1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Arithmetic&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;arith1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/arith1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Constructor for Floating Point Numbers&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;bigfloat1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/bigfloat1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Calculus&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;calculus1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/calculus1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Operations on and constructors for complex numbers&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;complex1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/complex1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Functions on functions&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;fns1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/fns1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Integer arithmetic&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;integer1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/integer1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Intervals&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;interval1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/interval1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Linear Algebra - vector &amp;amp; matrix constructors, those symbols which are independant of orientation, but in MathML&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;linalg1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/linalg1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Linear Algebra - vector &amp;amp; matrix constructors, those symbols which are dependant of orientation, and in MathML&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;linalg2&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/linalg2.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Limits of unary functions&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;limit1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/limit1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;List constructors&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;list1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/list1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Basic logical operators&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;logic1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/logic1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;
      MathML Numerical Types
    &lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;mathmltypes&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/mathmltypes.ocd&lt;/CDURL&gt;
    &lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Minima and maxima&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;minmax1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/minmax1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Multset-theoretic operators and constructors&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;multiset1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/multiset1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Symbols for creating numbers, including some defined constants
      (which can be seen as nullary constructors)&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;nums1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/nums1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Symbols for creating piecewise definitions&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;piece1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/piece1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;The basic quantifiers forall and exists.&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;quant1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/quant1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Common arithmetic relations&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;relation1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/relation1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Number sets&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;setname1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/setname1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Rounding&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;rounding1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/rounding1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Set-theoretic operators and constructors&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;set1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/set1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Basic data orientated statistical operators&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;s_data1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/s_data1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Basic random variable orientated statistical operators&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;s_dist1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/s_dist1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Basic transcendental functions&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;transc1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/transc1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Vector calculus functions&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;veccalc1&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/veccalc1.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
    &lt;CDComment&gt;Alternative encoding symbols for compatibility with the MathML
      Semantic mapping constructs.&lt;/CDComment&gt;
    &lt;CDGroupMember&gt;
      &lt;CDName&gt;altenc&lt;/CDName&gt;
      &lt;CDURL&gt;http://www.openmath.org/cd/altenc.ocd&lt;/CDURL&gt;&lt;/CDGroupMember&gt;
  &lt;/CDGroup&gt;
</pre></div>



</div>

<div><h3 name="errorcd" id="errorcd">A.5 The <b>error</b> Content Dictionary</h3>
  
  
  <div class="literal"><pre>
  &lt;CD&gt;
    &lt;CDName&gt; error &lt;/CDName&gt;
    &lt;CDURL&gt; http://www.openmath.org/cd/error.ocd &lt;/CDURL&gt;
    &lt;CDReviewDate&gt; 2003-04-01 &lt;/CDReviewDate&gt;
    &lt;CDStatus&gt; official &lt;/CDStatus&gt;
    &lt;CDDate&gt; 2001-03-12 &lt;/CDDate&gt;
    &lt;CDVersion&gt; 2 &lt;/CDVersion&gt;
    &lt;CDRevision&gt; 0 &lt;/CDRevision&gt;
    &lt;CDUses&gt;
      &lt;CDName&gt; arith1 &lt;/CDName&gt;
      &lt;CDName&gt; specfun1 &lt;/CDName&gt;
    &lt;/CDUses&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; unhandled_symbol &lt;/Name&gt;
      &lt;Description&gt;
	This symbol represents the error which is raised when an application
	reads a symbol which is present in the mentioned content
	dictionary, but which it has not implemented.
	
	When receiving such a symbol, the application should act as if it had
	received the &amp;OM; error object constructed from unhandled_symbol
	and the unhandled symbol as in the example below.
      &lt;/Description&gt;
      
      &lt;Example&gt;
	The application does not implement the Complex numbers:
	&lt;OMOBJ&gt;
	  &lt;OME&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="error" name="unhandled_symbol"/&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="setname1" name="C"/&gt;
	  &lt;/OME&gt;
	&lt;/OMOBJ&gt;
      &lt;/Example&gt;
    &lt;/CDDefinition&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; unexpected_symbol &lt;/Name&gt;
      &lt;Description&gt;
	This symbol represents the error which is raised when an application
	reads a symbol which is not present in the mentioned content dictionary.
	
	When receiving such a symbol, the application should act as if it had
	received the &amp;OM; error object constructed from unexpected_symbol
	and the unexpected symbol as in the example below.
      &lt;/Description&gt;
      &lt;Example&gt;
	The application received a mistyped symbol
	&lt;OMOBJ&gt;
	  &lt;OME&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="error" name="unexpected_symbol"/&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="arith1" name="plurse"/&gt;
	  &lt;/OME&gt;
	&lt;/OMOBJ&gt;
      &lt;/Example&gt;
    &lt;/CDDefinition&gt;
    
    &lt;CDDefinition&gt;
      &lt;Name&gt; unsupported_CD &lt;/Name&gt;
      &lt;Description&gt;
	This symbol represents the error which is raised when an application
	reads a symbol where the mentioned content dictionary is not
	present.
	
	When receiving such a symbol, the application should act as if it had
	received the &amp;OM; error object constructed from unsupported_CD and
	the symbol from the unsupported Content Dictionary as in the example
	below.
      &lt;/Description&gt;
      &lt;Example&gt;
	The application does not know about the CD specfun1
	&lt;OMOBJ&gt;
	  &lt;OME&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="error" name="unsupported_CD"/&gt;
	    &lt;OMS cdbase="http://www.openmath.org/cd" cd="specfun1" name="BesselJ"/&gt;
	  &lt;/OME&gt;
	&lt;/OMOBJ&gt;
      &lt;/Example&gt;
    &lt;/CDDefinition&gt;
    
  &lt;/CD&gt;
</pre></div>

</div>

</div>


<div class="new"><h2 name="app_openmath.rng" id="app_openmath.rng">
  Appendix B<br/><i>OpenMath</i> Schema in Relax NG XML Syntax (Non-Normative)</h2>
  
  
  <p>This is the Relax NG Schema described in <a href="#sec_xml">Section 4.1</a>
    expressed according to the Relax NG XML Syntax.
  </p>
  <div class="literal"><pre>
    

&lt;grammar ns="http://www.openmath.org/OpenMath" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"&gt;<a xmlns="" name="d0t12668"/>
  &lt;!-- OM2: allow OMR --&gt;<a xmlns="" name="d0t12670"/>
  &lt;define name="omel"&gt;<a xmlns="" name="d0t12672"/>
    &lt;choice&gt;<a xmlns="" name="d0t12674"/>
      &lt;ref name="OMS"/&gt;<a xmlns="" name="d0t12676"/>
      &lt;ref name="OMV"/&gt;<a xmlns="" name="d0t12678"/>
      &lt;ref name="OMI"/&gt;<a xmlns="" name="d0t12680"/>
      &lt;ref name="OMB"/&gt;<a xmlns="" name="d0t12682"/>
      &lt;ref name="OMSTR"/&gt;<a xmlns="" name="d0t12684"/>
      &lt;ref name="OMF"/&gt;<a xmlns="" name="d0t12686"/>
      &lt;ref name="OMA"/&gt;<a xmlns="" name="d0t12688"/>
      &lt;ref name="OMBIND"/&gt;<a xmlns="" name="d0t12690"/>
      &lt;ref name="OME"/&gt;<a xmlns="" name="d0t12692"/>
      &lt;ref name="OMATTR"/&gt;<a xmlns="" name="d0t12694"/>
      &lt;ref name="OMR"/&gt;<a xmlns="" name="d0t12696"/>
    &lt;/choice&gt;<a xmlns="" name="d0t12697"/>
  &lt;/define&gt;<a xmlns="" name="d0t12698"/>
  &lt;!-- things which can be variables --&gt;<a xmlns="" name="d0t12700"/>
  &lt;define name="omvar"&gt;<a xmlns="" name="d0t12702"/>
    &lt;choice&gt;<a xmlns="" name="d0t12704"/>
      &lt;ref name="OMV"/&gt;<a xmlns="" name="d0t12706"/>
      &lt;ref name="attvar"/&gt;<a xmlns="" name="d0t12708"/>
    &lt;/choice&gt;<a xmlns="" name="d0t12709"/>
  &lt;/define&gt;<a xmlns="" name="d0t12710"/>
  &lt;define name="attvar"&gt;<a xmlns="" name="d0t12712"/>
    &lt;element name="OMATTR"&gt;<a xmlns="" name="d0t12714"/>
      &lt;ref name="common.attributes"/&gt;<a xmlns="" name="d0t12716"/>
      &lt;group&gt;<a xmlns="" name="d0t12718"/>
        &lt;ref name="OMATP"/&gt;<a xmlns="" name="d0t12720"/>
        &lt;choice&gt;<a xmlns="" name="d0t12722"/>
          &lt;ref name="OMV"/&gt;<a xmlns="" name="d0t12724"/>
          &lt;ref name="attvar"/&gt;<a xmlns="" name="d0t12726"/>
        &lt;/choice&gt;<a xmlns="" name="d0t12727"/>
      &lt;/group&gt;<a xmlns="" name="d0t12728"/>
    &lt;/element&gt;<a xmlns="" name="d0t12729"/>
  &lt;/define&gt;<a xmlns="" name="d0t12730"/>
  &lt;!-- OM2: common attributes --&gt;<a xmlns="" name="d0t12732"/>
  &lt;define name="cdbase"&gt;<a xmlns="" name="d0t12734"/>
    &lt;attribute name="cdbase"&gt;<a xmlns="" name="d0t12736"/>
      &lt;data type="anyURI"/&gt;<a xmlns="" name="d0t12738"/>
    &lt;/attribute&gt;<a xmlns="" name="d0t12739"/>
  &lt;/define&gt;<a xmlns="" name="d0t12740"/>
  &lt;define name="common.attributes"&gt;<a xmlns="" name="d0t12742"/>
    &lt;optional&gt;<a xmlns="" name="d0t12744"/>
      &lt;attribute name="id"&gt;<a xmlns="" name="d0t12746"/>
        &lt;data type="ID"/&gt;<a xmlns="" name="d0t12748"/>
      &lt;/attribute&gt;<a xmlns="" name="d0t12749"/>
    &lt;/optional&gt;<a xmlns="" name="d0t12750"/>
  &lt;/define&gt;<a xmlns="" name="d0t12751"/>
  &lt;define name="compound.attributes"&gt;<a xmlns="" name="d0t12753"/>
    &lt;ref name="common.attributes"/&gt;<a xmlns="" name="d0t12755"/>
    &lt;ref name="cdbase"/&gt;<a xmlns="" name="d0t12757"/>
  &lt;/define&gt;<a xmlns="" name="d0t12758"/>
  &lt;!-- symbol --&gt;<a xmlns="" name="d0t12760"/>
  &lt;define name="OMS"&gt;<a xmlns="" name="d0t12762"/>
    &lt;element name="OMS"&gt;<a xmlns="" name="d0t12764"/>
      &lt;ref name="common.attributes"/&gt;<a xmlns="" name="d0t12766"/>
      &lt;ref name="attlist.OMS"/&gt;<a xmlns="" name="d0t12768"/>
    &lt;/element&gt;<a xmlns="" name="d0t12769"/>
  &lt;/define&gt;<a xmlns="" name="d0t12770"/>
  &lt;define name="attlist.OMS"&gt;<a xmlns="" name="d0t12772"/>
    &lt;attribute name="name"&gt;<a xmlns="" name="d0t12774"/>
      &lt;data type="NCName"/&gt;<a xmlns="" name="d0t12776"/>
    &lt;/attribute&gt;<a xmlns="" name="d0t12777"/>
    &lt;attribute name="cd"&gt;<a xmlns="" name="d0t12779"/>
      &lt;data type="NCName"/&gt;<a xmlns="" name="d0t12781"/>
    &lt;/attribute&gt;<a xmlns="" name="d0t12782"/>
    &lt;ref name="cdbase"/&gt;<a xmlns="" name="d0t12784"/>
  &lt;/define&gt;<a xmlns="" name="d0t12785"/>
  &lt;!-- variable --&gt;<a xmlns="" name="d0t12787"/>
  &lt;define name="OMV"&gt;<a xmlns="" name="d0t12789"/>
    &lt;element name="OMV"&gt;<a xmlns="" name="d0t12791"/>
      &lt;ref name="common.attributes"/&gt;<a xmlns="" name="d0t12793"/>
      &lt;ref name="attlist.OMV"/&gt;<a xmlns="" name="d0t12795"/>
    &lt;/element&gt;<a xmlns="" name="d0t12796"/>
  &lt;/define&gt;<a xmlns="" name="d0t12797"/>
  &lt;define name="attlist.OMV"&gt;<a xmlns="" name="d0t12799"/>
    &lt;attribute name="name"&gt;<a xmlns="" name="d0t12801"/>
      &lt;data type="NCName"/&gt;<a xmlns="" name="d0t12803"/>
    &lt;/attribute&gt;<a xmlns="" name="d0t12804"/>
  &lt;/define&gt;<a xmlns="" name="d0t12805"/>
  &lt;!-- integer --&gt;<a xmlns="" name="d0t12807"/>
  &lt;define name="OMI"&gt;<a xmlns="" name="d0t12809"/>
    &lt;element name="OMI"&gt;<a xmlns="" name="d0t12811"/>
      &lt;ref name="common.attributes"/&gt;<a xmlns="" name="d0t12813"/>
      &lt;data type="string"&gt;<a xmlns="" name="d0t12815"/>
        &lt;param name="pattern"&gt;<a xmlns="" name="d0t12817"/>\s*(-\s?)?[0-9]+(\s[0-9]+)*\s*&lt;/param&gt;<a xmlns="" name="d0t12818"/>
      &lt;/data&gt;<a xmlns="" name="d0t12819"/>
    &lt;/element&gt;<a xmlns="" name="d0t12820"/>
  &lt;/define&gt;<a xmlns="" name="d0t12821"/>
  &lt;!-- byte array --&gt;<a xmlns="" name="d0t12823"/>
  &lt;define name="OMB"&gt;<a xmlns="" name="d0t12825"/>
    &lt;element name="OMB"&gt;<a xmlns="" name="d0t12827"/>
      &lt;ref name="common.attributes"/&gt;<a xmlns="" name="d0t12829"/>
      &lt;data type="base64Binary"/&gt;<a xmlns="" name="d0t12831"/>
    &lt;/element&gt;<a xmlns="" name="d0t12832"/>
  &lt;/define&gt;<a xmlns="" name="d0t12833"/>
  &lt;!-- string --&gt;<a xmlns="" name="d0t12835"/>
  &lt;define name="OMSTR"&gt;<a xmlns="" name="d0t12837"/>
    &lt;element name="OMSTR"&gt;<a xmlns="" name="d0t12839"/>
      &lt;ref name="common.attributes"/&gt;<a xmlns="" name="d0t12841"/>
      &lt;text/&gt;<a xmlns="" name="d0t12843"/>
    &lt;/element&gt;<a xmlns="" name="d0t12844"/>
  &lt;/define&gt;<a xmlns="" name="d0t12845"/>
  &lt;!-- floating point --&gt;<a xmlns="" name="d0t12847"/>
  &lt;define name="OMF"&gt;<a xmlns="" name="d0t12849"/>
    &lt;element name="OMF"&gt;<a xmlns="" name="d0t12851"/>
      &lt;ref name="common.attributes"/&gt;<a xmlns="" name="d0t12853"/>
      &lt;ref name="attlist.OMF"/&gt;<a xmlns="" name="d0t12855"/>
    &lt;/element&gt;<a xmlns="" name="d0t12856"/>
  &lt;/define&gt;<a xmlns="" name="d0t12857"/>
  &lt;define name="attlist.OMF"&gt;<a xmlns="" name="d0t12859"/>
    &lt;choice&gt;<a xmlns="" name="d0t12861"/>
      &lt;attribute name="dec"&gt;<a xmlns="" name="d0t12863"/>
        &lt;data type="string"&gt;<a xmlns="" name="d0t12865"/>
          &lt;param name="pattern"&gt;<a xmlns="" name="d0t12867"/>(-?)([0-9]+)?(\.[0-9]+)?(e([+\-]?)[0-9]+)?&lt;/param&gt;<a xmlns="" name="d0t12868"/>
        &lt;/data&gt;<a xmlns="" name="d0t12869"/>
      &lt;/attribute&gt;<a xmlns="" name="d0t12870"/>
      &lt;attribute name="hex"&gt;<a xmlns="" name="d0t12872"/>
        &lt;data type="string"&gt;<a xmlns="" name="d0t12874"/>
          &lt;param name="pattern"&gt;<a xmlns="" name="d0t12876"/>[0-9A-F]+&lt;/param&gt;<a xmlns="" name="d0t12877"/>
        &lt;/data&gt;<a xmlns="" name="d0t12878"/>
      &lt;/attribute&gt;<a xmlns="" name="d0t12879"/>
    &lt;/choice&gt;<a xmlns="" name="d0t12880"/>
  &lt;/define&gt;<a xmlns="" name="d0t12881"/>
  &lt;!-- apply constructor --&gt;<a xmlns="" name="d0t12883"/>
  &lt;define name="OMA"&gt;<a xmlns="" name="d0t12885"/>
    &lt;element name="OMA"&gt;<a xmlns="" name="d0t12887"/>
      &lt;ref name="compound.attributes"/&gt;<a xmlns="" name="d0t12889"/>
      &lt;oneOrMore&gt;<a xmlns="" name="d0t12891"/>
        &lt;ref name="omel"/&gt;<a xmlns="" name="d0t12893"/>
      &lt;/oneOrMore&gt;<a xmlns="" name="d0t12894"/>
    &lt;/element&gt;<a xmlns="" name="d0t12895"/>
  &lt;/define&gt;<a xmlns="" name="d0t12896"/>
  &lt;!-- binding constructor and variable --&gt;<a xmlns="" name="d0t12898"/>
  &lt;define name="OMBIND"&gt;<a xmlns="" name="d0t12900"/>
    &lt;element name="OMBIND"&gt;<a xmlns="" name="d0t12902"/>
      &lt;ref name="compound.attributes"/&gt;<a xmlns="" name="d0t12904"/>
      &lt;ref name="omel"/&gt;<a xmlns="" name="d0t12906"/>
      &lt;ref name="OMBVAR"/&gt;<a xmlns="" name="d0t12908"/>
      &lt;ref name="omel"/&gt;<a xmlns="" name="d0t12910"/>
    &lt;/element&gt;<a xmlns="" name="d0t12911"/>
  &lt;/define&gt;<a xmlns="" name="d0t12912"/>
  &lt;define name="OMBVAR"&gt;<a xmlns="" name="d0t12914"/>
    &lt;element name="OMBVAR"&gt;<a xmlns="" name="d0t12916"/>
      &lt;ref name="common.attributes"/&gt;<a xmlns="" name="d0t12918"/>
      &lt;oneOrMore&gt;<a xmlns="" name="d0t12920"/>
        &lt;ref name="omvar"/&gt;<a xmlns="" name="d0t12922"/>
      &lt;/oneOrMore&gt;<a xmlns="" name="d0t12923"/>
    &lt;/element&gt;<a xmlns="" name="d0t12924"/>
  &lt;/define&gt;<a xmlns="" name="d0t12925"/>
  &lt;!-- error --&gt;<a xmlns="" name="d0t12927"/>
  &lt;define name="OME"&gt;<a xmlns="" name="d0t12929"/>
    &lt;element name="OME"&gt;<a xmlns="" name="d0t12931"/>
      &lt;ref name="common.attributes"/&gt;<a xmlns="" name="d0t12933"/>
      &lt;ref name="OMS"/&gt;<a xmlns="" name="d0t12935"/>
      &lt;zeroOrMore&gt;<a xmlns="" name="d0t12937"/>
        &lt;ref name="omel"/&gt;<a xmlns="" name="d0t12939"/>
      &lt;/zeroOrMore&gt;<a xmlns="" name="d0t12940"/>
    &lt;/element&gt;<a xmlns="" name="d0t12941"/>
  &lt;/define&gt;<a xmlns="" name="d0t12942"/>
  &lt;!-- attribution constructor and attribute pair constructor --&gt;<a xmlns="" name="d0t12944"/>
  &lt;define name="OMATTR"&gt;<a xmlns="" name="d0t12946"/>
    &lt;element name="OMATTR"&gt;<a xmlns="" name="d0t12948"/>
      &lt;ref name="compound.attributes"/&gt;<a xmlns="" name="d0t12950"/>
      &lt;ref name="OMATP"/&gt;<a xmlns="" name="d0t12952"/>
      &lt;ref name="omel"/&gt;<a xmlns="" name="d0t12954"/>
    &lt;/element&gt;<a xmlns="" name="d0t12955"/>
  &lt;/define&gt;<a xmlns="" name="d0t12956"/>
  &lt;!-- OM2: allow OMFOREIGN --&gt;<a xmlns="" name="d0t12958"/>
  &lt;define name="OMATP"&gt;<a xmlns="" name="d0t12960"/>
    &lt;element name="OMATP"&gt;<a xmlns="" name="d0t12962"/>
      &lt;ref name="compound.attributes"/&gt;<a xmlns="" name="d0t12964"/>
      &lt;oneOrMore&gt;<a xmlns="" name="d0t12966"/>
        &lt;ref name="OMS"/&gt;<a xmlns="" name="d0t12968"/>
        &lt;choice&gt;<a xmlns="" name="d0t12970"/>
          &lt;ref name="omel"/&gt;<a xmlns="" name="d0t12972"/>
          &lt;ref name="OMFOREIGN"/&gt;<a xmlns="" name="d0t12974"/>
        &lt;/choice&gt;<a xmlns="" name="d0t12975"/>
      &lt;/oneOrMore&gt;<a xmlns="" name="d0t12976"/>
    &lt;/element&gt;<a xmlns="" name="d0t12977"/>
  &lt;/define&gt;<a xmlns="" name="d0t12978"/>
  &lt;!-- OM2: OMFOREIGN --&gt;<a xmlns="" name="d0t12980"/>
  &lt;define name="OMFOREIGN"&gt;<a xmlns="" name="d0t12982"/>
    &lt;element name="OMFOREIGN"&gt;<a xmlns="" name="d0t12984"/>
      &lt;ref name="compound.attributes"/&gt;<a xmlns="" name="d0t12986"/>
      &lt;zeroOrMore&gt;<a xmlns="" name="d0t12988"/>
        &lt;choice&gt;<a xmlns="" name="d0t12990"/>
          &lt;ref name="omel"/&gt;<a xmlns="" name="d0t12992"/>
          &lt;ref name="notom"/&gt;<a xmlns="" name="d0t12994"/>
        &lt;/choice&gt;<a xmlns="" name="d0t12995"/>
      &lt;/zeroOrMore&gt;<a xmlns="" name="d0t12996"/>
    &lt;/element&gt;<a xmlns="" name="d0t12997"/>
  &lt;/define&gt;<a xmlns="" name="d0t12998"/>
  &lt;!-- Any elements not in the om namespace (valid om is allowed as a descendant) --&gt;<a xmlns="" name="d0t13000"/>
  &lt;define name="notom"&gt;<a xmlns="" name="d0t13002"/>
    &lt;choice&gt;<a xmlns="" name="d0t13004"/>
      &lt;element&gt;<a xmlns="" name="d0t13006"/>
        &lt;anyName&gt;<a xmlns="" name="d0t13008"/>
          &lt;except&gt;<a xmlns="" name="d0t13010"/>
            &lt;nsName/&gt;<a xmlns="" name="d0t13012"/>
          &lt;/except&gt;<a xmlns="" name="d0t13013"/>
        &lt;/anyName&gt;<a xmlns="" name="d0t13014"/>
        &lt;zeroOrMore&gt;<a xmlns="" name="d0t13016"/>
          &lt;attribute&gt;<a xmlns="" name="d0t13018"/>
            &lt;anyName/&gt;<a xmlns="" name="d0t13020"/>
          &lt;/attribute&gt;<a xmlns="" name="d0t13021"/>
        &lt;/zeroOrMore&gt;<a xmlns="" name="d0t13022"/>
        &lt;zeroOrMore&gt;<a xmlns="" name="d0t13024"/>
          &lt;choice&gt;<a xmlns="" name="d0t13026"/>
            &lt;ref name="omel"/&gt;<a xmlns="" name="d0t13028"/>
            &lt;ref name="notom"/&gt;<a xmlns="" name="d0t13030"/>
          &lt;/choice&gt;<a xmlns="" name="d0t13031"/>
        &lt;/zeroOrMore&gt;<a xmlns="" name="d0t13032"/>
      &lt;/element&gt;<a xmlns="" name="d0t13033"/>
      &lt;text/&gt;<a xmlns="" name="d0t13035"/>
    &lt;/choice&gt;<a xmlns="" name="d0t13036"/>
  &lt;/define&gt;<a xmlns="" name="d0t13037"/>
  &lt;!-- OM object constructor --&gt;<a xmlns="" name="d0t13039"/>
  &lt;define name="OMOBJ"&gt;<a xmlns="" name="d0t13041"/>
    &lt;element name="OMOBJ"&gt;<a xmlns="" name="d0t13043"/>
      &lt;ref name="compound.attributes"/&gt;<a xmlns="" name="d0t13045"/>
      &lt;ref name="omel"/&gt;<a xmlns="" name="d0t13047"/>
    &lt;/element&gt;<a xmlns="" name="d0t13048"/>
  &lt;/define&gt;<a xmlns="" name="d0t13049"/>
  &lt;define name="attlist.OMOBJ"&gt;<a xmlns="" name="d0t13051"/>
    &lt;attribute name="version"&gt;<a xmlns="" name="d0t13053"/>
      &lt;choice&gt;<a xmlns="" name="d0t13055"/>
        &lt;value&gt;<a xmlns="" name="d0t13057"/>1.0&lt;/value&gt;<a xmlns="" name="d0t13058"/>
        &lt;value&gt;<a xmlns="" name="d0t13060"/>1.2&lt;/value&gt;<a xmlns="" name="d0t13061"/>
        &lt;value&gt;<a xmlns="" name="d0t13063"/>2.0&lt;/value&gt;<a xmlns="" name="d0t13064"/>
      &lt;/choice&gt;<a xmlns="" name="d0t13065"/>
    &lt;/attribute&gt;<a xmlns="" name="d0t13066"/>
  &lt;/define&gt;<a xmlns="" name="d0t13067"/>
  &lt;!-- OM2: OMR --&gt;<a xmlns="" name="d0t13069"/>
  &lt;define name="OMR"&gt;<a xmlns="" name="d0t13071"/>
    &lt;element name="OMR"&gt;<a xmlns="" name="d0t13073"/>
      &lt;ref name="common.attributes"/&gt;<a xmlns="" name="d0t13075"/>
      &lt;ref name="attlist.OMR"/&gt;<a xmlns="" name="d0t13077"/>
    &lt;/element&gt;<a xmlns="" name="d0t13078"/>
  &lt;/define&gt;<a xmlns="" name="d0t13079"/>
  &lt;define name="attlist.OMR"&gt;<a xmlns="" name="d0t13081"/>
    &lt;attribute name="xlink:href"/&gt;<a xmlns="" name="d0t13083"/>
    &lt;attribute name="xlink:type"&gt;<a xmlns="" name="d0t13085"/>
      &lt;value&gt;<a xmlns="" name="d0t13087"/>simple&lt;/value&gt;<a xmlns="" name="d0t13088"/>
    &lt;/attribute&gt;<a xmlns="" name="d0t13089"/>
    &lt;attribute name="xlink:show"&gt;<a xmlns="" name="d0t13091"/>
      &lt;value&gt;<a xmlns="" name="d0t13093"/>embed&lt;/value&gt;<a xmlns="" name="d0t13094"/>
    &lt;/attribute&gt;<a xmlns="" name="d0t13095"/>
  &lt;/define&gt;<a xmlns="" name="d0t13096"/>
  &lt;start&gt;<a xmlns="" name="d0t13098"/>
    &lt;ref name="OMOBJ"/&gt;<a xmlns="" name="d0t13100"/>
  &lt;/start&gt;<a xmlns="" name="d0t13101"/>
&lt;/grammar&gt;

  </pre></div>
</div>

<div class="new"><h2 name="app_relaxrestricted" id="app_relaxrestricted">
  Appendix C<br/>Restricting the <i>OpenMath</i> Schema (Non-Normative)</h2>
  
  
  <p> Relax NG allows one to state constraints such as <i>
if the cd attribute of OMS is arith1 then the name attribute must be
one of lcm, gcd, plus etc.</i> Thus it is easy to use a
stylesheet to generate for any given CD, a Relax NG schema that
expresses the constraint that an <small><code>OMS</code></small> naming
that CD must only use symbols defined in the specified dictionary.
Similarly it is possible to use the <i>role</i>
information contained in the CD to restrict which symbols can be the
first child of an <small><code>OMBIND</code></small> or the odd-numbered
children of an <small><code>OMATP</code></small>. 
</p>

<p> The modularisation mechanisms of Relax NG then allow one to
include these schema for all the CDs that you want to allow and, for
example, to replace the regexp-based validation of the
<small><code>OMS</code></small> attributes by explicit lists of allowed
CD names, and for each CD Name, a list of allowed symbol names.
</p>

<p>
For example, a CD-specific Relax NG Schema for the arith1 CD shown in
<a href="#arith1.ocd">Appendix A.2</a> would look like:
<div class="literal"><pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary=""&gt;
  &lt;define name="cd.attlist.OMS" combine="choice"&gt;
    &lt;attribute name="cd"&gt;
      &lt;value type="string"&gt;arith1&lt;/value&gt;
    &lt;/attribute&gt;
    &lt;attribute name="name"&gt;
      &lt;choice&gt;
        &lt;value type="string"&gt;lcm&lt;/value&gt;
        &lt;value type="string"&gt;gcd&lt;/value&gt;
        &lt;value type="string"&gt;plus&lt;/value&gt;
        &lt;value type="string"&gt;unary_minus&lt;/value&gt;
        &lt;value type="string"&gt;minus&lt;/value&gt;
        &lt;value type="string"&gt;times&lt;/value&gt;
        &lt;value type="string"&gt;divide&lt;/value&gt;
        &lt;value type="string"&gt;power&lt;/value&gt;
        &lt;value type="string"&gt;abs&lt;/value&gt;
        &lt;value type="string"&gt;root&lt;/value&gt;
        &lt;value type="string"&gt;sum&lt;/value&gt;
        &lt;value type="string"&gt;product&lt;/value&gt;
      &lt;/choice&gt;
    &lt;/attribute&gt;
  &lt;/define&gt;
&lt;/grammar&gt;
</pre></div>
or, using the Relax NG compact syntax:
<div class="literal"><pre>
cd.attlist.OMS |= 
  attribute cd {string "arith1" },
  attribute name {
    string "lcm" |
    string "gcd" |
    string "plus" |
    string "unary_minus" |
    string "minus" |
    string "times" |
    string "divide" |
    string "power" |
    string "abs" |
    string "root" |
    string "sum" |
    string "product" }
</pre></div>
</p>

<p> To build a schema that allows only symbols from arith1 we just
need to include the <i>OpenMath</i> schema described in <a href="#ssec_xml">Section 4.1.1</a>, override the attribute declarations for
OMS, and then include the schema for arith1.  For example:
<div class="literal"><pre>
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;grammar xmlns="http://relaxng.org/ns/structure/1.0"&gt;
  &lt;include href="openmath.rng"&gt;
    &lt;define name="attlist.OMS"&gt;
      &lt;ref name="cd.attlist.OMS"/&gt;
    &lt;/define&gt;
  &lt;/include&gt;
  &lt;include href="arith1.rng"/&gt;
&lt;/grammar&gt;
</pre></div>
or, in the compact syntax:
<div class="literal"><pre>
include "openmath.rnc" {
 attlist.OMS = cd.attlist.OMS}

include "arith1.rnc"
</pre></div>
Using this approach it is possible to include as many files as
required.
</p>

</div>

<div class="new"><h2 name="app_xsd" id="app_xsd">
  Appendix D<br/><i>OpenMath</i> Schema in XSD Syntax (Non-Normative)</h2>
  
  
  <p>This is an XSD Schema generated from the Relax NG Schema described in 
        <a href="#sec_xml">Section 4.1</a>.
  </p>
  <div class="literal"><pre>
    

&lt;schema elementFormDefault="qualified" targetNamespace="http://www.openmath.org/OpenMath"&gt;<a xmlns="" name="d0t13180"/>
  &lt;import namespace="http://www.w3.org/1999/xlink" schemaLocation="xlink.xsd"/&gt;<a xmlns="" name="d0t13182"/>
  &lt;!-- OM2: allow OMR --&gt;<a xmlns="" name="d0t13184"/>
  &lt;group name="omel"&gt;<a xmlns="" name="d0t13186"/>
    &lt;choice&gt;<a xmlns="" name="d0t13188"/>
      &lt;element ref="om:OMS"/&gt;<a xmlns="" name="d0t13190"/>
      &lt;element ref="om:OMV"/&gt;<a xmlns="" name="d0t13192"/>
      &lt;element ref="om:OMI"/&gt;<a xmlns="" name="d0t13194"/>
      &lt;element ref="om:OMB"/&gt;<a xmlns="" name="d0t13196"/>
      &lt;element ref="om:OMSTR"/&gt;<a xmlns="" name="d0t13198"/>
      &lt;element ref="om:OMF"/&gt;<a xmlns="" name="d0t13200"/>
      &lt;element ref="om:OMA"/&gt;<a xmlns="" name="d0t13202"/>
      &lt;element ref="om:OMBIND"/&gt;<a xmlns="" name="d0t13204"/>
      &lt;element ref="om:OME"/&gt;<a xmlns="" name="d0t13206"/>
      &lt;group ref="om:OMATTR"/&gt;<a xmlns="" name="d0t13208"/>
      &lt;element ref="om:OMR"/&gt;<a xmlns="" name="d0t13210"/>
    &lt;/choice&gt;<a xmlns="" name="d0t13211"/>
  &lt;/group&gt;<a xmlns="" name="d0t13212"/>
  &lt;!-- things which can be variables --&gt;<a xmlns="" name="d0t13214"/>
  &lt;group name="omvar"&gt;<a xmlns="" name="d0t13216"/>
    &lt;choice&gt;<a xmlns="" name="d0t13218"/>
      &lt;element ref="om:OMV"/&gt;<a xmlns="" name="d0t13220"/>
      &lt;group ref="om:attvar"/&gt;<a xmlns="" name="d0t13222"/>
    &lt;/choice&gt;<a xmlns="" name="d0t13223"/>
  &lt;/group&gt;<a xmlns="" name="d0t13224"/>
  &lt;group name="attvar"&gt;<a xmlns="" name="d0t13226"/>
    &lt;sequence&gt;<a xmlns="" name="d0t13228"/>
      &lt;element name="OMATTR"&gt;<a xmlns="" name="d0t13230"/>
        &lt;complexType&gt;<a xmlns="" name="d0t13232"/>
          &lt;sequence&gt;<a xmlns="" name="d0t13234"/>
            &lt;element ref="om:OMATP"/&gt;<a xmlns="" name="d0t13236"/>
            &lt;choice&gt;<a xmlns="" name="d0t13238"/>
              &lt;element ref="om:OMV"/&gt;<a xmlns="" name="d0t13240"/>
              &lt;group ref="om:attvar"/&gt;<a xmlns="" name="d0t13242"/>
            &lt;/choice&gt;<a xmlns="" name="d0t13243"/>
          &lt;/sequence&gt;<a xmlns="" name="d0t13244"/>
          &lt;attributeGroup ref="om:common.attributes"/&gt;<a xmlns="" name="d0t13246"/>
        &lt;/complexType&gt;<a xmlns="" name="d0t13247"/>
      &lt;/element&gt;<a xmlns="" name="d0t13248"/>
    &lt;/sequence&gt;<a xmlns="" name="d0t13249"/>
  &lt;/group&gt;<a xmlns="" name="d0t13250"/>
  &lt;!-- OM2: common attributes --&gt;<a xmlns="" name="d0t13252"/>
  &lt;attributeGroup name="cdbase"&gt;<a xmlns="" name="d0t13254"/>
    &lt;attribute name="cdbase" use="required" type="xs:anyURI"/&gt;<a xmlns="" name="d0t13256"/>
  &lt;/attributeGroup&gt;<a xmlns="" name="d0t13257"/>
  &lt;attributeGroup name="common.attributes"&gt;<a xmlns="" name="d0t13259"/>
    &lt;attribute name="id" type="xs:ID"/&gt;<a xmlns="" name="d0t13261"/>
  &lt;/attributeGroup&gt;<a xmlns="" name="d0t13262"/>
  &lt;attributeGroup name="compound.attributes"&gt;<a xmlns="" name="d0t13264"/>
    &lt;attributeGroup ref="om:common.attributes"/&gt;<a xmlns="" name="d0t13266"/>
    &lt;attributeGroup ref="om:cdbase"/&gt;<a xmlns="" name="d0t13268"/>
  &lt;/attributeGroup&gt;<a xmlns="" name="d0t13269"/>
  &lt;!-- symbol --&gt;<a xmlns="" name="d0t13271"/>
  &lt;element name="OMS"&gt;<a xmlns="" name="d0t13273"/>
    &lt;complexType&gt;<a xmlns="" name="d0t13275"/>
      &lt;attributeGroup ref="om:common.attributes"/&gt;<a xmlns="" name="d0t13277"/>
      &lt;attributeGroup ref="om:attlist.OMS"/&gt;<a xmlns="" name="d0t13279"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13280"/>
  &lt;/element&gt;<a xmlns="" name="d0t13281"/>
  &lt;attributeGroup name="attlist.OMS"&gt;<a xmlns="" name="d0t13283"/>
    &lt;attribute name="name" use="required" type="xs:NCName"/&gt;<a xmlns="" name="d0t13285"/>
    &lt;attribute name="cd" use="required" type="xs:NCName"/&gt;<a xmlns="" name="d0t13287"/>
    &lt;attributeGroup ref="om:cdbase"/&gt;<a xmlns="" name="d0t13289"/>
  &lt;/attributeGroup&gt;<a xmlns="" name="d0t13290"/>
  &lt;!-- variable --&gt;<a xmlns="" name="d0t13292"/>
  &lt;element name="OMV"&gt;<a xmlns="" name="d0t13294"/>
    &lt;complexType&gt;<a xmlns="" name="d0t13296"/>
      &lt;attributeGroup ref="om:common.attributes"/&gt;<a xmlns="" name="d0t13298"/>
      &lt;attributeGroup ref="om:attlist.OMV"/&gt;<a xmlns="" name="d0t13300"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13301"/>
  &lt;/element&gt;<a xmlns="" name="d0t13302"/>
  &lt;attributeGroup name="attlist.OMV"&gt;<a xmlns="" name="d0t13304"/>
    &lt;attribute name="name" use="required" type="xs:NCName"/&gt;<a xmlns="" name="d0t13306"/>
  &lt;/attributeGroup&gt;<a xmlns="" name="d0t13307"/>
  &lt;!-- integer --&gt;<a xmlns="" name="d0t13309"/>
  &lt;element name="OMI"&gt;<a xmlns="" name="d0t13311"/>
    &lt;complexType&gt;<a xmlns="" name="d0t13313"/>
      &lt;simpleContent&gt;<a xmlns="" name="d0t13315"/>
        &lt;restriction base="xs:anyType"&gt;<a xmlns="" name="d0t13317"/>
          &lt;simpleType&gt;<a xmlns="" name="d0t13319"/>
            &lt;restriction base="xs:string"&gt;<a xmlns="" name="d0t13321"/>
              &lt;pattern value="\s*(-\s?)?[0-9]+(\s[0-9]+)*\s*"/&gt;<a xmlns="" name="d0t13323"/>
            &lt;/restriction&gt;<a xmlns="" name="d0t13324"/>
          &lt;/simpleType&gt;<a xmlns="" name="d0t13325"/>
          &lt;attributeGroup ref="om:common.attributes"/&gt;<a xmlns="" name="d0t13327"/>
        &lt;/restriction&gt;<a xmlns="" name="d0t13328"/>
      &lt;/simpleContent&gt;<a xmlns="" name="d0t13329"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13330"/>
  &lt;/element&gt;<a xmlns="" name="d0t13331"/>
  &lt;!-- byte array --&gt;<a xmlns="" name="d0t13333"/>
  &lt;element name="OMB"&gt;<a xmlns="" name="d0t13335"/>
    &lt;complexType&gt;<a xmlns="" name="d0t13337"/>
      &lt;simpleContent&gt;<a xmlns="" name="d0t13339"/>
        &lt;extension base="xs:base64Binary"&gt;<a xmlns="" name="d0t13341"/>
          &lt;attributeGroup ref="om:common.attributes"/&gt;<a xmlns="" name="d0t13343"/>
        &lt;/extension&gt;<a xmlns="" name="d0t13344"/>
      &lt;/simpleContent&gt;<a xmlns="" name="d0t13345"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13346"/>
  &lt;/element&gt;<a xmlns="" name="d0t13347"/>
  &lt;!-- string --&gt;<a xmlns="" name="d0t13349"/>
  &lt;element name="OMSTR"&gt;<a xmlns="" name="d0t13351"/>
    &lt;complexType mixed="true"&gt;<a xmlns="" name="d0t13353"/>
      &lt;attributeGroup ref="om:common.attributes"/&gt;<a xmlns="" name="d0t13355"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13356"/>
  &lt;/element&gt;<a xmlns="" name="d0t13357"/>
  &lt;!-- floating point --&gt;<a xmlns="" name="d0t13359"/>
  &lt;element name="OMF"&gt;<a xmlns="" name="d0t13361"/>
    &lt;complexType&gt;<a xmlns="" name="d0t13363"/>
      &lt;attributeGroup ref="om:common.attributes"/&gt;<a xmlns="" name="d0t13365"/>
      &lt;attributeGroup ref="om:attlist.OMF"/&gt;<a xmlns="" name="d0t13367"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13368"/>
  &lt;/element&gt;<a xmlns="" name="d0t13369"/>
  &lt;attributeGroup name="attlist.OMF"&gt;<a xmlns="" name="d0t13371"/>
    &lt;attribute name="dec"&gt;<a xmlns="" name="d0t13373"/>
      &lt;simpleType&gt;<a xmlns="" name="d0t13375"/>
        &lt;restriction base="xs:string"&gt;<a xmlns="" name="d0t13377"/>
          &lt;pattern value="(-?)([0-9]+)?(\.[0-9]+)?(e([+\-]?)[0-9]+)?"/&gt;<a xmlns="" name="d0t13379"/>
        &lt;/restriction&gt;<a xmlns="" name="d0t13380"/>
      &lt;/simpleType&gt;<a xmlns="" name="d0t13381"/>
    &lt;/attribute&gt;<a xmlns="" name="d0t13382"/>
    &lt;attribute name="hex"&gt;<a xmlns="" name="d0t13384"/>
      &lt;simpleType&gt;<a xmlns="" name="d0t13386"/>
        &lt;restriction base="xs:string"&gt;<a xmlns="" name="d0t13388"/>
          &lt;pattern value="[0-9A-F]+"/&gt;<a xmlns="" name="d0t13390"/>
        &lt;/restriction&gt;<a xmlns="" name="d0t13391"/>
      &lt;/simpleType&gt;<a xmlns="" name="d0t13392"/>
    &lt;/attribute&gt;<a xmlns="" name="d0t13393"/>
  &lt;/attributeGroup&gt;<a xmlns="" name="d0t13394"/>
  &lt;!-- apply constructor --&gt;<a xmlns="" name="d0t13396"/>
  &lt;element name="OMA"&gt;<a xmlns="" name="d0t13398"/>
    &lt;complexType&gt;<a xmlns="" name="d0t13400"/>
      &lt;group maxOccurs="unbounded" ref="om:omel"/&gt;<a xmlns="" name="d0t13402"/>
      &lt;attributeGroup ref="om:compound.attributes"/&gt;<a xmlns="" name="d0t13404"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13405"/>
  &lt;/element&gt;<a xmlns="" name="d0t13406"/>
  &lt;!-- binding constructor and variable --&gt;<a xmlns="" name="d0t13408"/>
  &lt;element name="OMBIND"&gt;<a xmlns="" name="d0t13410"/>
    &lt;complexType&gt;<a xmlns="" name="d0t13412"/>
      &lt;sequence&gt;<a xmlns="" name="d0t13414"/>
        &lt;group ref="om:omel"/&gt;<a xmlns="" name="d0t13416"/>
        &lt;element ref="om:OMBVAR"/&gt;<a xmlns="" name="d0t13418"/>
        &lt;group ref="om:omel"/&gt;<a xmlns="" name="d0t13420"/>
      &lt;/sequence&gt;<a xmlns="" name="d0t13421"/>
      &lt;attributeGroup ref="om:compound.attributes"/&gt;<a xmlns="" name="d0t13423"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13424"/>
  &lt;/element&gt;<a xmlns="" name="d0t13425"/>
  &lt;element name="OMBVAR"&gt;<a xmlns="" name="d0t13427"/>
    &lt;complexType&gt;<a xmlns="" name="d0t13429"/>
      &lt;group maxOccurs="unbounded" ref="om:omvar"/&gt;<a xmlns="" name="d0t13431"/>
      &lt;attributeGroup ref="om:common.attributes"/&gt;<a xmlns="" name="d0t13433"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13434"/>
  &lt;/element&gt;<a xmlns="" name="d0t13435"/>
  &lt;!-- error --&gt;<a xmlns="" name="d0t13437"/>
  &lt;element name="OME"&gt;<a xmlns="" name="d0t13439"/>
    &lt;complexType&gt;<a xmlns="" name="d0t13441"/>
      &lt;sequence&gt;<a xmlns="" name="d0t13443"/>
        &lt;element ref="om:OMS"/&gt;<a xmlns="" name="d0t13445"/>
        &lt;group minOccurs="0" maxOccurs="unbounded" ref="om:omel"/&gt;<a xmlns="" name="d0t13447"/>
      &lt;/sequence&gt;<a xmlns="" name="d0t13448"/>
      &lt;attributeGroup ref="om:common.attributes"/&gt;<a xmlns="" name="d0t13450"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13451"/>
  &lt;/element&gt;<a xmlns="" name="d0t13452"/>
  &lt;!-- attribution constructor and attribute pair constructor --&gt;<a xmlns="" name="d0t13454"/>
  &lt;group name="OMATTR"&gt;<a xmlns="" name="d0t13456"/>
    &lt;sequence&gt;<a xmlns="" name="d0t13458"/>
      &lt;element name="OMATTR"&gt;<a xmlns="" name="d0t13460"/>
        &lt;complexType&gt;<a xmlns="" name="d0t13462"/>
          &lt;sequence&gt;<a xmlns="" name="d0t13464"/>
            &lt;element ref="om:OMATP"/&gt;<a xmlns="" name="d0t13466"/>
            &lt;group ref="om:omel"/&gt;<a xmlns="" name="d0t13468"/>
          &lt;/sequence&gt;<a xmlns="" name="d0t13469"/>
          &lt;attributeGroup ref="om:compound.attributes"/&gt;<a xmlns="" name="d0t13471"/>
        &lt;/complexType&gt;<a xmlns="" name="d0t13472"/>
      &lt;/element&gt;<a xmlns="" name="d0t13473"/>
    &lt;/sequence&gt;<a xmlns="" name="d0t13474"/>
  &lt;/group&gt;<a xmlns="" name="d0t13475"/>
  &lt;!-- OM2: allow OMFOREIGN --&gt;<a xmlns="" name="d0t13477"/>
  &lt;element name="OMATP"&gt;<a xmlns="" name="d0t13479"/>
    &lt;complexType&gt;<a xmlns="" name="d0t13481"/>
      &lt;sequence maxOccurs="unbounded"&gt;<a xmlns="" name="d0t13483"/>
        &lt;element ref="om:OMS"/&gt;<a xmlns="" name="d0t13485"/>
        &lt;choice&gt;<a xmlns="" name="d0t13487"/>
          &lt;group ref="om:omel"/&gt;<a xmlns="" name="d0t13489"/>
          &lt;element ref="om:OMFOREIGN"/&gt;<a xmlns="" name="d0t13491"/>
        &lt;/choice&gt;<a xmlns="" name="d0t13492"/>
      &lt;/sequence&gt;<a xmlns="" name="d0t13493"/>
      &lt;attributeGroup ref="om:compound.attributes"/&gt;<a xmlns="" name="d0t13495"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13496"/>
  &lt;/element&gt;<a xmlns="" name="d0t13497"/>
  &lt;!-- OM2: OMFOREIGN --&gt;<a xmlns="" name="d0t13499"/>
  &lt;element name="OMFOREIGN"&gt;<a xmlns="" name="d0t13501"/>
    &lt;complexType mixed="true"&gt;<a xmlns="" name="d0t13503"/>
      &lt;choice minOccurs="0" maxOccurs="unbounded"&gt;<a xmlns="" name="d0t13505"/>
        &lt;group ref="om:omel"/&gt;<a xmlns="" name="d0t13507"/>
        &lt;group ref="om:notom"/&gt;<a xmlns="" name="d0t13509"/>
      &lt;/choice&gt;<a xmlns="" name="d0t13510"/>
      &lt;attributeGroup ref="om:compound.attributes"/&gt;<a xmlns="" name="d0t13512"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13513"/>
  &lt;/element&gt;<a xmlns="" name="d0t13514"/>
  &lt;!-- Any elements not in the om namespace (valid om is allowed as a descendant) --&gt;<a xmlns="" name="d0t13516"/>
  &lt;group name="notom"&gt;<a xmlns="" name="d0t13518"/>
    &lt;sequence&gt;<a xmlns="" name="d0t13520"/>
      &lt;choice minOccurs="0"&gt;<a xmlns="" name="d0t13522"/>
        &lt;any namespace="##other" processContents="skip"/&gt;<a xmlns="" name="d0t13524"/>
        &lt;any namespace="##local" processContents="skip"/&gt;<a xmlns="" name="d0t13526"/>
      &lt;/choice&gt;<a xmlns="" name="d0t13527"/>
    &lt;/sequence&gt;<a xmlns="" name="d0t13528"/>
  &lt;/group&gt;<a xmlns="" name="d0t13529"/>
  &lt;!-- OM object constructor --&gt;<a xmlns="" name="d0t13531"/>
  &lt;element name="OMOBJ"&gt;<a xmlns="" name="d0t13533"/>
    &lt;complexType&gt;<a xmlns="" name="d0t13535"/>
      &lt;group ref="om:omel"/&gt;<a xmlns="" name="d0t13537"/>
      &lt;attributeGroup ref="om:compound.attributes"/&gt;<a xmlns="" name="d0t13539"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13540"/>
  &lt;/element&gt;<a xmlns="" name="d0t13541"/>
  &lt;attributeGroup name="attlist.OMOBJ"&gt;<a xmlns="" name="d0t13543"/>
    &lt;attribute name="version" use="required"&gt;<a xmlns="" name="d0t13545"/>
      &lt;simpleType&gt;<a xmlns="" name="d0t13547"/>
        &lt;restriction base="xs:token"&gt;<a xmlns="" name="d0t13549"/>
          &lt;enumeration value="1.0"/&gt;<a xmlns="" name="d0t13551"/>
          &lt;enumeration value="1.2"/&gt;<a xmlns="" name="d0t13553"/>
          &lt;enumeration value="2.0"/&gt;<a xmlns="" name="d0t13555"/>
        &lt;/restriction&gt;<a xmlns="" name="d0t13556"/>
      &lt;/simpleType&gt;<a xmlns="" name="d0t13557"/>
    &lt;/attribute&gt;<a xmlns="" name="d0t13558"/>
  &lt;/attributeGroup&gt;<a xmlns="" name="d0t13559"/>
  &lt;!-- OM2: OMR --&gt;<a xmlns="" name="d0t13561"/>
  &lt;element name="OMR"&gt;<a xmlns="" name="d0t13563"/>
    &lt;complexType&gt;<a xmlns="" name="d0t13565"/>
      &lt;attributeGroup ref="om:common.attributes"/&gt;<a xmlns="" name="d0t13567"/>
      &lt;attributeGroup ref="om:attlist.OMR"/&gt;<a xmlns="" name="d0t13569"/>
    &lt;/complexType&gt;<a xmlns="" name="d0t13570"/>
  &lt;/element&gt;<a xmlns="" name="d0t13571"/>
  &lt;attributeGroup name="attlist.OMR"&gt;<a xmlns="" name="d0t13573"/>
    &lt;attribute ref="xlink:href" use="required"/&gt;<a xmlns="" name="d0t13575"/>
    &lt;attribute ref="xlink:type" use="required"/&gt;<a xmlns="" name="d0t13577"/>
    &lt;attribute ref="xlink:show" use="required"/&gt;<a xmlns="" name="d0t13579"/>
  &lt;/attributeGroup&gt;<a xmlns="" name="d0t13580"/>
&lt;/schema&gt;

  </pre></div>
</div>

<div class="new"><h2 name="app_dtd" id="app_dtd">
  Appendix E<br/><i>OpenMath</i> DTD (Non-Normative)</h2>
  
  
  <p>This is a DTD generated from the Relax NG Schema described in 
        <a href="#sec_xml">Section 4.1</a>.  Note that we cannot express the 
        fact that the <small><code>OMFOREIGN</code></small> element can
        contain any well-formed XML, so we have simply restricted it to
        contain any XML defined in the DTD.
  </p>
  <div class="literal"><pre>
    &lt;?xml encoding="UTF-8"?&gt;

&lt;!-- RELAX NG Schema for OpenMath 2 --&gt;

&lt;!-- default namespace om = "http://www.openmath.org/OpenMath" --&gt;

&lt;!-- OM2: allow OMR --&gt;

&lt;!ENTITY % omel "OMS|OMV|OMI|OMB|OMSTR|OMF|OMA|OMBIND|OME|OMATTR|OMR"&gt;

&lt;!ENTITY % attvar "OMATTR"&gt;

&lt;!-- things which can be variables --&gt;

&lt;!ENTITY % omvar "OMV|%attvar;"&gt;

&lt;!-- OM2: common attributes --&gt;

&lt;!ENTITY % cdbase "
  cdbase CDATA #REQUIRED"&gt;

&lt;!ENTITY % common.attributes "
  id ID #IMPLIED"&gt;

&lt;!ENTITY % compound.attributes "
  %common.attributes;
  %cdbase;"&gt;

&lt;!ENTITY % attlist.OMS "
  name NMTOKEN #REQUIRED
  cd NMTOKEN #REQUIRED
  %cdbase;"&gt;

&lt;!-- symbol --&gt;

&lt;!ELEMENT OMS EMPTY&gt;
&lt;!ATTLIST OMS
  %common.attributes;
  %attlist.OMS;&gt;

&lt;!ENTITY % attlist.OMV "
  name NMTOKEN #REQUIRED"&gt;

&lt;!-- variable --&gt;

&lt;!ELEMENT OMV EMPTY&gt;
&lt;!ATTLIST OMV
  %common.attributes;
  %attlist.OMV;&gt;

&lt;!-- integer --&gt;

&lt;!ELEMENT OMI (#PCDATA)&gt;
&lt;!ATTLIST OMI
  %common.attributes;&gt;

&lt;!-- byte array --&gt;

&lt;!ELEMENT OMB (#PCDATA)&gt;
&lt;!ATTLIST OMB
  %common.attributes;&gt;

&lt;!-- string --&gt;

&lt;!ELEMENT OMSTR (#PCDATA)&gt;
&lt;!ATTLIST OMSTR
  %common.attributes;&gt;

&lt;!ENTITY % attlist.OMF "
  dec CDATA #IMPLIED
  hex CDATA #IMPLIED"&gt;

&lt;!-- floating point --&gt;

&lt;!ELEMENT OMF EMPTY&gt;
&lt;!ATTLIST OMF
  %common.attributes;
  %attlist.OMF;&gt;

&lt;!-- apply constructor --&gt;

&lt;!ELEMENT OMA (%omel;)+&gt;
&lt;!ATTLIST OMA
  %compound.attributes;&gt;

&lt;!-- binding constructor and variable --&gt;

&lt;!ELEMENT OMBIND ((%omel;),OMBVAR,(%omel;))&gt;
&lt;!ATTLIST OMBIND
  %compound.attributes;&gt;

&lt;!ELEMENT OMBVAR (%omvar;)+&gt;
&lt;!ATTLIST OMBVAR
  %common.attributes;&gt;

&lt;!-- error --&gt;

&lt;!ELEMENT OME (OMS,(%omel;)*)&gt;
&lt;!ATTLIST OME
  %common.attributes;&gt;

&lt;!-- attribution constructor and attribute pair constructor --&gt;

&lt;!ELEMENT OMATTR (OMATP,(%omel;))&gt;
&lt;!ATTLIST OMATTR
  %compound.attributes;&gt;

&lt;!-- OM2: allow OMFOREIGN  --&gt;

&lt;!ELEMENT OMATP (OMS,(%omel;|OMFOREIGN))+&gt;
&lt;!ATTLIST OMATP
  %compound.attributes;&gt;

&lt;!-- OM2: OMFOREIGN  --&gt;

&lt;!ELEMENT OMFOREIGN ANY&gt;
&lt;!ATTLIST OMFOREIGN
  %compound.attributes;&gt;

&lt;!-- Any elements not in the om namespace (valid om is allowed as a descendant) --&gt;

&lt;!-- OM object constructor --&gt;

&lt;!ELEMENT OMOBJ (%omel;)&gt;
&lt;!ATTLIST OMOBJ
  %compound.attributes;&gt;

&lt;!ENTITY % attlist.OMOBJ "
  version (1.0|1.2|2.0) #REQUIRED"&gt;

&lt;!ENTITY % attlist.OMR "
  xlink:href CDATA #REQUIRED
  xlink:type (simple) #REQUIRED
  xlink:show (embed) #REQUIRED"&gt;

&lt;!-- OM2: OMR --&gt;

&lt;!ELEMENT OMR EMPTY&gt;
&lt;!ATTLIST OMR
  xmlns:xlink CDATA #FIXED 'http://www.w3.org/1999/xlink'
  %common.attributes;
  %attlist.OMR;&gt;

  </pre></div>
</div>

  <div class="new"><h2 name="app_whats_new" id="app_whats_new">
  Appendix F<br/>Changes between <i>OpenMath</i> 1.1 and <i>OpenMath</i> 2 (Non-Normative)</h2>
    


    <p>In this appendix we describe the major changes that occurred
between version 1.1 and version 2 of the <i>OpenMath</i> standard. All changes to
the encodings and content dictionaries have been designed to be
backward compatibile, in other words all existing <i>OpenMath</i> objects and
Content Dictionaries are still valid in <i>OpenMath</i> 2.  On the other hand an
existing  <i>OpenMath</i> 1.1 application may not be able to process <i>OpenMath</i> 2
objects.
</p>

    <div><h3 name="" id="">F.1 Changes to the Formal Definition of Objects</h3>
      
      
      <p>Additional features of abstract objects have been
      introduced:</p>
      <ul>
	<li><p><i>OpenMath</i> symbols have an optional rôle qualifier which restricts the
	  place where they may occur within compound objects.
Although part of the abstract description of a symbol this information
is intended to be stored in the CD.  In the <span>xml</span> encoding it may be
used to provide a more restricted schema leading to tighter
validation.
</p></li>
	<li><p>
In addition to their <i>name</i> and
<i>cd</i> properties, symbols now have an optional
<i>cdbase</i> property.  This can be used to
disambiguate between two CDs which are produced independently but have
the same name, and can also be used to produce a canonical URI for any
<i>OpenMath</i> symbol for use in frameworks such as RDFS or MathML which
need one.
	  </p></li>
	<li><p><i>OpenMath</i> variables can be indexed, in which case they
	  carry information about their enumerator.  Since <i>OpenMath</i> only
allows variables and not objects to be bound, it was not possible to
produce indexed variables by defining an appropriate symbol in a CD.
Also, although it would be possible to produce an indexed variable
using the new <i>semantic-attribute</i> role, it was
felt that attributes describe or modify an object, whereas in this
case we were constructing an atomic object.
</p></li>
	<li><p>An <i>OpenMath</i> object may be attributed with a non-<i>OpenMath</i> object
using the new
	  <i>foreign</i>constructor.  This allows an
<span>xml</span>-encoded <i>OpenMath</i> object to be attributed with appropriate
Presentation MathML, for example, or a base-64 encoded MPEG file of
its aural rendering.
	  </p></li>
	<li><p>the new role property can be used to indicate that a
symbol is an <i>attribution</i>, in which case an
application may ignore or remove it, or a <i>semantic
attribution</i> in which case removing it is no longer
guarenteed to produce an equivalent object.  
	  </p></li>
	<li><p>restrictions on the names of symbols, variables and
content dictionaries have been relaxed to be compatible with XML and
to be less Anglo-Saxon.
	  </p></li>
      </ul>

    </div>

    <div><h3 name="" id="">F.2 Changes to the encodings</h3>
      

      <p>The <i>OpenMath</i> version 2 standard still mandantes two encodings:
      <span>xml</span> and binary. The <span>xml</span> encoding in particular has been
      updated to reflect the latest development of <span>xml</span> and is now a
full <span>xml</span> application.  Version 2
      encodings are backward compatible with version 1.1 encodings.
      </p>
      <ul>
	<li><p>both encodings have been updated to support the
changes to the model of abstract objects described above.
	  </p></li>
	<li><p>encodings support internal and external sharing of
	  objects</p></li>
	<li><p>the <span>xml</span> encoding in version 2 is defined by a Relax
	  NG schema and the mandated character-based grammar of
	  version 1 has been removed, while the DTD has been relegated
to an Appendix.
	  </p></li>
	<li><p>an optional attribute defining the version of the
	  encoding can be specified for the encoded object</p></li>
      </ul>
      

    </div>

    
    <div><h3 name="" id="">F.3 Changes to Content Dictionaries</h3>
      

      <ul>
	<li><p>In <i>OpenMath</i> version 2 Content Dictionaries are defined in
terms of 
	the abstract information content that needs
	to be specified for defining <i>OpenMath</i> symbols. The current
	implementation is thus just one possible encoding of this abstract model.
      </p></li>
	<li><p> The <i>CDUses</i> element is not part of this
information model and has been made optional and deprecated in the reference encoding
since it is trivial to extract its content automatically from the CD.
</p></li>
	<li><p>
A CD may now, optionally, define its cdbase.
</p></li>
	<li><p>
A CD symbol definition may now, optionally, define its role.
</p></li>
      </ul>
      
    </div>

  </div>


<h2 name="bibliography" id="bibliography">
  Appendix G<br/>Bibliography</h2><p><a name="Abbott_Leeuwen_Strotmann_98" id="Abbott_Leeuwen_Strotmann_98"/><b>[1]</b>  John A. Abbott, André van Leeuwen and A. Strotmann <i><i>OpenMath</i>: Communicating Mathematical Information 
      between Co-operating Agents in a Knowledge Network</i>, 1998.</p><p><a name="rfc1521" id="rfc1521"/><b>[2]</b>  N. Borenstein and N Freed <i>MIME (Multipurpose Internet Mail Extensions) Part One: Mechanism for Specifying and Describing the Format of Internet Message Bodies</i>, September 1993.</p><p><a name="OM_D131b" id="OM_D131b"/><b>[3]</b>  O. Caprotti and A. M. Cohen <i>A Type System for <i>OpenMath</i></i>, September 1998.</p><p><a name="OMD132b" id="OMD132b"/><b>[4]</b>  Olga Caprotti and Arjeh M. Cohen <i>A Type System for <i>OpenMath</i></i>, February 1999.</p><p><a name="Dalmas_Gaetano_Watt_97" id="Dalmas_Gaetano_Watt_97"/><b>[5]</b>  S. Dalmas, M. Gaëtano and S. Watt <i>An <i>OpenMath</i> 1.0 Implementation</i>, 1997.</p><p><a name="OM_D132c" id="OM_D132c"/><b>[6]</b>  J. Davenport <i>A Small <i>OpenMath</i> Type System</i>, April 1999.</p><p class="new"><a name="POSIX" id="POSIX"/><b>[7]</b>  IEEE <i>Std 1003.1-2001 (Open Group Technical Standard, Issue 6),
Standard for Information Technology-Portable Operating System Interface (POSIX)</i>, 2001.</p><p><a name="ieee754_85" id="ieee754_85"/><b>[8]</b>   <i>IEEE Standard for binary Floating-Point Arithmetic</i>.</p><p class="new"><a name="IETF2396" id="IETF2396"/><b>[9]</b>  IETF <i>RFC 2396 - Uniform Resource Identifiers (URI): Generic Syntax</i>, August 1998.</p><p><a name="iso646_83" id="iso646_83"/><b>[10]</b>   <i>ISO 7-bit coded character set for information interchange</i>, 1983.</p><p class="new"><a name="RELAX" id="RELAX"/><b>[11]</b>  OASIS Committee Specification <i>RELAX NG Specification</i>, December 2001.</p><p><a name="OM_98" id="OM_98"/><b>[12]</b>  OpenMath Consortium <i><i>OpenMath</i> Version 1 - Draft</i>, June 1998.</p><p><a name="iso9660" id="iso9660"/><b>[13]</b>  Technical committee / subcommittee: JTC 1 <i>ISO 9660:1988 Information processing &#8211; Volume and File Structure of CDROM for Information Interchange</i>, 1988.</p><p><a name="UNICODE" id="UNICODE"/><b>[14]</b>  Unicode Consortium <i>The Unicode Standard: Version <span class="del">2.0</span><span class="new">4.0</span></i>, 19962003.</p><p class="new"><a name="XSD" id="XSD"/><b>[15]</b>  World Wide Web Consortium <i>XSD Schema Parts 1 &amp; 2</i>, May 2001.</p><p><a name="xmlns" id="xmlns"/><b>[16]</b>  World Wide Web Consortium <i>Namespaces in XML</i>, January 1999.</p><p><a name="xml" id="xml"/><b>[17]</b>  World Wide Web Consortium <i>Extensible Markup Language XML 1.0</i>, February 1998.</p><p class="new"><a name="MathML_2000" id="MathML_2000"/><b>[18]</b>  World Wide Web Consortium <i>Mathematical Markup Language (MathML) 2.0 Specification</i>, February 2001.</p><p><a name="XSL_99" id="XSL_99"/><b>[19]</b>  World Wide Web Consortium <i>Extensible Stylesheet Language (XSL) Specification</i>, 21 Apr 1999.</p><p><a name="utf8" id="utf8"/><b>[20]</b>  F. Yergeau <i>UTF-8, a transformation format of ISO 10646</i>, January 1998.</p>

</body>

</html>