]> matita.cs.unibo.it Git - helm.git/blob - components/ng_kernel/rt.ml
matita 0.5.1 tagged
[helm.git] / components / ng_kernel / rt.ml
1 (*
2     ||M||  This file is part of HELM, an Hypertextual, Electronic        
3     ||A||  Library of Mathematics, developed at the Computer Science     
4     ||T||  Department, University of Bologna, Italy.                     
5     ||I||                                                                
6     ||T||  HELM is free software; you can redistribute it and/or         
7     ||A||  modify it under the terms of the GNU General Public License   
8     \   /  version 2 or (at your option) any later version.      
9      \ /   This software is distributed as is, NO WARRANTY.     
10       V_______________________________________________________________ *)
11
12 (* $Id$ *)
13
14 let _ =
15   Helm_registry.load_from "conf.xml";
16   CicParser.impredicative_set := false;
17   NCicPp.set_ppterm NCicPp.trivial_pp_term;
18   let u = UriManager.uri_of_string Sys.argv.(1) in
19   let o, _ = CicEnvironment.get_obj CicUniv.oblivion_ugraph u in
20   prerr_endline "VECCHIO";
21   prerr_endline (CicPp.ppobj o);
22   let l = OCic2NCic.convert_obj u o in
23   prerr_endline "OGGETTI:.........................................";
24   List.iter (fun o -> prerr_endline (NCicPp.ppobj o)) l;
25   prerr_endline "/OGGETTI:.........................................";
26   let objs = 
27     List.flatten 
28     (List.map NCic2OCic.convert_nobj l) in
29   List.iter 
30    (fun (u,o) -> 
31      prerr_endline ("round trip: " ^ UriManager.string_of_uri u);
32      prerr_endline (CicPp.ppobj o);
33      prerr_endline "tipo.......";
34      try CicTypeChecker.typecheck_obj u o
35      with
36        CicTypeChecker.TypeCheckerFailure s
37      | CicTypeChecker.AssertFailure s ->
38        prerr_endline (Lazy.force s)
39      | CicEnvironment.Object_not_found uri ->
40        prerr_endline
41         ("CicEnvironment: Object not found " ^ UriManager.string_of_uri uri))
42    objs;
43 ;;