src/Pure/Thy/thy_output.ML
changeset 27381 19ae7064f00f
parent 27344 d44490b06190
child 27522 b819d3b263a0
     1.1 --- a/src/Pure/Thy/thy_output.ML	Sat Jun 28 15:30:46 2008 +0200
     1.2 +++ b/src/Pure/Thy/thy_output.ML	Sat Jun 28 21:21:13 2008 +0200
     1.3 @@ -463,15 +463,13 @@
     1.4      val t' = Term.betapplys (Envir.expand_atom T (U, u), args);
     1.5    in pretty_term_abbrev ctxt (Logic.mk_equals (t, t')) end;
     1.6  
     1.7 -fun pretty_fact ctxt (prop, method_text) =
     1.8 +fun pretty_lemma ctxt (prop, method_text) =
     1.9    let
    1.10      val _ = ctxt
    1.11        |> Proof.theorem_i NONE (K I) [[(prop, [])]]
    1.12        |> Proof.global_terminal_proof (method_text, NONE);
    1.13    in pretty_term ctxt prop end;
    1.14  
    1.15 -val hd_src = Args.src o (apfst o apsnd) (single o hd) o Args.dest_src;
    1.16 -
    1.17  fun pretty_thm ctxt = pretty_term ctxt o Thm.full_prop_of;
    1.18  
    1.19  fun pretty_term_style ctxt (name, t) =
    1.20 @@ -529,11 +527,17 @@
    1.21  
    1.22  (* commands *)
    1.23  
    1.24 +val embedded_lemma =
    1.25 +  args (Args.prop -- Scan.lift (Args.$$$ "by" |-- Method.parse_args))
    1.26 +    (output pretty_lemma o (fn ((a, arg :: _), p) => (Args.src ((a, [arg]), p))) o Args.dest_src);
    1.27 +
    1.28 +val _ = OuterKeyword.keyword "by";
    1.29 +
    1.30  val _ = add_commands
    1.31   [("thm", args Attrib.thms (output_list pretty_thm)),
    1.32    ("thm_style", args (Scan.lift Args.liberal_name -- Attrib.thm) (output pretty_thm_style)),
    1.33    ("prop", args Args.prop (output pretty_term)),
    1.34 -  ("lemma", args (Args.prop -- Scan.lift Method.simple_text) (output pretty_fact o hd_src)),
    1.35 +  ("lemma", embedded_lemma),
    1.36    ("term", args Args.term (output pretty_term)),
    1.37    ("term_style", args (Scan.lift Args.liberal_name -- Args.term) (output pretty_term_style)),
    1.38    ("term_type", args Args.term (output pretty_term_typ)),