aboutsummaryrefslogtreecommitdiff
path: root/vernac/comDefinition.ml
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2020-03-15 17:52:16 -0400
committerEmilio Jesus Gallego Arias2020-07-08 15:12:46 +0200
commit54788df72ce79998ee27db362401a56bda4daceb (patch)
treefd81263a9139e00eea38e678f62f106f4da81e4c /vernac/comDefinition.ml
parente0474577f9b83249d69b0f5b5942d6a6bbb1055b (diff)
[obligations] Functionalize Program state
In our quest to unify all the declaration paths, an important step is to account for the state pertaining to `Program` declarations. Whereas regular proofs keep are kept in a stack-like structure; obligations for constants defined by `Program` are stored in a global map which is manipulated by almost regular open/close proof primitives. We make this manipulation explicit by handling the program state functionally, in a similar way than we already do for lemmas. This requires to extend the proof DSL a bit; but IMO changes are acceptable given the gain. Most of the PR is routine; only remarkable change is that the hook is called explicitly in `finish_admitted` as it had to learn about the different types of proof_endings. Note that we could have gone deeper and use the type system to refine the core proof type; IMO it is still too preliminary so it is better to do this step as an intermediate one towards a deeper unification.
Diffstat (limited to 'vernac/comDefinition.ml')
-rw-r--r--vernac/comDefinition.ml8
1 files changed, 4 insertions, 4 deletions
diff --git a/vernac/comDefinition.ml b/vernac/comDefinition.ml
index 5ee847a17e..37b7106856 100644
--- a/vernac/comDefinition.ml
+++ b/vernac/comDefinition.ml
@@ -125,14 +125,14 @@ let do_definition ?hook ~name ~scope ~poly ~kind udecl bl red_option c ctypopt =
Declare.declare_definition ~info ~cinfo ~opaque:false ~body evd
in ()
-let do_definition_program ?hook ~name ~scope ~poly ~kind udecl bl red_option c ctypopt =
+let do_definition_program ?hook ~pm ~name ~scope ~poly ~kind udecl bl red_option c ctypopt =
let program_mode = true in
let (body, types), evd, udecl, impargs =
interp_definition ~program_mode udecl bl ~poly red_option c ctypopt
in
let term, typ, uctx, obls = Declare.Obls.prepare_obligation ~name ~body ~types evd in
- let _ : Declare.Obls.progress =
+ let pm, _ =
let cinfo = Declare.CInfo.make ~name ~typ ~impargs () in
let info = Declare.Info.make ~udecl ~scope ~poly ~kind ?hook () in
- Declare.Obls.add_definition ~cinfo ~info ~term ~uctx obls
- in ()
+ Declare.Obls.add_definition ~pm ~cinfo ~info ~term ~uctx obls
+ in pm