-
Notifications
You must be signed in to change notification settings - Fork 5
/
dbenv.pl
executable file
·68 lines (62 loc) · 1.2 KB
/
dbenv.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/perl -w
# Environment massaging script for MPTP
# SYNOPSIS:
# for i in tarski `cat mml.lar`; do echo $i;
# perl -F dbenv.pl tmp/$i > pl/$i.evl2;
# done
$dirnbr = 8; # number of directives in .evl
@dirs = ([],[],[],[],[],[],[],[]);
@dirname = ('vocabularies','notations',
'definitions','theorems','schemes','registrations',
'constructors','requirements');
$codirnr = 6; # order of the constr. directive
$f=$ARGV[0];
@path = split(/\//,$f);
$f1 = $path[$#path];
$sg = $f.".sgl";
open(SGL, $sg) or die "File not found $sg";
$c=<SGL>;
while($c-- > 0)
{
$a=<SGL>;
chop($a);
push @co, lc($a);
# print "$a\n";
}
# print @co;
$ev = $f.".evl";
open(EVL, $ev) or die "File not found $ev";
for($i=0; $i<$dirnbr; $i++)
{
$c=<EVL>;
while($c-- > 0)
{
$a=<EVL>;
chop($a);
# $dirs[$i][1+$#{$dirs[$i]}] = lc($a);
push @{$dirs[$i]}, lc($a);
# print "$a\n";
$a=<EVL>;
}
}
@{$dirs[$codirnr]} = @co;
print "theory($f1,[";
for($i=0; $i<$dirnbr; $i++)
{
if($i>0)
{
print ",";
}
print $dirname[$i];
print "([";
for($j=0; $j<=$#{$dirs[$i]}; $j++)
{
if($j>0)
{
print ",";
}
print $dirs[$i][$j];
}
print "])";
}
print "]).\n";