get-rulenames
author wenzelm
Tue, 09 Mar 1999 12:12:45 +0100
changeset 6324 3b7111b360b1
parent 0 a5a9c433f639
permissions -rwxr-xr-x
HTML markup elements.
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' ','`