aboutsummaryrefslogtreecommitdiff
path: root/plugins/funind/recdef.ml
diff options
context:
space:
mode:
authorHugo Herbelin2018-10-12 18:25:18 +0200
committerHugo Herbelin2019-06-08 20:25:04 +0200
commit398fe8ee23759a1c28d91204aa013beae1dc602b (patch)
tree2fa89958f8ef1ffe1638aa5470c070743eb9bb82 /plugins/funind/recdef.ml
parentb23c3fee91e146d4aa2bc2c75ea30619a204c3d9 (diff)
Cleaning the status of Local Definition and similar.
Formerly, knowing if a declaration was to be discharged, to be global but invisible at import, or to be global but visible at import was obtained by combining the parser-level information (i.e. use of Variable/Hypothesis/Let vs use of Axiom/Parameter/Definition/..., use of Local vs Global) with the result of testing whether there were open sections. We change the meaning of the Discharge flag: it does not tell anymore that it was syntactically a Variable/Hypothesis/Let, but tells the expected semantics of the declaration (issuing a warning in the parser-to-interpreter step if the semantics is not the one suggested by the syntax). In particular, the interpretation/command engine becomes independent of the parser. The new "semantic" type is: type import_status = ImportDefaultBehavior | ImportNeedQualified type locality = Discharge | Global of import_status In the process, we found a couple of inconsistencies in the treatment of the locality status. See bug #8722 and test file LocalDefinition.v.
Diffstat (limited to 'plugins/funind/recdef.ml')
-rw-r--r--plugins/funind/recdef.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/funind/recdef.ml b/plugins/funind/recdef.ml
index e2321d233c..5bedb360d1 100644
--- a/plugins/funind/recdef.ml
+++ b/plugins/funind/recdef.ml
@@ -1371,7 +1371,7 @@ let open_new_goal pstate build_proof sigma using_lemmas ref_ goal_name (gls_type
in
let pstate = Lemmas.start_proof
na
- (Decl_kinds.Global, false (* FIXME *), Decl_kinds.Proof Decl_kinds.Lemma)
+ Decl_kinds.(Global ImportDefaultBehavior, false (* FIXME *), Proof Lemma)
sigma gls_type ~hook:(Lemmas.mk_hook hook) in
let pstate = if Indfun_common.is_strict_tcc ()
then
@@ -1411,7 +1411,7 @@ let com_terminate
hook =
let start_proof env ctx (tac_start:tactic) (tac_end:tactic) =
let pstate = Lemmas.start_proof thm_name
- (Global, false (* FIXME *), Proof Lemma) ~sign:(Environ.named_context_val env)
+ (Global ImportDefaultBehavior, false (* FIXME *), Proof Lemma) ~sign:(Environ.named_context_val env)
ctx (EConstr.of_constr (compute_terminate_type nb_args fonctional_ref)) ~hook in
let pstate = fst @@ by (Proofview.V82.tactic (observe_tac (fun _ _ -> str "starting_tac") tac_start)) pstate in
fst @@ by (Proofview.V82.tactic (observe_tac (fun _ _ -> str "whole_start") (whole_start tac_end nb_args is_mes fonctional_ref
@@ -1457,7 +1457,7 @@ let com_eqn sign uctx nb_arg eq_name functional_ref f_ref terminate_ref equation
let evd = Evd.from_ctx uctx in
let f_constr = constr_of_monomorphic_global f_ref in
let equation_lemma_type = subst1 f_constr equation_lemma_type in
- let pstate = Lemmas.start_proof eq_name (Global, false, Proof Lemma) ~sign evd
+ let pstate = Lemmas.start_proof eq_name (Global ImportDefaultBehavior, false, Proof Lemma) ~sign evd
(EConstr.of_constr equation_lemma_type) in
let pstate = fst @@ by
(Proofview.V82.tactic (start_equation f_ref terminate_ref