| 1 |
% --------------------------------------------------------------------- % |
| 2 |
% print_doc_file thy (name, |- thm) % |
| 3 |
% % |
| 4 |
% Creates a file called `name.doc' in the current directory, and prints % |
| 5 |
% a .doc file for the theorem |- thm into the file in the standard % |
| 6 |
% reference manual format: % |
| 7 |
% % |
| 8 |
% \THEOREM name thy % |
| 9 |
% |- thm % |
| 10 |
% \ENDTHEOREM % |
| 11 |
% --------------------------------------------------------------------- % |
| 12 |
|
| 13 |
let print_doc_file thy (name,thm) = |
| 14 |
lisp (`(setq poport (outfile '` ^ name ^ `.doc))`); |
| 15 |
print_string (`\\THEOREM ` ^ name ^ ` ` ^ thy); |
| 16 |
print_newline(); |
| 17 |
print_thm thm; |
| 18 |
print_newline(); |
| 19 |
print_string `\\ENDTHEOREM`; |
| 20 |
print_newline(); |
| 21 |
lisp `(close poport)`; |
| 22 |
lisp `(setq poport nil)`;; |
| 23 |
|
| 24 |
% --------------------------------------------------------------------- % |
| 25 |
% create_doc_files thy % |
| 26 |
% % |
| 27 |
% Given the name of a theory file thy, this function creates <name>.doc % |
| 28 |
% file in the current directory for each axiom, theorem, and definition % |
| 29 |
% in the theory file `thy.th'. The filenames are generated from the % |
| 30 |
% names under which the theorems are stored in the theory file. The % |
| 31 |
% format of these <name>.doc files is the standard format for the % |
| 32 |
% documentation of theorems in the HOL reference manual. % |
| 33 |
% --------------------------------------------------------------------- % |
| 34 |
|
| 35 |
let create_doc_files thy = |
| 36 |
let prfn = print_doc_file thy in |
| 37 |
let thms = theorems thy and |
| 38 |
axs = axioms thy and |
| 39 |
defs = definitions thy in |
| 40 |
map prfn thms; map prfn axs; map prfn defs; ();; |