# Problem 7; 15-Jun-2000

## XML: Foundations, Techniques, Applications; Summer 2000

### Harold Boley; DFKI, Univ. Kaiserslautern

This is a highly simplified DTD for a 'math paper':
```<!ELEMENT Mathpaper     (def+, lemtripro*, theopro, coro*)>
<!ELEMENT lemtripro     (lemma, proof?)>
<!ELEMENT theopro       (theorem, proof)>
<!ELEMENT e             (#PCDATA)>
```
(All otherwise undefined subelements e = def, ... are understood to have e's declaration.)

Someone proposes this Mathpaper markup as an element of the above DTD:

```<Mathpaper>
<def><theorem>1st definition</def>
<def>2nd definition</def>
<theopro>
<theorem>the theorem</theorem>
<proof>the theorem's proof</proof>
</theopro>
<coro>
<stat>1st corollary's statement</stat>
<proof>1st corollary's proof</proof>
</coro>
<coro></coro>
</Mathpaper>
```
Also, this content markup is given within some MathML document:
```<apply>
<eq/>
<apply>
<times/>
<ci>x</ci>
<ci>y</ci>
</apply>
<apply>
<times/>
<ci>y</ci>
<ci>x</ci>
</apply>
</apply>
```

a) Is the Mathpaper markup well-formed XML? If yes, briefly enumerate the reasons why. If no, indicate the erroneous place(s) and the easiest correction(s).

b) Is the Mathpaper markup valid w.r.t. the above Mathpaper DTD? If yes, briefly enumerate the reasons why. If no, indicate the erroneous place(s) and the easiest correction(s).

c) Draw the MathML markup as a tree.

d) Give a Prolog term equivalent to the MathML markup.

e) Ignoring DTD issues, give a revised theopro subelement - possibly made well-formed - for the Mathpaper markup with appropriate subsubelements changed as follows: (i) Replace "the theorem" by the MathML markup, shortened to <apply> <eq/> . . . </apply>. (ii) Use "easy" as the 'proof'.

f) Now adapt the DTD by changing, for e = theorem, <!ELEMENT e (#PCDATA)> into a declaration specifying one apply subelement within theorem elements, relying on the MathML DTD for apply's declaration and further nested ones.