- match ProofEngine.get_proof () with
- None -> assert false
- | Some (uri,[],bo,ty) ->
- let uri = match uri with Some uri -> uri | _ -> assert false in
- if
- CicReduction.are_convertible []
- (CicTypeChecker.type_of_aux' [] [] bo) ty
- then
- begin
- (*CSC: Wrong: [] is just plainly wrong *)
- let proof = Cic.Constant (UriManager.name_of_uri uri,Some bo,ty,[]) in
- let (acic,ids_to_inner_types,ids_to_inner_sorts) =
- (rendering_window ())#output#load_proof uri proof
- in
- !qed_set_sensitive false ;
- (* let's save the theorem and register it to the getter *)
- let pathname = pathname_of_annuri (UriManager.buri_of_uri uri) in
- make_dirs pathname ;
- save_object_to_disk uri acic ids_to_inner_sorts ids_to_inner_types
- pathname
- end
- else
- raise WrongProof
- | _ -> raise OpenConjecturesStillThere
+ match ProofEngine.get_proof () with
+ None -> assert false
+ | Some (uri,[],bo,ty) ->
+ let uri = match uri with Some uri -> uri | _ -> assert false in
+ (* we want to typecheck in the ENV *)
+ prerr_endline "-------------> QED";
+ let ty_bo,u =
+ CicTypeChecker.type_of_aux' [] [] bo CicUniv.empty_ugraph in
+ let b,u1 = CicReduction.are_convertible [] ty_bo ty u in
+ if b then
+ begin
+ (*CSC: Wrong: [] is just plainly wrong *)
+ let proof =
+ Cic.Constant (UriManager.name_of_uri uri,Some bo,ty,[],[])
+ in
+ let (acic,ids_to_inner_types,ids_to_inner_sorts) =
+ (rendering_window ())#output#load_proof proof
+ in
+ !qed_set_sensitive false ;
+ (* let's save the theorem and register it to the getter *)
+ let pathname =
+ pathname_of_annuri (UriManager.buri_of_uri uri)
+ in
+ let list_of_universes =
+ CicUnivUtils.universes_of_obj uri
+ (Cic.Constant ("",None,ty,[],[]))
+ in
+ let u1_clean = CicUniv.clean_ugraph u1 list_of_universes in
+ let u2 = CicUniv.fill_empty_nodes_with_uri u1_clean uri in
+ (**********************************************
+ TASSI: to uncomment whe universes will be ON
+ ***********************************************)
+ (*
+ make_dirs pathname ;
+ save_object_to_disk uri acic ids_to_inner_sorts
+ ids_to_inner_types pathname;
+ *)
+ (* save the universe graph u2 *)
+ (* add the object to the env *)
+ CicEnvironment.add_type_checked_term uri ((
+ Cic.Constant ((UriManager.name_of_uri uri),
+ (Some bo),ty,[],[])),u2);
+ (* FIXME: the variable list!! *)
+ prerr_endline "-------------> FINE";
+ end
+ else
+ raise WrongProof
+ | _ -> raise OpenConjecturesStillThere