lib/scripts/fixsome.pl
author wenzelm
Tue, 21 Nov 2006 18:07:33 +0100
changeset 21437 a3c55b85cf0e
parent 14981 e73f8140af78
permissions -rw-r--r--
moved theorem kinds from PureThy to Thm;
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
#
9968
264b16d934f9 fixed comment;
wenzelm
parents: 9967
diff changeset
     5
# 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
     6
#
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     7
9967
179dad40babc fixed name;
wenzelm
parents: 9966
diff changeset
     8
sub fixsome {
9966
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
     9
    my ($file) = @_;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    10
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    11
    open (FILE, $file) || die $!;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    12
    undef $/; $text = <FILE>; $/ = "\n";         # slurp whole file
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    13
    close FILE || die $!;
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
    $_ = $text;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    16
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    17
    s/select_equality/some_equality/g;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    18
    s/select_eq_Ex/some_eq_ex/g;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    19
    s/selectI2EX/someI2_ex/g;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    20
    s/selectI2/someI2/g;
9996
dede9cf1bd2a added s/selectI/someI/g;
wenzelm
parents: 9968
diff changeset
    21
    s/selectI/someI/g;
9966
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    22
    s/select1_equality/some1_equality/g;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    23
    s/Eps_sym_eq/some_sym_eq_trivial/g;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    24
    s/Eps_eq/some_eq_trivial/g;
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
    $result = $_;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    27
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    28
    if ($text ne $result) {
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    29
	print STDERR "fixing $file\n";
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    30
        if (! -f "$file~~") {
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    31
	    rename $file, "$file~~" || die $!;
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
	open (FILE, "> $file") || die $!;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    34
	print FILE $result;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    35
	close FILE || die $!;
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    36
    }
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
## main
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    41
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    42
foreach $file (@ARGV) {
9967
179dad40babc fixed name;
wenzelm
parents: 9966
diff changeset
    43
  eval { &fixsome($file); };
179dad40babc fixed name;
wenzelm
parents: 9966
diff changeset
    44
  if ($@) { print STDERR "*** fixsome $file: ", $@, "\n"; }
9966
e2ddb6a12427 fix theorem names related to SOME (Eps) in HOL;
wenzelm
parents:
diff changeset
    45
}