diff options
| author | Maxime Dénès | 2018-09-03 12:41:46 +0200 |
|---|---|---|
| committer | Maxime Dénès | 2018-09-03 12:41:46 +0200 |
| commit | da58ae4c620412923ea84b1982e8765f6be145a8 (patch) | |
| tree | 8518269959c007a7c70bdbd80a968ebff03c6415 /proofs | |
| parent | 3bc0c82700a805e889198b810cc0148f6479cbe1 (diff) | |
| parent | 568f3b69d407f7b5a47d1fdd6ca2bbf3edb5be72 (diff) | |
Merge PR #7912: Simplify effects API
Diffstat (limited to 'proofs')
| -rw-r--r-- | proofs/refine.ml | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/proofs/refine.ml b/proofs/refine.ml index b64e7a2e5e..198e057ebc 100644 --- a/proofs/refine.ml +++ b/proofs/refine.ml @@ -49,20 +49,14 @@ let (pr_constrv,pr_constr) = (* Get the side-effect's constant declarations to update the monad's * environmnent *) -let add_if_undefined kn cb env = - try ignore(Environ.lookup_constant kn env); env - with Not_found -> Environ.add_constant kn cb env +let add_if_undefined env eff = + let open Entries in + try ignore(Environ.lookup_constant eff.seff_constant env); env + with Not_found -> Environ.add_constant eff.seff_constant eff.seff_body env (* Add the side effects to the monad's environment, if not already done. *) -let add_side_effect env = function - | { Entries.eff = Entries.SEsubproof (kn, cb, eff_env) } -> - add_if_undefined kn cb env - | { Entries.eff = Entries.SEscheme (l,_) } -> - List.fold_left (fun env (_,kn,cb,eff_env) -> - add_if_undefined kn cb env) env l - -let add_side_effects env effects = - List.fold_left (fun env eff -> add_side_effect env eff) env effects +let add_side_effects env eff = + List.fold_left add_if_undefined env eff let generic_refine ~typecheck f gl = let sigma = Proofview.Goal.sigma gl in |
