(************************************************************************) (* v * The Coq Proof Assistant / The Coq Development Team *) (* TCons ( env , ( Term.mkApp ( r , [| init_def ; ef |] )) , (fun _ -> TNil)))) in let terminator com = let open Proof_global in match com with | Admitted -> Errors.error"Admitted isn't supported in Derive." | Proved (_,Some _,_) -> Errors.error"Cannot save a proof of Derive with an explicit name." | Proved (opaque, None, obj) -> let (f_def,lemma_def) = match Proof_global.(obj.entries) with | [f_def;lemma_def] -> f_def , lemma_def | _ -> assert false in (* The opacity of [f_def] is adjusted to be [false]. *) let f_def = let open Entries in { f_def with const_entry_opaque = false ; } in let f_def = Entries.DefinitionEntry f_def , Decl_kinds.(IsDefinition Definition) in let f_kn = Declare.declare_constant f f_def in let lemma_typ = Term.(mkApp ( r , [| init_def ; mkConst f_kn |] )) in (* The type of [lemma_def] is adjusted to refer to [f_kn], the opacity is adjusted by the proof ending command. *) let lemma_def = let open Entries in { lemma_def with const_entry_type = Some lemma_typ ; const_entry_opaque = opaque ; } in let lemma_def = Entries.DefinitionEntry lemma_def , Decl_kinds.(IsProof Proposition) in ignore (Declare.declare_constant lemma lemma_def) in let () = Proof_global.start_dependent_proof lemma kind ctx goals terminator in let _ = Proof_global.with_current_proof begin fun _ p -> Proof.run_tactic env Proofview.(tclFOCUS 1 1 shelve) p end in ()