-
Notifications
You must be signed in to change notification settings - Fork 21
/
stat_coq
executable file
·73 lines (54 loc) · 1.03 KB
/
stat_coq
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
69
70
71
72
73
#!/bin/sh
# CoLoR, a Coq library on rewriting and termination.
# See the COPYRIGHTS and LICENSE files.
#
# - Frederic Blanqui, 2007-04-19
prog=`basename $0`
usage () { echo "usage: $prog [-h] [dir]"; }
help () {
cat <<EOF
Provides the number of Definitions, Lemmas, etc.
Options:
-h Provide this help and exit
EOF
}
case "$1" in
-h) usage; echo; help; exit 0;;
esac
if test $# -gt 1; then usage; exit 1; fi
dir=${1:-.}
files=`find $dir -path $dir/Coccinelle -prune -o -name \*.v -print`
number () {
k=`grep "$key " $files | wc -l`
echo $key $k
n=`expr $n + $k`
}
total () { echo TOTAL $n; }
reset () { n=0; }
echo Lines `wc -l /dev/null $files | grep total | sed 's|total||'`
echo
key=Inductive; number
echo
reset
key=Fixpoint; number
key=Function; number
total
echo
reset
key=Definition; number
key=Example; number
key=Let; number
total
echo
key=Ltac; number
echo
key=Notation; number
echo
reset
key=Lemma; number
key=Theorem; number
key=Remark; number
key=Fact; number
key=Corollary; number
key=Proposition; number
total