# HG changeset patch # User wenzelm # Date 1444504138 -7200 # Node ID 92e97b800d1e07ae4c532eafa41aa96c8d6ab5bb # Parent f068e84cb9f3f033e36c78f2e095acea323e4f08 tuned syntax -- more symbols; diff -r f068e84cb9f3 -r 92e97b800d1e src/Cube/Cube.thy --- a/src/Cube/Cube.thy Sat Oct 10 21:03:35 2015 +0200 +++ b/src/Cube/Cube.thy Sat Oct 10 21:08:58 2015 +0200 @@ -24,7 +24,7 @@ Context :: "[typing, context] \ context" and star :: "term" ("*") and box :: "term" ("\") and - app :: "[term, term] \ term" (infixl "^" 20) and + app :: "[term, term] \ term" (infixl "\" 20) and Has_type :: "[term, term] \ typing" nonterminal context' and typing' @@ -36,8 +36,8 @@ "_MT_context" :: "context'" ("") "_Context" :: "[typing', context'] \ context'" ("_ _") "_Has_type" :: "[term, term] \ typing'" ("(_:/ _)" [0, 0] 5) - "_Lam" :: "[idt, term, term] \ term" ("(3\ _:_./ _)" [0, 0, 0] 10) - "_Pi" :: "[idt, term, term] \ term" ("(3\ _:_./ _)" [0, 0] 10) + "_Lam" :: "[idt, term, term] \ term" ("(3\<^bold>\_:_./ _)" [0, 0, 0] 10) + "_Pi" :: "[idt, term, term] \ term" ("(3\_:_./ _)" [0, 0] 10) "_arrow" :: "[term, term] \ term" (infixr "\" 10) translations "_Trueprop(G, t)" \ "CONST Trueprop(G, t)" @@ -45,12 +45,12 @@ "_MT_context" \ "CONST MT_context" "_Context" \ "CONST Context" "_Has_type" \ "CONST Has_type" - "\ x:A. B" \ "CONST Abs(A, \x. B)" - "\ x:A. B" \ "CONST Prod(A, \x. B)" + "\<^bold>\x:A. B" \ "CONST Abs(A, \x. B)" + "\x:A. B" \ "CONST Prod(A, \x. B)" "A \ B" \ "CONST Prod(A, \_. B)" syntax - "_Pi" :: "[idt, term, term] \ term" ("(3\ _:_./ _)" [0, 0] 10) + "_Pi" :: "[idt, term, term] \ term" ("(3\_:_./ _)" [0, 0] 10) print_translation \ [(@{const_syntax Prod}, fn _ => Syntax_Trans.dependent_tr' (@{syntax_const "_Pi"}, @{syntax_const "_arrow"}))] @@ -62,23 +62,23 @@ strip_s: "\A:*; a:A \ G \ x:X\ \ a:A G \ x:X" and strip_b: "\A:\; a:A \ G \ x:X\ \ a:A G \ x:X" and - app: "\F:Prod(A, B); C:A\ \ F^C: B(C)" and + app: "\F:Prod(A, B); C:A\ \ F\C: B(C)" and pi_ss: "\A:*; \x. x:A \ B(x):*\ \ Prod(A, B):*" and lam_ss: "\A:*; \x. x:A \ f(x):B(x); \x. x:A \ B(x):* \ \ Abs(A, f) : Prod(A, B)" and - beta: "Abs(A, f)^a \ f(a)" + beta: "Abs(A, f)\a \ f(a)" lemmas [rules] = s_b strip_s strip_b app lam_ss pi_ss lemma imp_elim: - assumes "f:A\B" and "a:A" and "f^a:B \ PROP P" + assumes "f:A\B" and "a:A" and "f\a:B \ PROP P" shows "PROP P" by (rule app assms)+ lemma pi_elim: - assumes "F:Prod(A,B)" and "a:A" and "F^a:B(a) \ PROP P" + assumes "F:Prod(A,B)" and "a:A" and "F\a:B(a) \ PROP P" shows "PROP P" by (rule app assms)+ diff -r f068e84cb9f3 -r 92e97b800d1e src/Cube/Example.thy --- a/src/Cube/Example.thy Sat Oct 10 21:03:35 2015 +0200 +++ b/src/Cube/Example.thy Sat Oct 10 21:08:58 2015 +0200 @@ -28,52 +28,52 @@ schematic_goal "A:* \ A\A : ?T" by (depth_solve rules) -schematic_goal "A:* \ \ a:A. a : ?T" +schematic_goal "A:* \ \<^bold>\a:A. a : ?T" by (depth_solve rules) -schematic_goal "A:* B:* b:B \ \ x:A. b : ?T" +schematic_goal "A:* B:* b:B \ \<^bold>\x:A. b : ?T" by (depth_solve rules) -schematic_goal "A:* b:A \ (\ a:A. a)^b: ?T" +schematic_goal "A:* b:A \ (\<^bold>\a:A. a)\b: ?T" by (depth_solve rules) -schematic_goal "A:* B:* c:A b:B \ (\ x:A. b)^ c: ?T" +schematic_goal "A:* B:* c:A b:B \ (\<^bold>\x:A. b)\ c: ?T" by (depth_solve rules) -schematic_goal "A:* B:* \ \ a:A. \ b:B. a : ?T" +schematic_goal "A:* B:* \ \<^bold>\a:A. \<^bold>\b:B. a : ?T" by (depth_solve rules) subsection \Second-order types\ -schematic_goal (in L2) "\ \ A:*. \ a:A. a : ?T" +schematic_goal (in L2) "\ \<^bold>\A:*. \<^bold>\a:A. a : ?T" by (depth_solve rules) -schematic_goal (in L2) "A:* \ (\ B:*.\ b:B. b)^A : ?T" +schematic_goal (in L2) "A:* \ (\<^bold>\B:*.\<^bold>\b:B. b)\A : ?T" by (depth_solve rules) -schematic_goal (in L2) "A:* b:A \ (\ B:*.\ b:B. b) ^ A ^ b: ?T" +schematic_goal (in L2) "A:* b:A \ (\<^bold>\B:*.\<^bold>\b:B. b) \ A \ b: ?T" by (depth_solve rules) -schematic_goal (in L2) "\ \ B:*.\ a:(\ A:*.A).a ^ ((\ A:*.A)\B) ^ a: ?T" +schematic_goal (in L2) "\ \<^bold>\B:*.\<^bold>\a:(\A:*.A).a \ ((\A:*.A)\B) \ a: ?T" by (depth_solve rules) subsection \Weakly higher-order propositional logic\ -schematic_goal (in Lomega) "\ \ A:*.A\A : ?T" +schematic_goal (in Lomega) "\ \<^bold>\A:*.A\A : ?T" by (depth_solve rules) -schematic_goal (in Lomega) "B:* \ (\ A:*.A\A) ^ B : ?T" +schematic_goal (in Lomega) "B:* \ (\<^bold>\A:*.A\A) \ B : ?T" by (depth_solve rules) -schematic_goal (in Lomega) "B:* b:B \ (\ y:B. b): ?T" +schematic_goal (in Lomega) "B:* b:B \ (\<^bold>\y:B. b): ?T" by (depth_solve rules) -schematic_goal (in Lomega) "A:* F:*\* \ F^(F^A): ?T" +schematic_goal (in Lomega) "A:* F:*\* \ F\(F\A): ?T" by (depth_solve rules) -schematic_goal (in Lomega) "A:* \ \ F:*\*.F^(F^A): ?T" +schematic_goal (in Lomega) "A:* \ \<^bold>\F:*\*.F\(F\A): ?T" by (depth_solve rules) @@ -82,41 +82,41 @@ schematic_goal (in LP) "A:* \ A \ * : ?T" by (depth_solve rules) -schematic_goal (in LP) "A:* P:A\* a:A \ P^a: ?T" +schematic_goal (in LP) "A:* P:A\* a:A \ P\a: ?T" by (depth_solve rules) -schematic_goal (in LP) "A:* P:A\A\* a:A \ \ a:A. P^a^a: ?T" +schematic_goal (in LP) "A:* P:A\A\* a:A \ \a:A. P\a\a: ?T" by (depth_solve rules) -schematic_goal (in LP) "A:* P:A\* Q:A\* \ \ a:A. P^a \ Q^a: ?T" +schematic_goal (in LP) "A:* P:A\* Q:A\* \ \a:A. P\a \ Q\a: ?T" by (depth_solve rules) -schematic_goal (in LP) "A:* P:A\* \ \ a:A. P^a \ P^a: ?T" +schematic_goal (in LP) "A:* P:A\* \ \a:A. P\a \ P\a: ?T" by (depth_solve rules) -schematic_goal (in LP) "A:* P:A\* \ \ a:A. \ x:P^a. x: ?T" +schematic_goal (in LP) "A:* P:A\* \ \<^bold>\a:A. \<^bold>\x:P\a. x: ?T" by (depth_solve rules) -schematic_goal (in LP) "A:* P:A\* Q:* \ (\ a:A. P^a\Q) \ (\ a:A. P^a) \ Q : ?T" +schematic_goal (in LP) "A:* P:A\* Q:* \ (\a:A. P\a\Q) \ (\a:A. P\a) \ Q : ?T" by (depth_solve rules) schematic_goal (in LP) "A:* P:A\* Q:* a0:A \ - \ x:\ a:A. P^a\Q. \ y:\ a:A. P^a. x^a0^(y^a0): ?T" + \<^bold>\x:\a:A. P\a\Q. \<^bold>\y:\a:A. P\a. x\a0\(y\a0): ?T" by (depth_solve rules) subsection \Omega-order types\ -schematic_goal (in L2) "A:* B:* \ \ C:*.(A\B\C)\C : ?T" +schematic_goal (in L2) "A:* B:* \ \C:*.(A\B\C)\C : ?T" by (depth_solve rules) -schematic_goal (in Lomega2) "\ \ A:*.\ B:*.\ C:*.(A\B\C)\C : ?T" +schematic_goal (in Lomega2) "\ \<^bold>\A:*.\<^bold>\B:*.\C:*.(A\B\C)\C : ?T" by (depth_solve rules) -schematic_goal (in Lomega2) "\ \ A:*.\ B:*.\ x:A. \ y:B. x : ?T" +schematic_goal (in Lomega2) "\ \<^bold>\A:*.\<^bold>\B:*.\<^bold>\x:A. \<^bold>\y:B. x : ?T" by (depth_solve rules) -schematic_goal (in Lomega2) "A:* B:* \ ?p : (A\B) \ ((B\\ P:*.P)\(A\\ P:*.P))" +schematic_goal (in Lomega2) "A:* B:* \ ?p : (A\B) \ ((B\\P:*.P)\(A\\P:*.P))" apply (strip_asms rules) apply (rule lam_ss) apply (depth_solve1 rules) @@ -140,15 +140,15 @@ subsection \Second-order Predicate Logic\ -schematic_goal (in LP2) "A:* P:A\* \ \ a:A. P^a\(\ A:*.A) : ?T" +schematic_goal (in LP2) "A:* P:A\* \ \<^bold>\a:A. P\a\(\A:*.A) : ?T" by (depth_solve rules) schematic_goal (in LP2) "A:* P:A\A\* \ - (\ a:A. \ b:A. P^a^b\P^b^a\\ P:*.P) \ \ a:A. P^a^a\\ P:*.P : ?T" + (\a:A. \b:A. P\a\b\P\b\a\\P:*.P) \ \a:A. P\a\a\\P:*.P : ?T" by (depth_solve rules) schematic_goal (in LP2) "A:* P:A\A\* \ - ?p: (\ a:A. \ b:A. P^a^b\P^b^a\\ P:*.P) \ \ a:A. P^a^a\\ P:*.P" + ?p: (\a:A. \b:A. P\a\b\P\b\a\\P:*.P) \ \a:A. P\a\a\\P:*.P" -- \Antisymmetry implies irreflexivity:\ apply (strip_asms rules) apply (rule lam_ss) @@ -169,22 +169,22 @@ subsection \LPomega\ -schematic_goal (in LPomega) "A:* \ \ P:A\A\*.\ a:A. P^a^a : ?T" +schematic_goal (in LPomega) "A:* \ \<^bold>\P:A\A\*.\<^bold>\a:A. P\a\a : ?T" by (depth_solve rules) -schematic_goal (in LPomega) "\ \ A:*.\ P:A\A\*.\ a:A. P^a^a : ?T" +schematic_goal (in LPomega) "\ \<^bold>\A:*.\<^bold>\P:A\A\*.\<^bold>\a:A. P\a\a : ?T" by (depth_solve rules) subsection \Constructions\ -schematic_goal (in CC) "\ \ A:*.\ P:A\*.\ a:A. P^a\\ P:*.P: ?T" +schematic_goal (in CC) "\ \<^bold>\A:*.\<^bold>\P:A\*.\<^bold>\a:A. P\a\\P:*.P: ?T" by (depth_solve rules) -schematic_goal (in CC) "\ \ A:*.\ P:A\*.\ a:A. P^a: ?T" +schematic_goal (in CC) "\ \<^bold>\A:*.\<^bold>\P:A\*.\a:A. P\a: ?T" by (depth_solve rules) -schematic_goal (in CC) "A:* P:A\* a:A \ ?p : (\ a:A. P^a)\P^a" +schematic_goal (in CC) "A:* P:A\* a:A \ ?p : (\a:A. P\a)\P\a" apply (strip_asms rules) apply (rule lam_ss) apply (depth_solve1 rules) @@ -197,22 +197,22 @@ subsection \Some random examples\ schematic_goal (in LP2) "A:* c:A f:A\A \ - \ a:A. \ P:A\*.P^c \ (\ x:A. P^x\P^(f^x)) \ P^a : ?T" + \<^bold>\a:A. \P:A\*.P\c \ (\x:A. P\x\P\(f\x)) \ P\a : ?T" by (depth_solve rules) -schematic_goal (in CC) "\ A:*.\ c:A. \ f:A\A. - \ a:A. \ P:A\*.P^c \ (\ x:A. P^x\P^(f^x)) \ P^a : ?T" +schematic_goal (in CC) "\<^bold>\A:*.\<^bold>\c:A. \<^bold>\f:A\A. + \<^bold>\a:A. \P:A\*.P\c \ (\x:A. P\x\P\(f\x)) \ P\a : ?T" by (depth_solve rules) schematic_goal (in LP2) - "A:* a:A b:A \ ?p: (\ P:A\*.P^a\P^b) \ (\ P:A\*.P^b\P^a)" + "A:* a:A b:A \ ?p: (\P:A\*.P\a\P\b) \ (\P:A\*.P\b\P\a)" -- \Symmetry of Leibnitz equality\ apply (strip_asms rules) apply (rule lam_ss) apply (depth_solve1 rules) prefer 2 apply (depth_solve1 rules) - apply (erule_tac a = "\ x:A. \ Q:A\*.Q^x\Q^a" in pi_elim) + apply (erule_tac a = "\<^bold>\x:A. \Q:A\*.Q\x\Q\a" in pi_elim) apply (depth_solve1 rules) apply (unfold beta) apply (erule imp_elim)