@@ -323,6 +323,14 @@ def exec_foundry_prove(
323
323
if unfound_tests :
324
324
raise ValueError (f'Test identifiers not found: { unfound_tests } ' )
325
325
326
+ # TODO: We should be using lemma_rules for execute endpoint
327
+ # lemma_rules = [KRule(KToken(lr, 'K'), att=KAtt({'simplification': ''})) for lr in lemmas]
328
+
329
+ def _write_cfg (_cfg : KCFG , _cfgpath : Path ) -> None :
330
+ with open (_cfgpath , 'w' ) as cfgfile :
331
+ cfgfile .write (json .dumps (_cfg .to_dict ()))
332
+ _LOGGER .info (f'Updated CFG file: { _cfgpath } ' )
333
+
326
334
kcfgs : Dict [str , Tuple [KCFG , Path ]] = {}
327
335
for test in tests :
328
336
kcfg_file = kcfgs_dir / f'{ test } .json'
@@ -341,21 +349,11 @@ def exec_foundry_prove(
341
349
target_simplified = foundry .simplify (CTerm (target_simplified ))
342
350
cfg = KCFG__replace_node (cfg , cfg .get_unique_target ().id , CTerm (target_simplified ))
343
351
kcfgs [test ] = (cfg , kcfg_file )
344
- with open (kcfg_file , 'w' ) as kf :
345
- kf .write (json .dumps (cfg .to_dict ()))
346
- kf .close ()
347
- _LOGGER .info (f'Wrote file: { kcfg_file } ' )
352
+ _write_cfg (cfg , kcfg_file )
348
353
else :
349
354
with open (kcfg_file , 'r' ) as kf :
350
355
kcfgs [test ] = (KCFG .from_dict (json .loads (kf .read ())), kcfg_file )
351
356
352
- lemma_rules = [KRule (KToken (lr , 'K' ), att = KAtt ({'simplification' : '' })) for lr in lemmas ]
353
-
354
- def _write_cfg (_cfg : KCFG , _cfgpath : Path ) -> None :
355
- with open (_cfgpath , 'w' ) as cfgfile :
356
- cfgfile .write (json .dumps (_cfg .to_dict ()))
357
- _LOGGER .info (f'Updated CFG file: { _cfgpath } ' )
358
-
359
357
def prove_it (id_and_cfg : Tuple [str , Tuple [KCFG , Path ]]) -> bool :
360
358
cfgid , (cfg , cfgpath ) = id_and_cfg
361
359
target_node = cfg .get_unique_target ()
0 commit comments