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 <!-- The attributes binder and rvar declare variables which are -->
47 <!-- referred to and used by means of respectively BINDER and RVAR -->
48 <!--*****************************************************************-->
50 <!ENTITY % position '(Conclusion|Hypothesis|Body|MainConclusion|
53 <!ENTITY % bool '(True|False)'>
55 <!-- MathQL query expression declaration -->
57 <!ENTITY % queryexpr '(Union|Intersect|Diff|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 Select (In, Where)>
86 <!ELEMENT Exists (In, Where)>
88 <!ELEMENT Use (%queryexpr;, Position)>
90 <!ELEMENT Position EMPTY>
92 binder CDATA #REQUIRED>
94 <!ELEMENT UsedBy (%queryexpr;, Position)>
96 <!ELEMENT ConstructorsOf %queryexpr;>
98 <!ELEMENT Pattern (Prefix, TokenList, (FragmentID?))>
100 <!ELEMENT InTheory (%queryexpr;, ItemType)>
102 <!ELEMENT ItemType EMPTY>
104 binder CDATA #REQUIRED>
106 <!ELEMENT TheoryRefTo %queryexpr;>
108 <!ELEMENT TypeOf %queryexpr;>
110 binder CDATA #REQUIRED>
112 <!ELEMENT SuperTypeOf %queryexpr;>
113 <!ATTLIST SuperTypeOf
114 binder CDATA #REQUIRED>
116 <!ELEMENT SubTypeOf %queryexpr;>
118 binder CDATA #REQUIRED>
120 <!-- MathQL query sub-expressions -->
122 <!ELEMENT In %queryexpr;>
124 <!ELEMENT Where %boolexpr;>
126 rvar CDATA #REQUIRED>
128 <!ELEMENT STAR EMPTY>
130 <!ELEMENT TWOSTARS EMPTY>
132 <!ELEMENT SLASH EMPTY>
134 <!ELEMENT QUESTIONMARK EMPTY>
136 <!ELEMENT NUMBER EMPTY>
138 value NMTOKEN #REQUIRED>
140 <!-- STAR expands only to objects of the specified dir before the last "/":
141 ex. cic:/Algebra/* expands to every object in Algebra only -->
142 <!-- TWOSTARS expands till the most complete name (with extension if not
144 <!-- QUESTIONMARK matches one character except "/" -->
145 <!ELEMENT TokenList (CONST|STAR|TWOSTARS|SLASH|QUESTIONMARK)+>
147 <!ELEMENT Prefix (CONST|STAR)>
149 <!-- XPointers have max depth = 2 (see CIC inductive definitions) -->
150 <!ELEMENT FragmentID (NUMBER|TWOSTARS|STAR)+>
152 <!-- MathQL boolean expressions -->
154 <!ELEMENT AND (%boolexpr;, %boolexpr;)>
156 <!ELEMENT OR (%boolexpr;, %boolexpr;)>
158 <!ELEMENT NOT %boolexpr;>
160 <!ELEMENT IS (%stringexpr;, %stringexpr;)>
162 <!ELEMENT BOOL EMPTY>
164 value %bool; #REQUIRED>
166 <!-- MathQL string expressions -->
168 <!ELEMENT CONST (#PCDATA)>
170 <!ELEMENT RVAR EMPTY>
172 name CDATA #REQUIRED>
174 <!ELEMENT BINDER EMPTY>
176 name CDATA #REQUIRED>
178 <!ELEMENT POSITION EMPTY>
180 name %position; #REQUIRED>
182 <!ELEMENT NAME (RVAR)>
184 <!ELEMENT PROPERTY (RVAR)>
186 name CDATA #REQUIRED>
188 <!ELEMENT SUPERPROPERTY (RVAR)>
189 <!ATTLIST SUPERPROPERTY
190 name CDATA #REQUIRED>
192 <!ELEMENT SUBPROPERTY (RVAR)>
193 <!ATTLIST SUBPROPERTY
194 name CDATA #REQUIRED>