| author | wenzelm | 
| Fri, 08 Jul 2011 22:00:53 +0200 | |
| changeset 43713 | 1ba5331b4623 | 
| parent 38228 | ada3ab6b9085 | 
| permissions | -rw-r--r-- | 
| 21637 | 1  | 
(* Title: Pure/ProofGeneral/pgip_markup.ML  | 
2  | 
Author: David Aspinall  | 
|
3  | 
||
4  | 
PGIP abstraction: document markup for proof scripts (in progress).  | 
|
5  | 
*)  | 
|
6  | 
||
7  | 
signature PGIPMARKUP =  | 
|
8  | 
sig  | 
|
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
9  | 
(* Generic markup on sequential, non-overlapping pieces of proof text *)  | 
| 23799 | 10  | 
datatype pgipdoc =  | 
11  | 
    Openblock     of { metavarid: string option, name: string option,
 | 
|
12  | 
objtype: PgipTypes.objtype option }  | 
|
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
13  | 
  | Closeblock    of { }
 | 
| 
24192
 
4eccd4bb8b64
PGIP change: thyname is optional in opentheory, markup even in case of header parse failure
 
aspinall 
parents: 
23834 
diff
changeset
 | 
14  | 
  | Opentheory    of { thyname: string option, parentnames: string list , text: string}
 | 
| 
22404
 
790935f7c1ab
Add more attributes to openblock.  Change theory item objtype field to proper objtype.
 
aspinall 
parents: 
21886 
diff
changeset
 | 
15  | 
  | Theoryitem    of { name: string option, objtype: PgipTypes.objtype option, text: string }
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
16  | 
  | Closetheory   of { text: string }
 | 
| 23799 | 17  | 
  | Opengoal      of { thmname: string option, text: string }
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
18  | 
  | Proofstep     of { text: string }
 | 
| 23799 | 19  | 
  | Closegoal     of { text: string }
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
20  | 
  | Giveupgoal    of { text: string }
 | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
21  | 
  | Postponegoal  of { text: string }
 | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
22  | 
  | Comment       of { text: string }
 | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
23  | 
  | Doccomment    of { text: string }
 | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
24  | 
  | Whitespace    of { text: string }
 | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
25  | 
  | Spuriouscmd   of { text: string }
 | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
26  | 
  | Badcmd        of { text: string }
 | 
| 23799 | 27  | 
  | Unparseable   of { text: string }
 | 
28  | 
  | Metainfo      of { name: string option, text: string }
 | 
|
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
29  | 
(* Last three for PGIP literate markup only: *)  | 
| 26548 | 30  | 
  | Litcomment    of { format: string option, content: XML.tree list }
 | 
| 23799 | 31  | 
  | Showcode      of { show: bool }
 | 
32  | 
  | Setformat     of { format: string }
 | 
|
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
33  | 
|
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
34  | 
type pgipdocument = pgipdoc list  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
35  | 
type pgip_parser = string -> pgipdocument (* system must provide a parser P *)  | 
| 23799 | 36  | 
val unparse_doc : pgipdocument -> string list (* s.t. unparse (P x) = x *)  | 
| 26548 | 37  | 
val output_doc : pgipdocument -> XML.tree list  | 
| 23799 | 38  | 
val doc_markup_elements : string list (* used in pgip_input *)  | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
39  | 
val doc_markup_elements_ignored : string list (* used in pgip_input *)  | 
| 21637 | 40  | 
end  | 
41  | 
||
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
42  | 
|
| 21637 | 43  | 
structure PgipMarkup : PGIPMARKUP =  | 
44  | 
struct  | 
|
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
45  | 
open PgipTypes  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
46  | 
|
| 21867 | 47  | 
(* PGIP 3 idea: replace opentheory, opengoal, etc. by just openblock with corresponding objtype? *)  | 
| 23799 | 48  | 
datatype pgipdoc =  | 
49  | 
    Openblock     of { metavarid: string option, name: string option,
 | 
|
50  | 
objtype: PgipTypes.objtype option }  | 
|
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
51  | 
  | Closeblock    of { }
 | 
| 
24192
 
4eccd4bb8b64
PGIP change: thyname is optional in opentheory, markup even in case of header parse failure
 
aspinall 
parents: 
23834 
diff
changeset
 | 
52  | 
  | Opentheory    of { thyname: string option, parentnames: string list, text: string}
 | 
| 
22404
 
790935f7c1ab
Add more attributes to openblock.  Change theory item objtype field to proper objtype.
 
aspinall 
parents: 
21886 
diff
changeset
 | 
53  | 
  | Theoryitem    of { name: string option, objtype: PgipTypes.objtype option, text: string }
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
54  | 
  | Closetheory   of { text: string }
 | 
| 23799 | 55  | 
  | Opengoal      of { thmname: string option, text: string }
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
56  | 
  | Proofstep     of { text: string }
 | 
