src/HOL/Tools/Sledgehammer/sledgehammer_mash.ML
changeset 50319 dddcaeb92e11
parent 50311 c9d7ccd090e1
child 50335 b17b05c8d4a4
equal deleted inserted replaced
50314:c192ba6e6e5d 50319:dddcaeb92e11
   117   let val path = Path.explode file in
   117   let val path = Path.explode file in
   118     case banner of SOME s => File.write path s | NONE => ();
   118     case banner of SOME s => File.write path s | NONE => ();
   119     xs |> chunk_list 500
   119     xs |> chunk_list 500
   120        |> List.app (File.append path o space_implode "" o map f)
   120        |> List.app (File.append path o space_implode "" o map f)
   121   end
   121   end
       
   122   handle IO.Io _ => ()
   122 
   123 
   123 fun run_mash_tool ctxt overlord save max_suggs write_cmds read_suggs =
   124 fun run_mash_tool ctxt overlord save max_suggs write_cmds read_suggs =
   124   let
   125   let
   125     val (temp_dir, serial) =
   126     val (temp_dir, serial) =
   126       if overlord then (getenv "ISABELLE_HOME_USER", "")
   127       if overlord then (getenv "ISABELLE_HOME_USER", "")
   202   | _ => ("", [])
   203   | _ => ("", [])
   203 
   204 
   204 fun mash_CLEAR ctxt =
   205 fun mash_CLEAR ctxt =
   205   let val path = mash_model_dir () in
   206   let val path = mash_model_dir () in
   206     trace_msg ctxt (K "MaSh CLEAR");
   207     trace_msg ctxt (K "MaSh CLEAR");
   207     File.fold_dir (fn file => fn _ =>
   208     try (File.fold_dir (fn file => fn _ =>
   208                       try File.rm (Path.append path (Path.basic file)))
   209                            try File.rm (Path.append path (Path.basic file)))
   209                   path NONE;
   210                        path) NONE;
   210     ()
   211     ()
   211   end
   212   end
   212 
   213 
   213 fun mash_ADD _ _ [] = ()
   214 fun mash_ADD _ _ [] = ()
   214   | mash_ADD ctxt overlord adds =
   215   | mash_ADD ctxt overlord adds =