# HG changeset patch # User wenzelm # Date 1372584616 -7200 # Node ID b1565e37678bfa69a060cb4752d868c14870bbb1 # Parent eed5cbe46f52aa81789ba5c64cb1e0fe601302ba just one alternative proof syntax, which also works for Proof_Syntax.pretty_proof/Proof_Syntax.read_proof roundtrip; diff -r eed5cbe46f52 -r b1565e37678b src/Doc/IsarImplementation/Logic.thy --- a/src/Doc/IsarImplementation/Logic.thy Sun Jun 30 09:26:00 2013 +0200 +++ b/src/Doc/IsarImplementation/Logic.thy Sun Jun 30 11:30:16 2013 +0200 @@ -1303,7 +1303,7 @@ \begin{supertabular}{rclr} @{syntax_def (inner) proof} & = & @{verbatim Lam} @{text params} @{verbatim "."} @{text proof} \\ - & @{text "|"} & @{text "\"} @{text "params"} @{verbatim "."} @{text proof} \\ + & @{text "|"} & @{text "\<^bold>\"} @{text "params"} @{verbatim "."} @{text proof} \\ & @{text "|"} & @{text proof} @{verbatim "%"} @{text any} \\ & @{text "|"} & @{text proof} @{text "\"} @{text any} \\ & @{text "|"} & @{text proof} @{verbatim "%%"} @{text proof} \\ @@ -1448,9 +1448,9 @@ val prf = Proof_Syntax.read_proof thy true false "impI \ _ \ _ \ \ - \ (Lam H: _. \ + \ (\<^bold>\H: _. \ \ conjE \ _ \ _ \ _ \ H \ \ - \ (Lam (H: _) Ha: _. conjI \ _ \ _ \ Ha \ H))"; + \ (\<^bold>\(H: _) Ha: _. conjI \ _ \ _ \ Ha \ H))"; val thm = prf |> Reconstruct.reconstruct_proof thy @{prop "A \ B \ B \ A"} diff -r eed5cbe46f52 -r b1565e37678b src/HOL/Extraction.thy --- a/src/HOL/Extraction.thy Sun Jun 30 09:26:00 2013 +0200 +++ b/src/HOL/Extraction.thy Sun Jun 30 11:30:16 2013 +0200 @@ -203,209 +203,209 @@ realizers impI (P, Q): "\pq. pq" - "\ (c: _) (d: _) P Q pq (h: _). allI \ _ \ c \ (\ x. impI \ _ \ _ \ (h \ x))" + "\<^bold>\(c: _) (d: _) P Q pq (h: _). allI \ _ \ c \ (\<^bold>\x. impI \ _ \ _ \ (h \ x))" impI (P): "Null" - "\ (c: _) P Q (h: _). allI \ _ \ c \ (\ x. impI \ _ \ _ \ (h \ x))" + "\<^bold>\(c: _) P Q (h: _). allI \ _ \ c \ (\<^bold>\x. impI \ _ \ _ \ (h \ x))" - impI (Q): "\q. q" "\ (c: _) P Q q. impI \ _ \ _" + impI (Q): "\q. q" "\<^bold>\(c: _) P Q q. impI \ _ \ _" impI: "Null" "impI" mp (P, Q): "\pq. pq" - "\ (c: _) (d: _) P Q pq (h: _) p. mp \ _ \ _ \ (spec \ _ \ p \ c \ h)" + "\<^bold>\(c: _) (d: _) P Q pq (h: _) p. mp \ _ \ _ \ (spec \ _ \ p \ c \ h)" mp (P): "Null" - "\ (c: _) P Q (h: _) p. mp \ _ \ _ \ (spec \ _ \ p \ c \ h)" + "\<^bold>\(c: _) P Q (h: _) p. mp \ _ \ _ \ (spec \ _ \ p \ c \ h)" - mp (Q): "\q. q" "\ (c: _) P Q q. mp \ _ \ _" + mp (Q): "\q. q" "\<^bold>\(c: _) P Q q. mp \ _ \ _" mp: "Null" "mp" - allI (P): "\p. p" "\ (c: _) P (d: _) p. allI \ _ \ d" + allI (P): "\p. p" "\<^bold>\(c: _) P (d: _) p. allI \ _ \ d" allI: "Null" "allI" - spec (P): "\x p. p x" "\ (c: _) P x (d: _) p. spec \ _ \ x \ d" + spec (P): "\x p. p x" "\<^bold>\(c: _) P x (d: _) p. spec \ _ \ x \ d" spec: "Null" "spec" - exI (P): "\x p. (x, p)" "\ (c: _) P x (d: _) p. exI_realizer \ P \ p \ x \ c \ d" + exI (P): "\x p. (x, p)" "\<^bold>\(c: _) P x (d: _) p. exI_realizer \ P \ p \ x \ c \ d" - exI: "\x. x" "\ P x (c: _) (h: _). h" + exI: "\x. x" "\<^bold>\P x (c: _) (h: _). h" exE (P, Q): "\p pq. let (x, y) = p in pq x y" - "\ (c: _) (d: _) P Q (e: _) p (h: _) pq. exE_realizer \ P \ p \ Q \ pq \ c \ e \ d \ h" + "\<^bold>\(c: _) (d: _) P Q (e: _) p (h: _) pq. exE_realizer \ P \ p \ Q \ pq \ c \ e \ d \ h" exE (P): "Null" - "\ (c: _) P Q (d: _) p. exE_realizer' \ _ \ _ \ _ \ c \ d" + "\<^bold>\(c: _) P Q (d: _) p. exE_realizer' \ _ \ _ \ _ \ c \ d" exE (Q): "\x pq. pq x" - "\ (c: _) P Q (d: _) x (h1: _) pq (h2: _). h2 \ x \ h1" + "\<^bold>\(c: _) P Q (d: _) x (h1: _) pq (h2: _). h2 \ x \ h1" exE: "Null" - "\ P Q (c: _) x (h1: _) (h2: _). h2 \ x \ h1" + "\<^bold>\P Q (c: _) x (h1: _) (h2: _). h2 \ x \ h1" conjI (P, Q): "Pair" - "\ (c: _) (d: _) P Q p (h: _) q. conjI_realizer \ P \ p \ Q \ q \ c \ d \ h" + "\<^bold>\(c: _) (d: _) P Q p (h: _) q. conjI_realizer \ P \ p \ Q \ q \ c \ d \ h" conjI (P): "\p. p" - "\ (c: _) P Q p. conjI \ _ \ _" + "\<^bold>\(c: _) P Q p. conjI \ _ \ _" conjI (Q): "\q. q" - "\ (c: _) P Q (h: _) q. conjI \ _ \ _ \ h" + "\<^bold>\(c: _) P Q (h: _) q. conjI \ _ \ _ \ h" conjI: "Null" "conjI" conjunct1 (P, Q): "fst" - "\ (c: _) (d: _) P Q pq. conjunct1 \ _ \ _" + "\<^bold>\(c: _) (d: _) P Q pq. conjunct1 \ _ \ _" conjunct1 (P): "\p. p" - "\ (c: _) P Q p. conjunct1 \ _ \ _" + "\<^bold>\(c: _) P Q p. conjunct1 \ _ \ _" conjunct1 (Q): "Null" - "\ (c: _) P Q q. conjunct1 \ _ \ _" + "\<^bold>\(c: _) P Q q. conjunct1 \ _ \ _" conjunct1: "Null" "conjunct1" conjunct2 (P, Q): "snd" - "\ (c: _) (d: _) P Q pq. conjunct2 \ _ \ _" + "\<^bold>\(c: _) (d: _) P Q pq. conjunct2 \ _ \ _" conjunct2 (P): "Null" - "\ (c: _) P Q p. conjunct2 \ _ \ _" + "\<^bold>\(c: _) P Q p. conjunct2 \ _ \ _" conjunct2 (Q): "\p. p" - "\ (c: _) P Q p. conjunct2 \ _ \ _" + "\<^bold>\(c: _) P Q p. conjunct2 \ _ \ _" conjunct2: "Null" "conjunct2" disjI1 (P, Q): "Inl" - "\ (c: _) (d: _) P Q p. iffD2 \ _ \ _ \ (sum.cases_1 \ P \ _ \ p \ arity_type_bool \ c \ d)" + "\<^bold>\(c: _) (d: _) P Q p. iffD2 \ _ \ _ \ (sum.cases_1 \ P \ _ \ p \ arity_type_bool \ c \ d)" disjI1 (P): "Some" - "\ (c: _) P Q p. iffD2 \ _ \ _ \ (option.cases_2 \ _ \ P \ p \ arity_type_bool \ c)" + "\<^bold>\(c: _) P Q p. iffD2 \ _ \ _ \ (option.cases_2 \ _ \ P \ p \ arity_type_bool \ c)" disjI1 (Q): "None" - "\ (c: _) P Q. iffD2 \ _ \ _ \ (option.cases_1 \ _ \ _ \ arity_type_bool \ c)" + "\<^bold>\(c: _) P Q. iffD2 \ _ \ _ \ (option.cases_1 \ _ \ _ \ arity_type_bool \ c)" disjI1: "Left" - "\ P Q. iffD2 \ _ \ _ \ (sumbool.cases_1 \ _ \ _ \ arity_type_bool)" + "\<^bold>\P Q. iffD2 \ _ \ _ \ (sumbool.cases_1 \ _ \ _ \ arity_type_bool)" disjI2 (P, Q): "Inr" - "\ (d: _) (c: _) Q P q. iffD2 \ _ \ _ \ (sum.cases_2 \ _ \ Q \ q \ arity_type_bool \ c \ d)" + "\<^bold>\(d: _) (c: _) Q P q. iffD2 \ _ \ _ \ (sum.cases_2 \ _ \ Q \ q \ arity_type_bool \ c \ d)" disjI2 (P): "None" - "\ (c: _) Q P. iffD2 \ _ \ _ \ (option.cases_1 \ _ \ _ \ arity_type_bool \ c)" + "\<^bold>\(c: _) Q P. iffD2 \ _ \ _ \ (option.cases_1 \ _ \ _ \ arity_type_bool \ c)" disjI2 (Q): "Some" - "\ (c: _) Q P q. iffD2 \ _ \ _ \ (option.cases_2 \ _ \ Q \ q \ arity_type_bool \ c)" + "\<^bold>\(c: _) Q P q. iffD2 \ _ \ _ \ (option.cases_2 \ _ \ Q \ q \ arity_type_bool \ c)" disjI2: "Right" - "\ Q P. iffD2 \ _ \ _ \ (sumbool.cases_2 \ _ \ _ \ arity_type_bool)" + "\<^bold>\Q P. iffD2 \ _ \ _ \ (sumbool.cases_2 \ _ \ _ \ arity_type_bool)" disjE (P, Q, R): "\pq pr qr. (case pq of Inl p \ pr p | Inr q \ qr q)" - "\ (c: _) (d: _) (e: _) P Q R pq (h1: _) pr (h2: _) qr. + "\<^bold>\(c: _) (d: _) (e: _) P Q R pq (h1: _) pr (h2: _) qr. disjE_realizer \ _ \ _ \ pq \ R \ pr \ qr \ c \ d \ e \ h1 \ h2" disjE (Q, R): "\pq pr qr. (case pq of None \ pr | Some q \ qr q)" - "\ (c: _) (d: _) P Q R pq (h1: _) pr (h2: _) qr. + "\<^bold>\(c: _) (d: _) P Q R pq (h1: _) pr (h2: _) qr. disjE_realizer2 \ _ \ _ \ pq \ R \ pr \ qr \ c \ d \ h1 \ h2" disjE (P, R): "\pq pr qr. (case pq of None \ qr | Some p \ pr p)" - "\ (c: _) (d: _) P Q R pq (h1: _) pr (h2: _) qr (h3: _). + "\<^bold>\(c: _) (d: _) P Q R pq (h1: _) pr (h2: _) qr (h3: _). disjE_realizer2 \ _ \ _ \ pq \ R \ qr \ pr \ c \ d \ h1 \ h3 \ h2" disjE (R): "\pq pr qr. (case pq of Left \ pr | Right \ qr)" - "\ (c: _) P Q R pq (h1: _) pr (h2: _) qr. + "\<^bold>\(c: _) P Q R pq (h1: _) pr (h2: _) qr. disjE_realizer3 \ _ \ _ \ pq \ R \ pr \ qr \ c \ h1 \ h2" disjE (P, Q): "Null" - "\ (c: _) (d: _) P Q R pq. disjE_realizer \ _ \ _ \ pq \ (\x. R) \ _ \ _ \ c \ d \ arity_type_bool" + "\<^bold>\(c: _) (d: _) P Q R pq. disjE_realizer \ _ \ _ \ pq \ (\x. R) \ _ \ _ \ c \ d \ arity_type_bool" disjE (Q): "Null" - "\ (c: _) P Q R pq. disjE_realizer2 \ _ \ _ \ pq \ (\x. R) \ _ \ _ \ c \ arity_type_bool" + "\<^bold>\(c: _) P Q R pq. disjE_realizer2 \ _ \ _ \ pq \ (\x. R) \ _ \ _ \ c \ arity_type_bool" disjE (P): "Null" - "\ (c: _) P Q R pq (h1: _) (h2: _) (h3: _). + "\<^bold>\(c: _) P Q R pq (h1: _) (h2: _) (h3: _). disjE_realizer2 \ _ \ _ \ pq \ (\x. R) \ _ \ _ \ c \ arity_type_bool \ h1 \ h3 \ h2" disjE: "Null" - "\ P Q R pq. disjE_realizer3 \ _ \ _ \ pq \ (\x. R) \ _ \ _ \ arity_type_bool" + "\<^bold>\P Q R pq. disjE_realizer3 \ _ \ _ \ pq \ (\x. R) \ _ \ _ \ arity_type_bool" FalseE (P): "default" - "\ (c: _) P. FalseE \ _" + "\<^bold>\(c: _) P. FalseE \ _" FalseE: "Null" "FalseE" notI (P): "Null" - "\ (c: _) P (h: _). allI \ _ \ c \ (\ x. notI \ _ \ (h \ x))" + "\<^bold>\(c: _) P (h: _). allI \ _ \ c \ (\<^bold>\x. notI \ _ \ (h \ x))" notI: "Null" "notI" notE (P, R): "\p. default" - "\ (c: _) (d: _) P R (h: _) p. notE \ _ \ _ \ (spec \ _ \ p \ c \ h)" + "\<^bold>\(c: _) (d: _) P R (h: _) p. notE \ _ \ _ \ (spec \ _ \ p \ c \ h)" notE (P): "Null" - "\ (c: _) P R (h: _) p. notE \ _ \ _ \ (spec \ _ \ p \ c \ h)" + "\<^bold>\(c: _) P R (h: _) p. notE \ _ \ _ \ (spec \ _ \ p \ c \ h)" notE (R): "default" - "\ (c: _) P R. notE \ _ \ _" + "\<^bold>\(c: _) P R. notE \ _ \ _" notE: "Null" "notE" subst (P): "\s t ps. ps" - "\ (c: _) s t P (d: _) (h: _) ps. subst \ s \ t \ P ps \ d \ h" + "\<^bold>\(c: _) s t P (d: _) (h: _) ps. subst \ s \ t \ P ps \ d \ h" subst: "Null" "subst" iffD1 (P, Q): "fst" - "\ (d: _) (c: _) Q P pq (h: _) p. + "\<^bold>\(d: _) (c: _) Q P pq (h: _) p. mp \ _ \ _ \ (spec \ _ \ p \ d \ (conjunct1 \ _ \ _ \ h))" iffD1 (P): "\p. p" - "\ (c: _) Q P p (h: _). mp \ _ \ _ \ (conjunct1 \ _ \ _ \ h)" + "\<^bold>\(c: _) Q P p (h: _). mp \ _ \ _ \ (conjunct1 \ _ \ _ \ h)" iffD1 (Q): "Null" - "\ (c: _) Q P q1 (h: _) q2. + "\<^bold>\(c: _) Q P q1 (h: _) q2. mp \ _ \ _ \ (spec \ _ \ q2 \ c \ (conjunct1 \ _ \ _ \ h))" iffD1: "Null" "iffD1" iffD2 (P, Q): "snd" - "\ (c: _) (d: _) P Q pq (h: _) q. + "\<^bold>\(c: _) (d: _) P Q pq (h: _) q. mp \ _ \ _ \ (spec \ _ \ q \ d \ (conjunct2 \ _ \ _ \ h))" iffD2 (P): "\p. p" - "\ (c: _) P Q p (h: _). mp \ _ \ _ \ (conjunct2 \ _ \ _ \ h)" + "\<^bold>\(c: _) P Q p (h: _). mp \ _ \ _ \ (conjunct2 \ _ \ _ \ h)" iffD2 (Q): "Null" - "\ (c: _) P Q q1 (h: _) q2. + "\<^bold>\(c: _) P Q q1 (h: _) q2. mp \ _ \ _ \ (spec \ _ \ q2 \ c \ (conjunct2 \ _ \ _ \ h))" iffD2: "Null" "iffD2" iffI (P, Q): "Pair" - "\ (c: _) (d: _) P Q pq (h1 : _) qp (h2 : _). conjI_realizer \ + "\<^bold>\(c: _) (d: _) P Q pq (h1 : _) qp (h2 : _). conjI_realizer \ (\pq. \x. P x \ Q (pq x)) \ pq \ (\qp. \x. Q x \ P (qp x)) \ qp \ (arity_type_fun \ c \ d) \ (arity_type_fun \ d \ c) \ - (allI \ _ \ c \ (\ x. impI \ _ \ _ \ (h1 \ x))) \ - (allI \ _ \ d \ (\ x. impI \ _ \ _ \ (h2 \ x)))" + (allI \ _ \ c \ (\<^bold>\x. impI \ _ \ _ \ (h1 \ x))) \ + (allI \ _ \ d \ (\<^bold>\x. impI \ _ \ _ \ (h2 \ x)))" iffI (P): "\p. p" - "\ (c: _) P Q (h1 : _) p (h2 : _). conjI \ _ \ _ \ - (allI \ _ \ c \ (\ x. impI \ _ \ _ \ (h1 \ x))) \ + "\<^bold>\(c: _) P Q (h1 : _) p (h2 : _). conjI \ _ \ _ \ + (allI \ _ \ c \ (\<^bold>\x. impI \ _ \ _ \ (h1 \ x))) \ (impI \ _ \ _ \ h2)" iffI (Q): "\q. q" - "\ (c: _) P Q q (h1 : _) (h2 : _). conjI \ _ \ _ \ + "\<^bold>\(c: _) P Q q (h1 : _) (h2 : _). conjI \ _ \ _ \ (impI \ _ \ _ \ h1) \ - (allI \ _ \ c \ (\ x. impI \ _ \ _ \ (h2 \ x)))" + (allI \ _ \ c \ (\<^bold>\x. impI \ _ \ _ \ (h2 \ x)))" iffI: "Null" "iffI" diff -r eed5cbe46f52 -r b1565e37678b src/Pure/Proof/proof_syntax.ML --- a/src/Pure/Proof/proof_syntax.ML Sun Jun 30 09:26:00 2013 +0200 +++ b/src/Pure/Proof/proof_syntax.ML Sun Jun 30 11:30:16 2013 +0200 @@ -64,11 +64,9 @@ ("", idtT --> paramsT, Delimfix "_"), ("", paramT --> paramsT, Delimfix "_")] |> Sign.add_modesyntax_i (Symbol.xsymbolsN, true) - [("_Lam", [paramsT, proofT] ---> proofT, Mixfix ("(1\\_./ _)", [0, 3], 3)), + [("_Lam", [paramsT, proofT] ---> proofT, Mixfix ("(1\\<^bold>\\_./ _)", [0, 3], 3)), (Lexicon.mark_const "Appt", [proofT, aT] ---> proofT, Mixfix ("(1_ \\/ _)", [4, 5], 4)), (Lexicon.mark_const "AppP", [proofT, proofT] ---> proofT, Mixfix ("(1_ \\/ _)", [4, 5], 4))] - |> Sign.add_modesyntax_i ("latex", false) - [("_Lam", [paramsT, proofT] ---> proofT, Mixfix ("(1\\<^bold>\\_./ _)", [0, 3], 3))] |> Sign.add_trrules (map Syntax.Parse_Print_Rule [(Ast.mk_appl (Ast.Constant "_Lam") [Ast.mk_appl (Ast.Constant "_Lam0")