| 23799 | 57  | 
  | Closegoal     of { text: string }
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
58  | 
  | Giveupgoal    of { text: string }
 | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
59  | 
  | Postponegoal  of { text: string }
 | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
60  | 
  | Comment       of { text: string }
 | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
61  | 
  | Doccomment    of { text: string }
 | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
62  | 
  | Whitespace    of { text: string }
 | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
63  | 
  | Spuriouscmd   of { text: string }
 | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
64  | 
  | Badcmd        of { text: string }
 | 
| 23799 | 65  | 
  | Unparseable   of { text: string }
 | 
66  | 
  | Metainfo      of { name: string option, text: string }
 | 
|
| 26548 | 67  | 
  | Litcomment    of { format: string option, content: XML.tree list }
 | 
| 23799 | 68  | 
  | Showcode      of { show: bool }
 | 
69  | 
  | Setformat     of { format: string }
 | 
|
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
70  | 
|
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
71  | 
type pgipdocument = pgipdoc list  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
72  | 
type pgip_parser = string -> pgipdocument  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
73  | 
|
| 23799 | 74  | 
fun xml_of docelt =  | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
75  | 
case docelt of  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
76  | 
|
| 23799 | 77  | 
Openblock vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
78  | 
           XML.Elem(("openblock", opt_attr "name" (#metavarid vs) @
 | 
| 
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
79  | 
opt_attr_map PgipTypes.name_of_objtype "objtype" (#objtype vs) @  | 
| 
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
80  | 
opt_attr "metavarid" (#metavarid vs)),  | 
| 23799 | 81  | 
[])  | 
82  | 
||
| 
23834
 
ad6ad61332fa
avoid redundant variables in patterns (which made Alice vomit);
 
wenzelm 
parents: 
23799 
diff
changeset
 | 
83  | 
| Closeblock _ =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
84  | 
           XML.Elem(("closeblock", []), [])
 | 
| 23799 | 85  | 
|
86  | 
| Opentheory vs =>  | 
|
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
87  | 
           XML.Elem(("opentheory",
 | 
| 
24192
 
4eccd4bb8b64
PGIP change: thyname is optional in opentheory, markup even in case of header parse failure
 
aspinall 
parents: 
23834 
diff
changeset
 | 
88  | 
opt_attr "thyname" (#thyname vs) @  | 
| 23799 | 89  | 
opt_attr "parentnames"  | 
90  | 
(case (#parentnames vs)  | 
|
91  | 
of [] => NONE  | 
|
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
92  | 
| ps => SOME (space_implode ";" ps))),  | 
| 23799 | 93  | 
[XML.Text (#text vs)])  | 
| 21867 | 94  | 
|
| 23799 | 95  | 
| Theoryitem vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
96  | 
           XML.Elem(("theoryitem",
 | 
| 23799 | 97  | 
opt_attr "name" (#name vs) @  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
98  | 
opt_attr_map PgipTypes.name_of_objtype "objtype" (#objtype vs)),  | 
| 23799 | 99  | 
[XML.Text (#text vs)])  | 
100  | 
||
101  | 
| Closetheory vs =>  | 
|
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
102  | 
           XML.Elem(("closetheory", []), [XML.Text (#text vs)])
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
103  | 
|
| 23799 | 104  | 
| Opengoal vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
105  | 
           XML.Elem(("opengoal",
 | 
| 
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
106  | 
opt_attr "thmname" (#thmname vs)),  | 
| 23799 | 107  | 
[XML.Text (#text vs)])  | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
108  | 
|
| 23799 | 109  | 
| Proofstep vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
110  | 
           XML.Elem(("proofstep", []), [XML.Text (#text vs)])
 | 
| 23799 | 111  | 
|
112  | 
| Closegoal vs =>  | 
|
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
113  | 
           XML.Elem(("closegoal", []), [XML.Text (#text vs)])
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
114  | 
|
| 23799 | 115  | 
| Giveupgoal vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
116  | 
           XML.Elem(("giveupgoal", []), [XML.Text (#text vs)])
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
117  | 
|
| 23799 | 118  | 
| Postponegoal vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
119  | 
           XML.Elem(("postponegoal", []), [XML.Text (#text vs)])
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
120  | 
|
| 23799 | 121  | 
| Comment vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
122  | 
           XML.Elem(("comment", []), [XML.Text (#text vs)])
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
123  | 
|
| 23799 | 124  | 
| Whitespace vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
125  | 
           XML.Elem(("whitespace", []), [XML.Text (#text vs)])
 | 
| 21867 | 126  | 
|
| 23799 | 127  | 
| Doccomment vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
128  | 
           XML.Elem(("doccomment", []), [XML.Text (#text vs)])
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
129  | 
|
| 23799 | 130  | 
| Spuriouscmd vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
131  | 
           XML.Elem(("spuriouscmd", []), [XML.Text (#text vs)])
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
132  | 
|
| 23799 | 133  | 
| Badcmd vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
134  | 
           XML.Elem(("badcmd", []), [XML.Text (#text vs)])
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
135  | 
|
| 23799 | 136  | 
| Unparseable vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
137  | 
           XML.Elem(("unparseable", []), [XML.Text (#text vs)])
 | 
| 21867 | 138  | 
|
| 23799 | 139  | 
| Metainfo vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
140  | 
           XML.Elem(("metainfo", opt_attr "name" (#name vs)),
 | 
| 23799 | 141  | 
[XML.Text (#text vs)])  | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
142  | 
|
| 23799 | 143  | 
| Litcomment vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
144  | 
           XML.Elem(("litcomment", opt_attr "format" (#format vs)),
 | 
| 23799 | 145  | 
#content vs)  | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
146  | 
|
| 23799 | 147  | 
| Showcode vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
148  | 
           XML.Elem(("showcode",
 | 
| 
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
149  | 
attr "show" (PgipTypes.bool_to_pgstring (#show vs))), [])  | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
150  | 
|
| 23799 | 151  | 
| Setformat vs =>  | 
| 
38228
 
ada3ab6b9085
simplified type XML.tree: embed Markup.T directly, avoid slightly odd triple;
 
wenzelm 
parents: 
29606 
diff
changeset
 | 
152  | 
           XML.Elem(("setformat", attr "format" (#format vs)), [])
 | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
153  | 
|
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
154  | 
val output_doc = map xml_of  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
155  | 
|
| 23799 | 156  | 
fun unparse_elt docelt =  | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
157  | 
case docelt of  | 
| 
23834
 
ad6ad61332fa
avoid redundant variables in patterns (which made Alice vomit);
 
wenzelm 
parents: 
23799 
diff
changeset
 | 
158  | 
Openblock _ => ""  | 
| 
 
ad6ad61332fa
avoid redundant variables in patterns (which made Alice vomit);
 
wenzelm 
parents: 
23799 
diff
changeset
 | 
159  | 
| Closeblock _ => ""  | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
160  | 
| Opentheory vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
161  | 
| Theoryitem vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
162  | 
| Closetheory vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
163  | 
| Opengoal vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
164  | 
| Proofstep vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
165  | 
| Closegoal vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
166  | 
| Giveupgoal vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
167  | 
| Postponegoal vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
168  | 
| Comment vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
169  | 
| Doccomment vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
170  | 
| Whitespace vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
171  | 
| Spuriouscmd vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
172  | 
| Badcmd vs => #text vs  | 
| 21867 | 173  | 
| Unparseable vs => #text vs  | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
174  | 
| Metainfo vs => #text vs  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
175  | 
| _ => ""  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
176  | 
|
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
177  | 
|
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
178  | 
val unparse_doc = map unparse_elt  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
179  | 
|
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
180  | 
|
| 21637 | 181  | 
(* Names of all PGIP document markup elements *)  | 
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
182  | 
val doc_markup_elements =  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
183  | 
["openblock",  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
184  | 
"closeblock",  | 
| 23799 | 185  | 
"opentheory",  | 
186  | 
"theoryitem",  | 
|
187  | 
"closetheory",  | 
|
188  | 
"opengoal",  | 
|
189  | 
"proofstep",  | 
|
190  | 
"closegoal",  | 
|
191  | 
"giveupgoal",  | 
|
192  | 
"postponegoal",  | 
|
193  | 
"comment",  | 
|
194  | 
"doccomment",  | 
|
195  | 
"whitespace",  | 
|
196  | 
"spuriouscmd",  | 
|
197  | 
"badcmd",  | 
|
198  | 
(* the prover shouldn't really receive the next ones,  | 
|
199  | 
but we include them here so that they are harmlessly  | 
|
| 21886 | 200  | 
ignored. *)  | 
| 23799 | 201  | 
"unparseable",  | 
202  | 
"metainfo",  | 
|
| 21886 | 203  | 
(* Broker document format *)  | 
| 23799 | 204  | 
"litcomment",  | 
205  | 
"showcode",  | 
|
206  | 
"setformat"]  | 
|
| 21637 | 207  | 
|
| 
21655
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
208  | 
(* non-document/empty text, must be ignored *)  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
209  | 
val doc_markup_elements_ignored =  | 
| 
 
01b2d13153c8
Document structure in pgip_markup.ML.  Minor fixes.
 
aspinall 
parents: 
21637 
diff
changeset
 | 
210  | 
[ "metainfo", "openblock", "closeblock",  | 
| 23799 | 211  | 
"litcomment", "showcode", "setformat" ]  | 
212  | 
||
213  | 
end;  |