1 let get_parent id ids_to_terms ids_to_father_ids =
2 match Hashtbl.find ids_to_father_ids id with
4 | Some id -> Some (id, Hashtbl.find ids_to_terms id)
7 let get_context ids_to_terms ids_to_father_ids =
8 let module P = ProofEngine in
11 match get_parent id ids_to_terms ids_to_father_ids with
13 | Some (parentid,parent) ->
14 let term = Hashtbl.find ids_to_terms id in
23 | C.Prod (n,s,t) when t == term -> [P.Declaration,n,s]
25 | C.Lambda (n,s,t) when t == term -> [P.Declaration,n,s]
27 | C.LetIn (n,s,t) when t == term -> [P.Definition,n,s]
31 | C.Abst _ -> assert false
35 (*CSC: sbagliato: manca il when *)
37 let counter = ref 0 in
39 (function (name,_,ty,bo) ->
40 let res = (P.Definition, C.Name name, C.Fix (!counter,ifl)) in
45 let counter = ref 0 in
47 (function (name,ty,bo) ->
48 let res = (P.Definition, C.Name name, C.CoFix (!counter,ifl)) in
53 binding@(aux parentid)
58 exception NotImplemented;;
60 let to_sequent id ids_to_terms ids_to_father_ids =
61 let module P = ProofEngine in
62 let term = Hashtbl.find ids_to_terms id in
63 let context = get_context ids_to_terms ids_to_father_ids id in
64 let type_checker_env_of_context =
67 P.Declaration,_,t -> t
68 | P.Definition,_,_ -> raise NotImplemented
71 let ty = CicTypeChecker.type_of_aux' type_checker_env_of_context term in
72 ((context,ty) : ProofEngine.sequent)