get-rulenames
author paulson
Fri, 22 Dec 1995 11:09:28 +0100
changeset 1418 f5f97ee67cbb
parent 0 a5a9c433f639
permissions -rwxr-xr-x
Improving space efficiency of inductive/datatype definitions. Reduce usage of "open" and change struct open X; D end to let open X in struct D end end whenever possible -- removes X from the final structure. Especially needed for functors Intr_elim and Indrule. intr_elim.ML and constructor.ML now use a common Su.free_SEs instead of generating a new one. Inductive defs no longer export sumprod_free_SEs ZF/intr_elim: Removed unfold:thm from signature INTR_ELIM. It is never used outside, is easily recovered using bnd_mono and def_lfp_Tarski, and takes up considerable store. Moved raw_induct and rec_names to separate signature INTR_ELIM_AUX, for items no longer exported. mutual_induct is simply "True" unless it is going to be significantly different from induct -- either because there is mutual recursion or because it involves tuples.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     1
#!/bin/sh
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     2
#   Title: 	get-rulenames  (see also make-rulenames)
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     3
#   Author: 	Larry Paulson, Cambridge University Computer Laboratory
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     4
#   Copyright   1990  University of Cambridge
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     5
#
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     6
#shell script to generate "val" declarations for a theory's axioms 
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     7
#  also generates a comma-separated list of axiom names
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     8
#
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
     9
#  usage:  make-rulenames  <file>
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    10
#
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    11
#Rule lines begin with a line containing the word "extend_theory"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    12
#       and end   with a line containing the word "get_axiom"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    13
#Each rule name xyz must appear on a line that begins
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    14
#        <spaces> ("xyz"
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    15
#Output lines have the form
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    16
#        val Eq_comp = ax"Eq_comp";
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    17
#
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    18
sed -n -e '/ext[end]*_theory/,/get_axiom/ s/^[ []*("\([^"]*\)".*$/val \1	= ax"\1";/p' $1
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    19
echo
a5a9c433f639 Initial revision
clasohm
parents:
diff changeset
    20
echo `sed -n -e '/ext[end]*_theory/,/get_axiom/ s/^[ []*("\([^"]*\)".*$/\1/p' $1 | tr '\012' ','`