]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/grafite_engine/grafiteEngine.ml
lazy proof term to increase sharing and decrease memory consumption.
[helm.git] / helm / software / components / grafite_engine / grafiteEngine.ml
index aebae038789c66459d36af92a7ed035cd373eba3..888ad55ff0b773df640cca516314f6e69749c797 100644 (file)
@@ -689,7 +689,7 @@ let rec eval_command = {ec_go = fun ~disambiguate_command opts status
      status,[]
   | GrafiteAst.Print (_,"proofterm") ->
       let _,_,_,p,_, _ = GrafiteTypes.get_current_proof status in
-      prerr_endline (Auto.pp_proofterm p);
+      prerr_endline (Auto.pp_proofterm (Lazy.force p));
       status,[]
   | GrafiteAst.Print (_,_) -> status,[]
   | GrafiteAst.Qed loc ->
@@ -710,7 +710,7 @@ let rec eval_command = {ec_go = fun ~disambiguate_command opts status
          (GrafiteTypes.Command_error
            "Proof not completed! metasenv is not empty!");
       let name = UriManager.name_of_uri uri in
-      let obj = Cic.Constant (name,Some bo,ty,[],attrs) in
+      let obj = Cic.Constant (name,Some (Lazy.force bo),ty,[],attrs) in
       let status, lemmas = add_obj uri obj status in
        {status with 
          GrafiteTypes.proof_status = GrafiteTypes.No_proof},
@@ -768,7 +768,7 @@ let rec eval_command = {ec_go = fun ~disambiguate_command opts status
                   "\nPlease use a variant."));
            end;
          let _subst = [] in
-         let initial_proof = (Some uri, metasenv', _subst, bo, ty, attrs) in
+         let initial_proof = (Some uri, metasenv', _subst, lazy bo, ty, attrs) in
          let initial_stack = Continuationals.Stack.of_metasenv metasenv' in
          { status with GrafiteTypes.proof_status =
             GrafiteTypes.Incomplete_proof
@@ -794,10 +794,10 @@ let rec eval_command = {ec_go = fun ~disambiguate_command opts status
 } and eval_executable = {ee_go = fun ~disambiguate_tactic ~disambiguate_command
 ~disambiguate_macro opts status (text,prefix_len,ex) ->
   match ex with
-  | GrafiteAst.Tactic (loc, Some tac, punct) ->
+  | GrafiteAst.Tactic (_(*loc*), Some tac, punct) ->
      let tac = apply_tactic ~disambiguate_tactic (text,prefix_len,tac) in
      let status = eval_tactical status (tactic_of_ast' tac) in
-     (* CALL auto on every goal, easy way of testing it *)
+     (* CALL auto on every goal, easy way of testing it 
      let auto = 
        GrafiteAst.AutoBatch 
          (loc, ([],["depth","2";"timeout","1";"type","1"])) in
@@ -806,6 +806,7 @@ let rec eval_command = {ec_go = fun ~disambiguate_command opts status
        let _ = eval_tactical status (tactic_of_ast' auto) in 
        print_endline "GOOD"; ()
      with ProofEngineTypes.Fail _ -> print_endline "BAD" | _ -> ());
+     *)
       eval_tactical status
        (punctuation_tactical_of_ast (text,prefix_len,punct)),[]
   | GrafiteAst.Tactic (_, None, punct) ->