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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
|
#!/bin/bash
cloc --by-file ./theories --include-ext=v --json | jq -r '
def categories: {
"./theories/lambda/operational.v": {
component: "(2) LambdaLang",
category1: "(1) Operational semantics",
category2: "General",
},
"./theories/lambda/operational_props.v": {
component: "(2) LambdaLang",
category1: "(1) Operational semantics",
category2: "Properties",
},
"./theories/lambda/interp.v": {
component: "(2) LambdaLang",
category1: "(2) Interpreter",
category2: "General",
},
"./theories/lambda/interp_proofs.v": {
component: "(2) LambdaLang",
category1: "(2) Interpreter",
category2: "Theorem + proofs",
},
"./theories/dynlang/operational.v": {
component: "(3) DynLang",
category1: "(1) Operational semantics",
category2: "General",
},
"./theories/dynlang/operational_props.v": {
component: "(3) DynLang",
category1: "(1) Operational semantics",
category2: "Properties",
},
"./theories/dynlang/interp.v": {
component: "(3) DynLang",
category1: "(2) Interpreter",
category2: "General",
},
"./theories/dynlang/interp_proofs.v": {
component: "(3) DynLang",
category1: "(2) Interpreter",
category2: "Theorem + proofs",
},
"./theories/dynlang/equiv.v": {
component: "(3) DynLang",
category1: "(4) Extra",
category2: "Equivalence with LambdaLang",
},
"./theories/evallang/operational.v": {
component: "(4) EvalLang",
category1: "(1) Operational semantics",
category2: "General",
},
"./theories/evallang/operational_props.v": {
component: "(4) EvalLang",
category1: "(1) Operational semantics",
category2: "Properties",
},
"./theories/evallang/interp.v": {
component: "(4) EvalLang",
category1: "(2) Interpreter",
category2: "General",
},
"./theories/evallang/interp_proofs.v": {
component: "(4) EvalLang",
category1: "(2) Interpreter",
category2: "Theorem + proofs",
},
"./theories/evallang/tests.v": {
component: "(4) EvalLang",
category1: "(3) Tests",
category2: "General",
},
"./theories/nix/floats.v": {
component: "(5) NixLang",
category1: "(4) Extra",
category2: "General",
},
"./theories/nix/operational.v": {
component: "(5) NixLang",
category1: "(1) Operational semantics",
category2: "General",
},
"./theories/nix/operational_props.v": {
component: "(5) NixLang",
category1: "(1) Operational semantics",
category2: "Properties",
},
"./theories/nix/notations.v": {
component: "(5) NixLang",
category1: "(4) Extra",
category2: "General",
},
"./theories/nix/interp.v": {
component: "(5) NixLang",
category1: "(2) Interpreter",
category2: "General",
},
"./theories/nix/interp_proofs.v": {
component: "(5) NixLang",
category1: "(2) Interpreter",
category2: "Theorem + proofs",
},
"./theories/nix/tests.v": {
component: "(5) NixLang",
category1: "(3) Tests",
category2: "General",
},
"./theories/nix/wp.v": {
component: "(5) NixLang",
category1: "(4) Extra",
category2: "General",
},
"./theories/nix/wp_examples.v": {
component: "(5) NixLang",
category1: "(4) Extra",
category2: "General",
},
"./theories/utils.v": {
component: "(1) Shared",
category1: "General",
category2: "General",
},
"./theories/res.v": {
component: "(1) Shared",
category1: "General",
category2: "General",
},
};
def add_cat_data:
{ key, value: ({loc: .value.code} + categories[.key]) };
def categorize_by(key):
group_by(.value[key]) | map({ key: .[0].value[key], value: . }) | from_entries;
def spaces: if . == 0 then "" else " " + (. - 1 | spaces) end;
def pretty(ind):
if (. | type) == "number" then
. | tostring
else
to_entries | reduce .[] as $item (""; . + "\n" + (ind | spaces) + $item.key + ": " + ($item.value | pretty(ind + 2)))
end;
.SUM.code as $sum | del(.header, .SUM) | with_entries(add_cat_data) | to_entries
| categorize_by("component") | map_values(categorize_by("category1"))
| map_values(map_values(categorize_by("category2") | map_values(map(.value.loc) | add)))
| map_values(map_values(. + { TOTAL: to_entries | map(.value) | add }))
| map_values(. + { TOTAL: to_entries | map(.value.TOTAL) | add })
| . + { TOTAL: to_entries | map(.value.TOTAL) | add }
| if .TOTAL == $sum then . else error("internal error: calculated total \(.TOTAL) does not match provided sum \($sum)") end
| "Lines of code for the different parts of the Rocq development:" + pretty(0)
'
|