1 <?xml version="1.0" encoding="ISO-8859-1"?>
3 <!-- Copyright (C) 2000, HELM Team -->
5 <!-- This file is part of HELM, an Hypertextual, Electronic -->
6 <!-- Library of Mathematics, developed at the Computer Science -->
7 <!-- Department, University of Bologna, Italy. -->
9 <!-- HELM is free software; you can redistribute it and/or -->
10 <!-- modify it under the terms of the GNU General Public License -->
11 <!-- as published by the Free Software Foundation; either version 2 -->
12 <!-- of the License, or (at your option) any later version. -->
14 <!-- HELM is distributed in the hope that it will be useful, -->
15 <!-- but WITHOUT ANY WARRANTY; without even the implied warranty of -->
16 <!-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -->
17 <!-- GNU General Public License for more details. -->
19 <!-- You should have received a copy of the GNU General Public License -->
20 <!-- along with HELM; if not, write to the Free Software -->
21 <!-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, -->
22 <!-- MA 02111-1307, USA. -->
24 <!-- For details, see the HELM World-Wide-Web page, -->
25 <!-- http://cs.unibo.it/helm/. -->
27 <!--*****************************************************************-->
28 <!-- DTD FOR the MATHEMATICAL QUERY MARKUP LANGUAGE (MathQML) -->
29 <!-- First draft: April 2002, Irene Schena -->
30 <!--*****************************************************************-->
32 <!--*****************************************************************-->
33 <!-- This syntax is not convenient for humans to read and write, but -->
34 <!-- it is for programs. -->
35 <!-- XMathQL is useful for: -->
36 <!-- 1) generating queries in a XML-orienting programming environment-->
37 <!-- 2) embedding queries in XML documents -->
38 <!-- 3) reusing queries saved in a standard format -->
39 <!-- The syntax reflects the structure of the grammar productions of -->
41 <!-- The %queryexpr parameter entity is used to allow all query -->
42 <!-- expression types to occur -->
43 <!-- Operators are unambiguous (binary or unary), so there isn't any -->
44 <!-- grouping operator. -->
45 <!-- CONST is the constant string. -->
46 <!--*****************************************************************-->
48 <!ENTITY % position '(Conclusion|Hypothesis|Body|MainConclusion|
51 <!ENTITY % order '(ascendant|descendant)'>
53 <!ENTITY % bool '(True|False)'>
55 <!-- MathQL query expression declaration -->
57 <!ENTITY % queryexpr '(Union|Intersect|Diff|SortBy|Select|Exists|Use|UsedBy|
58 ConstructorsOf|Pattern|InTheory|TheoryRefTo|TypeOf|
59 SuperTypeOf|SubTypeOf|Group)'>
61 <!-- MathQL boolean expression declaration -->
63 <!ENTITY % boolexpr '(AND|OR|NOT|BOOL|IS|GROUP)'>
65 <!-- MathQL string expression declaration -->
67 <!ENTITY % functexpr '(NAME|PROPERTY|SUPERPROPERTY|SUBPROPERTY)'>
69 <!ENTITY % stringexpr '(CONST|POSITION|RVAR|BINDER|%functexpr;)'>
72 <!-- MathQL top-element -->
74 <!ELEMENT MathQL %queryexpr;>
76 <!-- MathQL query expressions -->
78 <!ELEMENT Union (%queryexpr;, %queryexpr;)>
80 <!ELEMENT Intersect (%queryexpr;, %queryexpr;)>
82 <!ELEMENT Diff (%queryexpr;, %queryexpr;)>
84 <!ELEMENT SortBy (%queryexpr;, SortField)>
86 <!ELEMENT Select (In, Where)>
88 <!ELEMENT Exists (In, Where)>
90 <!ELEMENT Use (%queryexpr;, Position)>
92 <!ELEMENT Position EMPTY>
94 binder CDATA #REQUIRED>
96 <!ELEMENT UsedBy (%queryexpr;, Position)>
98 <!ELEMENT ConstructorsOf %queryexpr;>
100 <!ELEMENT Pattern EMPTY>
104 <!ELEMENT InTheory (%queryexpr;, ItemType)>
106 <!ELEMENT ItemType EMPTY>
108 binder CDATA #REQUIRED>
110 <!ELEMENT TheoryRefTo %queryexpr;>
112 <!ELEMENT TypeOf %queryexpr;>
114 binder CDATA #REQUIRED>
116 <!ELEMENT SuperTypeOf %queryexpr;>
117 <!ATTLIST SuperTypeOf
118 binder CDATA #REQUIRED>
120 <!ELEMENT SubTypeOf %queryexpr;>
122 binder CDATA #REQUIRED>
124 <!-- MathQL query sub-expressions -->
126 <!ELEMENT SortField %functexpr;>
128 order %order; #IMPLIED>
130 <!ELEMENT In %queryexpr;>
132 <!ELEMENT Where %boolexpr;>
134 rvar CDATA #REQUIRED>
136 <!-- MathQL boolean expressions -->
138 <!ELEMENT AND (%boolexpr;, %boolexpr;)>
140 <!ELEMENT OR (%boolexpr;, %boolexpr;)>
142 <!ELEMENT NOT %boolexpr;>
144 <!ELEMENT IS (%stringexpr;, %stringexpr;)>
146 <!ELEMENT BOOL EMPTY>
148 value %bool; #REQUIRED>
150 <!-- MathQL string expressions -->
151 <!ELEMENT CONST (#PCDATA)>
153 <!ELEMENT RVAR EMPTY>
155 name CDATA #REQUIRED>
157 <!ELEMENT BINDER EMPTY>
159 name CDATA #REQUIRED>
161 <!ELEMENT POSITION EMPTY>
163 name %position; #REQUIRED>
165 <!ELEMENT NAME (RVAR)>
167 <!ELEMENT PROPERTY (RVAR|CONST)>
169 name CDATA #REQUIRED>
171 <!ELEMENT SUPERPROPERTY (RVAR|CONST)>
172 <!ATTLIST SUPERPROPERTY
173 name CDATA #REQUIRED>
175 <!ELEMENT SUBPROPERTY (RVAR|CONST)>
176 <!ATTLIST SUBPROPERTY
177 name CDATA #REQUIRED>