9966
|
1 |
#
|
|
2 |
# $Id$
|
|
3 |
# Author: Markus Wenzel, TU Muenchen
|
|
4 |
#
|
9968
|
5 |
# fixsome.pl - fix theorem names related to SOME (Eps) in HOL
|
9966
|
6 |
#
|
|
7 |
|
9967
|
8 |
sub fixsome {
|
9966
|
9 |
my ($file) = @_;
|
|
10 |
|
|
11 |
open (FILE, $file) || die $!;
|
|
12 |
undef $/; $text = <FILE>; $/ = "\n"; # slurp whole file
|
|
13 |
close FILE || die $!;
|
|
14 |
|
|
15 |
$_ = $text;
|
|
16 |
|
|
17 |
s/select_equality/some_equality/g;
|
|
18 |
s/select_eq_Ex/some_eq_ex/g;
|
|
19 |
s/selectI2EX/someI2_ex/g;
|
|
20 |
s/selectI2/someI2/g;
|
9996
|
21 |
s/selectI/someI/g;
|
9966
|
22 |
s/select1_equality/some1_equality/g;
|
|
23 |
s/Eps_sym_eq/some_sym_eq_trivial/g;
|
|
24 |
s/Eps_eq/some_eq_trivial/g;
|
|
25 |
|
|
26 |
$result = $_;
|
|
27 |
|
|
28 |
if ($text ne $result) {
|
|
29 |
print STDERR "fixing $file\n";
|
|
30 |
if (! -f "$file~~") {
|
|
31 |
rename $file, "$file~~" || die $!;
|
|
32 |
}
|
|
33 |
open (FILE, "> $file") || die $!;
|
|
34 |
print FILE $result;
|
|
35 |
close FILE || die $!;
|
|
36 |
}
|
|
37 |
}
|
|
38 |
|
|
39 |
|
|
40 |
## main
|
|
41 |
|
|
42 |
foreach $file (@ARGV) {
|
9967
|
43 |
eval { &fixsome($file); };
|
|
44 |
if ($@) { print STDERR "*** fixsome $file: ", $@, "\n"; }
|
9966
|
45 |
}
|