src/Pure/Thy/thy_info.ML
changeset 72624 35524fade6a4
parent 72622 830222403681
child 72638 2a7fc87495e0
equal deleted inserted replaced
72623:e788488b0607 72624:35524fade6a4
    17   val lookup_theory: string -> theory option
    17   val lookup_theory: string -> theory option
    18   val get_theory: string -> theory
    18   val get_theory: string -> theory
    19   val master_directory: string -> Path.T
    19   val master_directory: string -> Path.T
    20   val remove_thy: string -> unit
    20   val remove_thy: string -> unit
    21   type context = {options: Options.T, last_timing: Toplevel.transition -> Time.time}
    21   type context = {options: Options.T, last_timing: Toplevel.transition -> Time.time}
    22   val use_theories: context -> string -> Path.T -> (string * Position.T) list -> unit
    22   val use_theories: context -> string -> (string * Position.T) list -> unit
    23   val use_thy: string -> unit
    23   val use_thy: string -> unit
    24   val script_thy: Position.T -> string -> theory -> theory
    24   val script_thy: Position.T -> string -> theory -> theory
    25   val register_thy: theory -> unit
    25   val register_thy: theory -> unit
    26   val finish: unit -> unit
    26   val finish: unit -> unit
    27 end;
    27 end;
   426 end;
   426 end;
   427 
   427 
   428 
   428 
   429 (* use theories *)
   429 (* use theories *)
   430 
   430 
   431 fun use_theories context qualifier master_dir imports =
   431 fun use_theories context qualifier imports =
   432   let val (_, tasks) = require_thys context [] qualifier master_dir imports String_Graph.empty
   432   let val (_, tasks) = require_thys context [] qualifier Path.current imports String_Graph.empty
   433   in if Multithreading.max_threads () > 1 then schedule_futures tasks else schedule_seq tasks end;
   433   in if Multithreading.max_threads () > 1 then schedule_futures tasks else schedule_seq tasks end;
   434 
   434 
   435 fun use_thy name =
   435 fun use_thy name =
   436   use_theories (default_context ()) Resources.default_qualifier
   436   use_theories (default_context ()) Resources.default_qualifier [(name, Position.none)];
   437     Path.current [(name, Position.none)];
       
   438 
   437 
   439 
   438 
   440 (* toplevel scripting -- without maintaining database *)
   439 (* toplevel scripting -- without maintaining database *)
   441 
   440 
   442 fun script_thy pos txt thy =
   441 fun script_thy pos txt thy =