| 1 |
#! /bin/sh |
| 2 |
#============================================================================# |
| 3 |
# Shellscript to create theorem .doc files for HOL axioms # |
| 4 |
# # |
| 5 |
# This script should be given as its argument the name of a HOL theory (e.g. # |
| 6 |
# bool). It will create in the directory from which it is run all the .doc # |
| 7 |
# files for the theorems (including axioms and definitions) in that theory. # |
| 8 |
# See the "Authors' Guide to writing HOL documentation" (in # |
| 9 |
# [HOL]/Manual/Guide) for further details. The "hol" image name may need to # |
| 10 |
# be changed to give an explicit pathname to the image. # |
| 11 |
#============================================================================# |
| 12 |
|
| 13 |
cat | (../../../hol | sed -e '1,/!!/d; /??/,$d' | sh) <<. |
| 14 |
let create_doc_files thy = |
| 15 |
let create_doc_file (thname,th) = |
| 16 |
print_string (\`cat <<\\\\. >\`^thname^\`.doc\`); print_newline(); |
| 17 |
print_string (\`\\\\THEOREM \`^thname^\` \`^thy); print_newline(); |
| 18 |
print_thm th; print_newline(); |
| 19 |
print_string \`\\\\ENDTHEOREM\`; print_newline(); |
| 20 |
print_string \`.\`; print_newline() |
| 21 |
and axl = axioms thy in |
| 22 |
do map create_doc_file (axl) in |
| 23 |
let ok = (new_theory \`dummy$$\`; new_parent \`$1\`; true) ? false in |
| 24 |
print_string \`!!\`; print_newline(); |
| 25 |
ok => create_doc_files \`$1\` | print_string \`echo Failed\`; |
| 26 |
print_newline(); print_string \`??\`; print_newline(); |
| 27 |
quit();; |
| 28 |
. |