src/Pure/Thy/thy_info.ML
changeset 44225 a8f921e6484f
parent 44222 9d5ef6cd4ee1
child 44247 270366301bd7
equal deleted inserted replaced
44224:4040d0ffac7b 44225:a8f921e6484f
     7 
     7 
     8 signature THY_INFO =
     8 signature THY_INFO =
     9 sig
     9 sig
    10   datatype action = Update | Remove
    10   datatype action = Update | Remove
    11   val add_hook: (action -> string -> unit) -> unit
    11   val add_hook: (action -> string -> unit) -> unit
    12   val base_name: string -> string
       
    13   val get_names: unit -> string list
    12   val get_names: unit -> string list
    14   val status: unit -> unit
    13   val status: unit -> unit
    15   val lookup_theory: string -> theory option
    14   val lookup_theory: string -> theory option
    16   val get_theory: string -> theory
    15   val get_theory: string -> theory
    17   val is_finished: string -> bool
    16   val is_finished: string -> bool
    44 
    43 
    45 
    44 
    46 
    45 
    47 (** thy database **)
    46 (** thy database **)
    48 
    47 
    49 (* base name *)
       
    50 
       
    51 fun base_name s = Path.implode (Path.base (Path.explode s));
       
    52 
       
    53 
       
    54 (* messages *)
    48 (* messages *)
    55 
    49 
    56 fun loader_msg txt [] = "Theory loader: " ^ txt
    50 fun loader_msg txt [] = "Theory loader: " ^ txt
    57   | loader_msg txt names = "Theory loader: " ^ txt ^ " " ^ commas_quote names;
    51   | loader_msg txt names = "Theory loader: " ^ txt ^ " " ^ commas_quote names;
    58 
    52 
    76   imports: string list};  (*source specification of imports (partially qualified)*)
    70   imports: string list};  (*source specification of imports (partially qualified)*)
    77 
    71 
    78 fun make_deps master imports : deps = {master = master, imports = imports};
    72 fun make_deps master imports : deps = {master = master, imports = imports};
    79 
    73 
    80 fun master_dir (d: deps option) = the_default Path.current (Option.map (Path.dir o #1 o #master) d);
    74 fun master_dir (d: deps option) = the_default Path.current (Option.map (Path.dir o #1 o #master) d);
       
    75 fun base_name s = Path.implode (Path.base (Path.explode s));
    81 
    76 
    82 local
    77 local
    83   val database = Unsynchronized.ref (Graph.empty: (deps option * theory option) Graph.T);
    78   val database = Unsynchronized.ref (Graph.empty: (deps option * theory option) Graph.T);
    84 in
    79 in
    85   fun get_thys () = ! database;
    80   fun get_thys () = ! database;