Skip to content

Commit 0d1602f

Browse files
committed
Refactor ecPhlConseq.ml: restructure, deduplicate, document, and annotate
- Split the ~500-line monolithic t_hi_conseq dispatcher into 8 per-goal-type functions (hoareS/F, bdHoareS/F, ehoareS/F, equivS/F) with a thin top-level dispatcher - Extract shared helpers (t_hi_trivial, t_hi_apply_r, etc.) to module level; make pp_f_node and pp_opt_f local to t_hi_error - Unify three identical gen_conseq_nm variants into a single polymorphic one - Factor shared proof-term processing pipeline into process_conseq_core; rename process_conseq_1/2 to process_conseq_hs/ss for clarity - Extract cond_F_notmod_core / cond_S_notmod_core shared helpers, reducing cond_{hoare,bdHoare}{F,S}_notmod to 3-line wrappers - Move mk_bind_pvar/glob/pvars/globs to ecLowPhlGoal.ml with type annotations - Remove unnecessary ~recurse indirection from equivS/equivF dispatchers (make them directly recursive instead) - Introduce hi_arg type alias and add type annotations to all top-level functions - Add inference-rule comments to every goal-closing tactic and document the processing pipeline, naming conventions, and section structure
1 parent bcaa810 commit 0d1602f

2 files changed

Lines changed: 971 additions & 379 deletions

File tree

src/ecLowPhlGoal.ml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -706,6 +706,21 @@ let generalize_mod_ts_inv env modil modir f =
706706
let res = generalize_mod_right env modir f in
707707
generalize_mod_left env modil res
708708

709+
(* -------------------------------------------------------------------- *)
710+
(* Build (ident * form) bindings from generalize_mod_ output: *)
711+
(* map quantifier-bound names back to concrete pvar/glob expressions. *)
712+
713+
let mk_bind_pvar (m : memory) (id : EcIdent.t) ((x, ty) : prog_var * ty) : EcIdent.t * ss_inv =
714+
id, f_pvar x ty m
715+
716+
let mk_bind_glob (env : env) (m : memory) (id : EcIdent.t) (x : EcPath.mpath) : EcIdent.t * ss_inv =
717+
id, NormMp.norm_glob env m x
718+
719+
let mk_bind_pvars (m : memory) ((bd, pvs) : (EcIdent.t * gty) list * (prog_var * ty) list) : (EcIdent.t * ss_inv) list =
720+
List.map2 (fun (id, _) pv -> mk_bind_pvar m id pv) bd pvs
721+
722+
let mk_bind_globs (env : env) (m : memory) ((bd, mps) : (EcIdent.t * gty) list * EcPath.mpath list) : (EcIdent.t * ss_inv) list =
723+
List.map2 (fun (id, _) mp -> mk_bind_glob env m id mp) bd mps
709724

710725
(* -------------------------------------------------------------------- *)
711726
let abstract_info env f1 =

0 commit comments

Comments
 (0)