)
;;
-let mk_fresh_name_callback context name ~typ =
+let mk_fresh_name_callback metasenv context name ~typ =
let fresh_name =
- match FreshNamesGenerator.mk_fresh_name context name ~typ with
+ match FreshNamesGenerator.mk_fresh_name metasenv context name ~typ with
Cic.Name fresh_name -> fresh_name
| Cic.Anonymous -> assert false
in
val decompose_uris_choice_callback :
(UriManager.uri * int * 'a) list ->
(UriManager.uri * int * 'b list) list
- val mk_fresh_name_callback :
- Cic.context -> Cic.name -> typ:Cic.term -> Cic.name
+ val mk_fresh_name_callback : ProofEngineTypes.mk_fresh_name_type
end
;;
val decompose_uris_choice_callback :
(UriManager.uri * int * 'a) list ->
(UriManager.uri * int * 'b list) list
- val mk_fresh_name_callback :
- Cic.context -> Cic.name -> typ:Cic.term -> Cic.name
+ val mk_fresh_name_callback : ProofEngineTypes.mk_fresh_name_type
end
module type Tactics =
cicUnification.cmo: cicMetaSubst.cmi cicUnification.cmi
cicUnification.cmx: cicMetaSubst.cmx cicUnification.cmi
cicRefine.cmo: cicMetaSubst.cmi cicMkImplicit.cmi cicUnification.cmi \
- cicRefine.cmi
+ freshNamesGenerator.cmi cicRefine.cmi
cicRefine.cmx: cicMetaSubst.cmx cicMkImplicit.cmx cicUnification.cmx \
- cicRefine.cmi
+ freshNamesGenerator.cmx cicRefine.cmi
(* returns an identifier which is fresh in the context *)
(* and that resembles [name] as much as possible. *)
(* [typ] will be the type of the variable *)
-let mk_fresh_name context name ~typ =
+let mk_fresh_name metasenv context name ~typ =
let module C = Cic in
let basename =
match name with
C.Anonymous ->
(*CSC: great space for improvements here *)
(try
- (match CicTypeChecker.type_of_aux' [] context typ with
+ (match CicTypeChecker.type_of_aux' metasenv context typ with
C.Sort C.Prop
| C.Sort C.CProp -> "H"
| C.Sort C.Set -> "x"
* http://cs.unibo.it/helm/.
*)
-(* mk_fresh_name context name typ *)
+(* mk_fresh_name metasenv context name typ *)
(* returns an identifier which is fresh in the context *)
(* and that resembles [name] as much as possible. *)
(* [typ] will be the type of the variable *)
-val mk_fresh_name : Cic.context -> Cic.name -> typ:Cic.term -> Cic.name
+val mk_fresh_name :
+ Cic.metasenv -> Cic.context -> Cic.name -> typ:Cic.term -> Cic.name
~what:[t1'] ~with_what:[C.Rel 1] ~where:gty'
in
C.Lambda
- (FreshNamesGenerator.mk_fresh_name context C.Anonymous ty, ty, gty'')
+ (FreshNamesGenerator.mk_fresh_name metasenv context C.Anonymous ty,
+ ty, gty'')
in
let fresh_meta = ProofEngineHelpers.new_meta_of_proof proof in
let irl = CicMkImplicit.identity_relocation_list_for_metavariable context in
~what:[t1'] ~with_what:[C.Rel 1] ~where:gty'
in
C.Lambda
- (FreshNamesGenerator.mk_fresh_name context C.Anonymous ty, ty, gty'')
+ (FreshNamesGenerator.mk_fresh_name metasenv context C.Anonymous ty,
+ ty, gty'')
in
let fresh_meta = ProofEngineHelpers.new_meta_of_proof proof in
let irl =
(* and [bo] = Lambda/LetIn [context].(Meta [newmeta]) *)
(* So, lambda_abstract is the core of the implementation of *)
(* the Intros tactic. *)
-let lambda_abstract context newmeta ty mk_fresh_name =
+let lambda_abstract metasenv context newmeta ty mk_fresh_name =
let module C = Cic in
let rec collect_context context =
function
C.Cast (te,_) -> collect_context context te
| C.Prod (n,s,t) ->
- let n' = mk_fresh_name context n ~typ:s in
+ let n' = mk_fresh_name metasenv context n ~typ:s in
let (context',ty,bo) =
collect_context ((Some (n',(C.Decl s)))::context) t
in
T.type_of_aux' metasenv context arg
in
let fresh_name =
- FreshNamesGenerator.mk_fresh_name context (Cic.Name "Heta") ~typ:argty
+ FreshNamesGenerator.mk_fresh_name
+ metasenv context (Cic.Name "Heta") ~typ:argty
in
(C.Appl [C.Lambda (fresh_name,argty,aux 0 t) ; arg])
let metano,context,ty = CicUtil.lookup_meta goal metasenv in
let newmeta = new_meta_of_proof ~proof in
let (context',ty',bo') =
- lambda_abstract context newmeta ty mk_fresh_name_callback
+ lambda_abstract metasenv context newmeta ty mk_fresh_name_callback
in
let (newproof, _) =
subst_meta_in_proof proof metano bo' [newmeta,context',ty']
let newmeta1 = new_meta_of_proof ~proof in
let newmeta2 = newmeta1 + 1 in
let fresh_name =
- mk_fresh_name_callback context (Cic.Name "Hcut") ~typ:term in
+ mk_fresh_name_callback metasenv context (Cic.Name "Hcut") ~typ:term in
let context_for_newmeta1 =
(Some (fresh_name,C.Decl term))::context in
let irl1 =
let _ = CicTypeChecker.type_of_aux' metasenv context term in
let newmeta = new_meta_of_proof ~proof in
let fresh_name =
- mk_fresh_name_callback context (Cic.Name "Hletin") ~typ:term in
+ mk_fresh_name_callback metasenv context (Cic.Name "Hletin") ~typ:term in
let context_for_newmeta =
(Some (fresh_name,C.Def (term,None)))::context in
let irl =
(** constraint: the returned value will always be constructed by Cic.Name **)
type mk_fresh_name_type =
- Cic.context -> Cic.name -> typ:Cic.term -> Cic.name
+ Cic.metasenv -> Cic.context -> Cic.name -> typ:Cic.term -> Cic.name
~start:
(P.cut_tac
(C.Prod(
- (mk_fresh_name_callback context C.Anonymous typ),
+ (mk_fresh_name_callback metasenv context C.Anonymous typ),
typ,
(ProofEngineReduction.replace_lifting_csc 1
~equality:(==)