lib/scripts/fixsome.pl
author wenzelm
Tue, 13 Feb 2001 16:31:18 +0100
changeset 11109 ce1cefc6c14c
parent 9996 dede9cf1bd2a
child 14981 e73f8140af78
permissions -rw-r--r--
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9966
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     1
#
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     2
# $Id$
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     3
# Author: Markus Wenzel, TU Muenchen
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     4
# License: GPL (GNU GENERAL PUBLIC LICENSE)
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     5
#
9968
264b16d934f9 fixed comment;
wenzelm
parents: 9967
diff changeset
     6
# fixsome.pl - fix theorem names related to SOME (Eps) in HOL
9966
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
9967
179dad40babc fixed name;
wenzelm
parents: 9966
diff changeset
     9
sub fixsome {
9966
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    10
    my ($file) = @_;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    11
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    12
    open (FILE, $file) || die $!;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    13
    undef $/; $text = <FILE>; $/ = "\n";         # slurp whole file
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    14
    close FILE || die $!;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    15
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    16
    $_ = $text;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    17
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    18
    s/select_equality/some_equality/g;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    19
    s/select_eq_Ex/some_eq_ex/g;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    20
    s/selectI2EX/someI2_ex/g;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    21
    s/selectI2/someI2/g;
9996
dede9cf1bd2a added s/selectI/someI/g;
wenzelm
parents: 9968
diff changeset
    22
    s/selectI/someI/g;
9966
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    23
    s/select1_equality/some1_equality/g;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    24
    s/Eps_sym_eq/some_sym_eq_trivial/g;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    25
    s/Eps_eq/some_eq_trivial/g;
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
    $result = $_;
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
    if ($text ne $result) {
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    30
	print STDERR "fixing $file\n";
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    31
        if (! -f "$file~~") {
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    32
	    rename $file, "$file~~" || die $!;
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
	open (FILE, "> $file") || die $!;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    35
	print FILE $result;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    36
	close FILE || die $!;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    37
    }
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    38
}
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    39
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    40
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    41
## main
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    42
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    43
foreach $file (@ARGV) {
9967
179dad40babc fixed name;
wenzelm
parents: 9966
diff changeset
    44
  eval { &fixsome($file); };
179dad40babc fixed name;
wenzelm
parents: 9966
diff changeset
    45
  if ($@) { print STDERR "*** fixsome $file: ", $@, "\n"; }
9966
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    46
}