@@ -21,15 +21,6 @@ let update_cx (cx: ctx) mu =
21
21
Dq. append_list cx hyps
22
22
23
23
24
- (* TODO: make this method deep,
25
- for uniformity of the API with
26
- `Expr.Visit.map`,
27
- and create a class
28
- `Module.Visit.shallow_map`,
29
- and call that one from where
30
- currently the class `map` is
31
- being used.
32
- *)
33
24
class map =
34
25
(* Shallow mapping of modules.
35
26
@@ -174,30 +165,19 @@ class map =
174
165
method mutate cx change usable =
175
166
let mu = Mutate (
176
167
change, usable) in
177
- (* TODO: change the visibility of
178
- facts in `cx` based on the
179
- `Mutate` statement.
180
- *)
181
168
(cx, mu)
182
169
183
170
method submod cx tla_module =
184
171
let mu = Submod tla_module in
185
172
(cx, mu)
186
173
187
174
method anoninst cx inst local =
188
- (* TODO: expand statements
189
- from `INSTANCE` *)
190
175
let mu = Anoninst (inst, local) in
191
176
(cx, mu)
192
177
193
178
end
194
179
195
180
196
- (* TODO: handle `INSTANCE`
197
- statements when expanding
198
- tuply declarations, or
199
- expand them beforehand.
200
- *)
201
181
class deep_map =
202
182
(* Deep mapping of modules.
203
183
@@ -243,14 +223,24 @@ class deep_map =
243
223
let cx = update_cx cx mu in
244
224
(cx, mu)
245
225
246
- (* TODO: expression references and instantiation
247
226
method mutate cx change usable =
248
- failwith "not implemented"
227
+ let scx = (() , cx) in
228
+ let usable = self#usable scx usable in
229
+ let mu = Mutate (change, usable) in
230
+ let cx = update_cx cx mu in
231
+ (cx, mu)
249
232
250
233
method submod cx tla_module =
251
- failwith "not implemented"
234
+ let cx, tla_module = self#tla_module
235
+ cx tla_module in
236
+ let mu = Submod tla_module in
237
+ (cx, mu)
252
238
253
239
method anoninst cx inst local =
254
- failwith "not implemented"
255
- *)
240
+ let scx = (() , cx) in
241
+ let inst = self#instance scx inst in
242
+ let mu = Anoninst (inst, local) in
243
+ (* NOTE: `inst_sub` expressions mapped,
244
+ not full instantiation, so `cx` unchanged. *)
245
+ (cx, mu)
256
246
end
0 commit comments