with Not_found -> false)
| C.AMeta (id,_,_) ->
(try
- Hashtbl.find ids_to_inner_sorts id = "Prop"
+ Hashtbl.find ids_to_inner_sorts id = `Prop
with Not_found -> assert false)
| C.ASort (id,_) -> false
| C.AImplicit _ -> raise NotImplemented
with Not_found -> None
in
match sort with
- | Some "Prop" ->
+ | Some `Prop ->
`Hypothesis
{ K.dec_name = name_of n;
K.dec_id = gen_id declaration_prefix seed;
(match t with
C.ARel (idr,idref,n,b) ->
let sort =
- (try Hashtbl.find ids_to_inner_sorts idr
- with Not_found -> "Type") in
- if sort ="Prop" then
+ (try
+ Hashtbl.find ids_to_inner_sorts idr
+ with Not_found -> `Type) in
+ if sort = `Prop then
K.Premise
{ K.premise_id = gen_id premise_prefix seed;
K.premise_xref = idr;
else (K.Term t)
| C.AConst(id,uri,[]) ->
let sort =
- (try Hashtbl.find ids_to_inner_sorts id
- with Not_found -> "Type") in
- if sort ="Prop" then
+ (try
+ Hashtbl.find ids_to_inner_sorts id
+ with Not_found -> `Type) in
+ if sort = `Prop then
K.Lemma
{ K.lemma_id = gen_id lemma_prefix seed;
K.lemma_name = UriManager.name_of_uri uri;
else (K.Term t)
| C.AMutConstruct(id,uri,tyno,consno,[]) ->
let sort =
- (try Hashtbl.find ids_to_inner_sorts id
- with Not_found -> "Type") in
- if sort ="Prop" then
+ (try
+ Hashtbl.find ids_to_inner_sorts id
+ with Not_found -> `Type) in
+ if sort = `Prop then
let inductive_types =
(let o,_ =
CicEnvironment.get_obj CicUniv.empty_ugraph uri
let module K = Content in
try
let sort = Hashtbl.find ids_to_inner_sorts id in
- if sort = "Prop" then
+ if sort = `Prop then
(let p =
(acic2content seed ?name:(name_of n) ~ids_to_inner_sorts ~ids_to_inner_types t)
in
match t with
C.ARel (id,idref,n,b) as t ->
let sort = Hashtbl.find ids_to_inner_sorts id in
- if sort = "Prop" then
+ if sort = `Prop then
generate_exact seed t id name ~ids_to_inner_types
else raise Not_a_proof
| C.AVar (id,uri,exp_named_subst) as t ->
let sort = Hashtbl.find ids_to_inner_sorts id in
- if sort = "Prop" then
+ if sort = `Prop then
generate_exact seed t id name ~ids_to_inner_types
else raise Not_a_proof
| C.AMeta (id,n,l) as t ->
let sort = Hashtbl.find ids_to_inner_sorts id in
- if sort = "Prop" then
+ if sort = `Prop then
generate_exact seed t id name ~ids_to_inner_types
else raise Not_a_proof
| C.ASort (id,s) -> raise Not_a_proof
| C.ACast (id,v,t) -> aux v
| C.ALambda (id,n,s,t) ->
let sort = Hashtbl.find ids_to_inner_sorts id in
- if sort = "Prop" then
+ if sort = `Prop then
let proof = aux t in
let proof' =
if proof.K.proof_conclude.K.conclude_method = "Intros+LetTac" then
else raise Not_a_proof
| C.ALetIn (id,n,s,t) ->
let sort = Hashtbl.find ids_to_inner_sorts id in
- if sort = "Prop" then
+ if sort = `Prop then
let proof = aux t in
let proof' =
if proof.K.proof_conclude.K.conclude_method = "Intros+LetTac" then
})
| C.AConst (id,uri,exp_named_subst) as t ->
let sort = Hashtbl.find ids_to_inner_sorts id in
- if sort = "Prop" then
+ if sort = `Prop then
generate_exact seed t id name ~ids_to_inner_types
else raise Not_a_proof
| C.AMutInd (id,uri,i,exp_named_subst) -> raise Not_a_proof
| C.AMutConstruct (id,uri,i,j,exp_named_subst) as t ->
let sort = Hashtbl.find ids_to_inner_sorts id in
- if sort = "Prop" then
+ if sort = `Prop then
generate_exact seed t id name ~ids_to_inner_types
else raise Not_a_proof
| C.AMutCase (id,uri,typeno,ty,te,patterns) ->
let proofs =
List.map
(function (_,name,_,_,bo) -> `Proof (aux ~name bo)) funs in
+ let fun_name =
+ List.nth (List.map (fun (_,name,_,_,_) -> name) funs) no
+ in
let decreasing_args =
List.map (function (_,_,n,_,_) -> n) funs in
let jo =
[ K.Premise
{ K.premise_id = gen_id premise_prefix seed;
K.premise_xref = jo.K.joint_id;
- K.premise_binder = Some "tiralo fuori";
+ K.premise_binder = Some fun_name;
K.premise_n = Some no;
}
];
let idarg = get_id arg in
let sortarg =
(try (Hashtbl.find ids_to_inner_sorts idarg)
- with Not_found -> "Type") in
+ with Not_found -> `Type) in
let hdarg =
- if sortarg = "Prop" then
+ if sortarg = `Prop then
let (co,bo) =
let rec bc =
function
else
let aid = get_id a in
let asort = (try (Hashtbl.find ids_to_inner_sorts aid)
- with Not_found -> "Type") in
- if asort = "Prop" then
+ with Not_found -> `Type) in
+ if asort = `Prop then
K.ArgProof (aux a)
else K.Term a in
hd::(ma_aux (n-1) tl) in
fun (_,n,b,ty,l) ->
`Inductive
{ K.inductive_id = gen_id inductive_prefix seed;
+ K.inductive_name = n;
K.inductive_kind = b;
K.inductive_type = ty;
K.inductive_constructors = build_constructors seed l