src/Pure/display.ML
changeset 2992 395686b418a4
parent 2226 f3c6a22681b1
child 3531 f6cc9112f4e9
equal deleted inserted replaced
2991:d9f6299dbf9f 2992:395686b418a4
   173 
   173 
   174     val (tpairs, As, B) = Logic.strip_horn prop;
   174     val (tpairs, As, B) = Logic.strip_horn prop;
   175     val ngoals = length As;
   175     val ngoals = length As;
   176 
   176 
   177     val orig_no_freeTs = ! show_no_free_types;
   177     val orig_no_freeTs = ! show_no_free_types;
       
   178     val orig_types = ! show_types;
   178     val orig_sorts = ! show_sorts;
   179     val orig_sorts = ! show_sorts;
   179 
   180 
   180     fun restore () =
   181     fun restore () =
   181       (show_no_free_types := orig_no_freeTs; show_sorts := orig_sorts);
   182       (show_no_free_types := orig_no_freeTs;
       
   183         show_types := orig_types;
       
   184         show_sorts := orig_sorts);
   182   in
   185   in
   183     (show_no_free_types := true; show_sorts := false;
   186     (show_no_free_types := true;
       
   187       show_types := (orig_types orelse orig_sorts);
       
   188       show_sorts := false;
   184       Pretty.writeln (pretty_term B);
   189       Pretty.writeln (pretty_term B);
   185       if ngoals = 0 then writeln "No subgoals!"
   190       if ngoals = 0 then writeln "No subgoals!"
   186       else if ngoals > maxgoals then
   191       else if ngoals > maxgoals then
   187         (print_goals (1, take (maxgoals, As));
   192         (print_goals (1, take (maxgoals, As));
   188           writeln ("A total of " ^ string_of_int ngoals ^ " subgoals..."))
   193           writeln ("A total of " ^ string_of_int ngoals ^ " subgoals..."))
   190 
   195 
   191       print_ffpairs tpairs;
   196       print_ffpairs tpairs;
   192 
   197 
   193       if orig_sorts then
   198       if orig_sorts then
   194         (print_types prop; print_sorts prop)
   199         (print_types prop; print_sorts prop)
   195       else if ! show_types then
   200       else if orig_types then
   196         print_types prop
   201         print_types prop
   197       else ())
   202       else ())
   198     handle exn => (restore (); raise exn);
   203     handle exn => (restore (); raise exn);
   199     restore ()
   204     restore ()
   200   end;
   205   end;