lib/Tools/fixsome
author wenzelm
Mon, 20 Nov 2006 23:47:10 +0100
changeset 21426 87ac12bed1ab
parent 15847 c05c7670f166
permissions -rwxr-xr-x
converted legacy ML scripts;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10555
2323ec838401 /usr/bin/env bash;
wenzelm
parents: 10511
diff changeset
     1
#!/usr/bin/env bash
9966
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     2
#
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     3
# $Id$
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     4
# Author: Markus Wenzel, TU Muenchen
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     5
#
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     6
# DESCRIPTION: fix theorem names related to SOME (Eps) in HOL
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     7
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     8
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     9
## diagnostics
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    10
10511
wenzelm
parents: 9995
diff changeset
    11
PRG="$(basename "$0")"
9966
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    12
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    13
function usage()
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    14
{
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    15
  echo
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    16
  echo "Usage: $PRG [FILES|DIRS...]"
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    17
  echo
9995
wenzelm
parents: 9966
diff changeset
    18
  echo "  Recursively find .thy/.ML files, fixing theorem names related"
9966
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    19
  echo "  to SOME (Eps) in HOL."
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    20
  echo
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    21
  echo "  Renames old versions of FILES by appending \"~~\"."
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    22
  echo
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    23
  exit 1
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    24
}
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    25
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    26
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    27
## process command line
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    28
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    29
[ "$#" -eq 0 -o "$1" = "-?" ] && usage
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    30
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    31
SPECS="$@"; shift "$#"
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    32
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    33
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    34
## main
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    35
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    36
#set by configure
15847
c05c7670f166 restored AUTO_BASH/PERL -- beware of ./configure!
wenzelm
parents: 15574
diff changeset
    37
AUTO_PERL=perl
9966
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    38
9995
wenzelm
parents: 9966
diff changeset
    39
find $SPECS \( -name \*.ML -o -name \*.thy \) -print | \
wenzelm
parents: 9966
diff changeset
    40
  xargs "$AUTO_PERL" -w "$ISABELLE_HOME/lib/scripts/fixsome.pl"