@@ -25,13 +25,11 @@ test it on the <a href="cgi-bin/cduce">online interpreter</a>.
<p>
CDuce's type system can find very nasty errors. For instance look at this DTD declaration
</p>
<p>
<tt>
<!ELEMENT person (name,children)><br/>
<!ELEMENT children (person+)><br/>
<!ELEMENT name (#PCDATA)><br/>
</tt>
</p>
<xmlsample><![CDATA[
<!ELEMENT person (name,children)>
<!ELEMENT children (person+)>
<!ELEMENT name (#PCDATA)>
]]></xmlsample>
<p>
Apparently this declaration does not pose any problem. But if you consider it more carefully you will see that there exists no document that can be valid for such a DTD,
as a person contains a sequence of children that contain a non empty
...
...
@@ -59,12 +57,11 @@ This definition yields an empty type for Person<br/>
<p>
The type checker correctly issues a "Warning" to signal that the first
two types are empty. Note that instead the declarations</p>
<p>
<tt>
type Person = <person>[ Name Children ]<br/>
type Children = <children>[(<istyle="color:red">ref Person</i>)+]<br/>
type Name = <name>[PCDATA]<br/>
</tt></p>
<sample><![CDATA[
type Person = <person>[ Name Children ]
type Children = <children>[(<istyle="color:red">ref Person</i>)+]
type Name = <name>[PCDATA]
]]></sample>
<p>
correctly do not yield any warning: in this case it is possible to build a value of type person (and thus of type children), for instance by using a recursive definition where a person is a child of itself.