]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/lambda-delta/toplevel/top.ml
first version of kernel "basic_rg"
[helm.git] / helm / software / lambda-delta / toplevel / top.ml
index 1442d7521e2584546076ecb8d590a23e25a0e5f3..92840d54a2df1d1b4ac8739376788b99f7f90975 100644 (file)
@@ -16,6 +16,7 @@ module MA   = MetaAut
 module MO   = MetaOutput
 module MBrg = MetaBrg
 module BrgO = BrgOutput
+module BrgU = BrgUntrusted
 
 type status = {
    summary: int;
@@ -39,8 +40,9 @@ let count st count_fun c item =
 let main =
    let version_string = "Helena Checker 0.8.0 M - December 2008" in
    let summary = ref 0 in
-   let stage = ref 2 in
+   let stage = ref 3 in
    let meta_file = ref None in
+   let hierarchy = ref (fun h -> h + 2) in
    let set_summary i = summary := i in
    let print_version () = L.warn version_string; exit 0 in
    let set_stage i = stage := i in
@@ -68,10 +70,18 @@ let main =
       let rec aux st = function
          | []         -> st
         | item :: tl ->
-            let st = {st with ac = count st AO.count_item st.ac item} in
+(* stage 3 *)
+           let f st = function
+              | None                   -> st
+              | Some (_, (i, _, _, _)) ->
+                 Log.warn (string_of_int i); st
+           in
+(* stage 2 *)      
            let f st item =
-              {st with brgc = count st BrgO.count_item st.brgc item}
+              let st = {st with brgc = count st BrgO.count_item st.brgc item} in
+              if !stage > 2 then BrgU.type_check (f st) !hierarchy item else st
            in
+(* stage 1 *)      
            let f mst item = 
               let st = {st with
                  mst = mst; mc = count st MO.count_item st.mc item
@@ -82,6 +92,8 @@ let main =
               end;
               if !stage > 1 then MBrg.brg_of_meta (f st) item else st 
            in  
+(* stage 0 *)      
+            let st = {st with ac = count st AO.count_item st.ac item} in
            let st =
               if !stage > 0 then MA.meta_of_aut f st.mst item else st
            in