src/Pure/Isar/isar_cmd.ML
changeset 7413 e25ad9ab0b50
parent 7308 e01aab03a2a1
child 7462 f738df1d82e1
equal deleted inserted replaced
7412:35ebe1452c10 7413:e25ad9ab0b50
    11   val quit: Toplevel.transition -> Toplevel.transition
    11   val quit: Toplevel.transition -> Toplevel.transition
    12   val init_toplevel: Toplevel.transition -> Toplevel.transition
    12   val init_toplevel: Toplevel.transition -> Toplevel.transition
    13   val touch_all_thys: Toplevel.transition -> Toplevel.transition
    13   val touch_all_thys: Toplevel.transition -> Toplevel.transition
    14   val touch_thy: string -> Toplevel.transition -> Toplevel.transition
    14   val touch_thy: string -> Toplevel.transition -> Toplevel.transition
    15   val remove_thy: string -> Toplevel.transition -> Toplevel.transition
    15   val remove_thy: string -> Toplevel.transition -> Toplevel.transition
    16   val kill_theory: Toplevel.transition -> Toplevel.transition
       
    17   val cannot_undo: string -> Toplevel.transition -> Toplevel.transition
    16   val cannot_undo: string -> Toplevel.transition -> Toplevel.transition
    18   val clear_undo: Toplevel.transition -> Toplevel.transition
    17   val clear_undo: Toplevel.transition -> Toplevel.transition
    19   val redo: Toplevel.transition -> Toplevel.transition
    18   val redo: Toplevel.transition -> Toplevel.transition
    20   val undos_proof: int -> Toplevel.transition -> Toplevel.transition
    19   val undos_proof: int -> Toplevel.transition -> Toplevel.transition
    21   val kill_proof: Toplevel.transition -> Toplevel.transition
    20   val kill_proof: Toplevel.transition -> Toplevel.transition
    65 (* touch theories *)
    64 (* touch theories *)
    66 
    65 
    67 val touch_all_thys = Toplevel.imperative ThyInfo.touch_all_thys;
    66 val touch_all_thys = Toplevel.imperative ThyInfo.touch_all_thys;
    68 fun touch_thy name = Toplevel.imperative (fn () => ThyInfo.touch_thy name);
    67 fun touch_thy name = Toplevel.imperative (fn () => ThyInfo.touch_thy name);
    69 fun remove_thy name = Toplevel.imperative (fn () => ThyInfo.remove_thy name);
    68 fun remove_thy name = Toplevel.imperative (fn () => ThyInfo.remove_thy name);
    70 val kill_theory = Toplevel.imperative (fn () => warning "Nothing to kill.") o Toplevel.kill;
       
    71 
    69 
    72 
    70 
    73 (* history commands *)
    71 (* history commands *)
    74 
    72 
    75 fun cannot_undo txt = Toplevel.imperative (fn () => error ("Cannot undo " ^ quote txt));
    73 fun cannot_undo txt = Toplevel.imperative (fn () => error ("Cannot undo " ^ quote txt));
    85   | Toplevel.Proof _ => History.undo hist));
    83   | Toplevel.Proof _ => History.undo hist));
    86 
    84 
    87 val undo_theory = Toplevel.history (fn hist =>
    85 val undo_theory = Toplevel.history (fn hist =>
    88   if History.is_initial hist then raise Toplevel.UNDEF else History.undo hist);
    86   if History.is_initial hist then raise Toplevel.UNDEF else History.undo hist);
    89 
    87 
    90 val undo = kill_theory o undo_theory o undos_proof 1;
    88 val undo = Toplevel.kill o undo_theory o undos_proof 1;
    91 
    89 
    92 
    90 
    93 (* use ML text *)
    91 (* use ML text *)
    94 
    92 
    95 fun use name = Toplevel.keep (fn state =>
    93 fun use name = Toplevel.keep (fn state =>
   146 
   144 
   147 (* print theorems / types / terms / props *)
   145 (* print theorems / types / terms / props *)
   148 
   146 
   149 fun print_thms args = Toplevel.keep (fn state =>
   147 fun print_thms args = Toplevel.keep (fn state =>
   150   let val st = Toplevel.node_case Proof.init_state Proof.enter_forward state
   148   let val st = Toplevel.node_case Proof.init_state Proof.enter_forward state
   151   in Display.print_thms (IsarThy.get_thmss args st) end);
   149   in Pretty.writeln (Proof.pretty_thms (IsarThy.get_thmss args st)) end);
   152 
   150 
   153 
   151 
   154 fun read_typ thy = Sign.read_typ (Theory.sign_of thy, K None);
   152 fun read_typ thy = Sign.read_typ (Theory.sign_of thy, K None);
   155 
   153 
   156 fun read_term T thy s =
   154 fun read_term T thy s =