50 |
50 |
51 typedecl i |
51 typedecl i |
52 arities i :: "term" |
52 arities i :: "term" |
53 |
53 |
54 |
54 |
55 interpretation p1: C ["X::'b" "Y::'b"] by (auto intro: A.intro C_axioms.intro) |
55 interpretation p1: C ["X::i" "Y::i"] by (auto intro: A.intro C_axioms.intro) |
56 |
56 |
57 print_interps A |
57 print_interps A (* output: p1 *) |
58 |
58 |
59 (* possible accesses *) |
59 (* possible accesses *) |
60 thm p1.a.asm_A thm LocaleTest.p1.a.asm_A |
60 thm p1.a.asm_A thm LocaleTest.p1.a.asm_A |
61 thm p1.asm_A thm LocaleTest.p1.asm_A |
61 thm p1.asm_A thm LocaleTest.p1.asm_A |
62 |
62 |
63 |
63 |
64 (* without prefix *) |
64 (* without prefix *) |
65 |
65 |
66 interpretation C ["W::'b" "Z::'b"] by (auto intro: A.intro C_axioms.intro) |
66 interpretation C ["W::i" "Z::i"] . (* subsumed by p1: C *) |
67 |
67 interpretation C ["W::'a" "Z::i"] by (auto intro: A.intro C_axioms.intro) |
68 print_interps A |
68 (* subsumes p1: A and p1: C *) |
|
69 |
|
70 |
|
71 print_interps A (* output: <no prefix>, p1 *) |
69 |
72 |
70 (* possible accesses *) |
73 (* possible accesses *) |
71 thm a.asm_A thm asm_A thm LocaleTest.a.asm_A thm LocaleTest.asm_A |
74 thm asm_C thm a_b.asm_C thm LocaleTest.a_b.asm_C thm LocaleTest.a_b.asm_C |
72 |
75 |
73 |
76 |
74 interpretation p2: D [X Y "Y = X"] by (auto intro: A.intro simp: eq_commute) |
77 interpretation p2: D [X "Y::i" "Y = X"] by (simp add: eq_commute) |
75 |
78 |
76 print_interps D |
79 print_interps A (* output: <no prefix>, p1 *) |
77 |
80 print_interps D (* output: p2 *) |
78 thm p2.a.asm_A |
81 |
79 |
82 |
80 |
83 interpretation p3: D [X "Y::i"] . |
81 interpretation p3: D [X Y] . |
|
82 |
84 |
83 (* duplicate: not registered *) |
85 (* duplicate: not registered *) |
84 |
86 |
85 (* thm p3.a.asm_A *) |
87 (* thm p3.a.asm_A *) |
86 |
88 |
87 |
89 |
88 print_interps A |
90 print_interps A (* output: <no prefix>, p1 *) |
89 print_interps B |
91 print_interps B (* output: p1 *) |
90 print_interps C |
92 print_interps C (* output: <no name>, p1 *) |
91 print_interps D |
93 print_interps D (* output: p2, p3 *) |
92 |
94 |
93 (* not permitted |
95 (* schematic vars in instantiation not permitted *) |
94 |
96 (* |
95 interpretation p4: A ["?x::?'a1"] apply (rule A.intro) apply rule done |
97 interpretation p4: A ["?x::?'a1"] apply (rule A.intro) apply rule done |
96 |
|
97 print_interps A |
98 print_interps A |
98 *) |
99 *) |
99 |
100 |
100 interpretation p10: D + D a' b' d' [X Y _ U V _] by (auto intro: A.intro) |
101 interpretation p10: D + D a' b' d' [X "Y::i" _ U "V::i" _] . |
101 |
102 |
102 corollary (in D) th_x: True .. |
103 corollary (in D) th_x: True .. |
103 |
104 |
104 (* possible accesses: for each registration *) |
105 (* possible accesses: for each registration *) |
105 |
106 |
106 thm p2.th_x thm p3.th_x thm p10.th_x |
107 thm p2.th_x thm p3.th_x |
107 |
108 |
108 lemma (in D) th_y: "d == (a = b)" . |
109 lemma (in D) th_y: "d == (a = b)" . |
109 |
110 |
110 thm p2.th_y thm p3.th_y thm p10.th_y |
111 thm p2.th_y thm p3.th_y |
111 |
112 |
112 lemmas (in D) th_z = th_y |
113 lemmas (in D) th_z = th_y |
113 |
114 |
114 thm p2.th_z |
115 thm p2.th_z |
115 |
116 |
116 thm asm_A |
|
117 |
|
118 section {* Interpretation in proof contexts *} |
117 section {* Interpretation in proof contexts *} |
119 |
118 |
120 theorem True |
119 theorem True |
121 proof - |
120 proof - |
122 fix alpha::i and beta::i and gamma::i |
121 fix alpha::i and beta::'a and gamma::i |
|
122 (* FIXME: omitting type of beta leads to error later at interpret p6 *) |
123 have alpha_A: "A(alpha)" by (auto intro: A.intro) |
123 have alpha_A: "A(alpha)" by (auto intro: A.intro) |
124 then interpret p5: A [alpha] . |
124 interpret p5: A [alpha] . (* subsumed *) |
125 print_interps A |
125 print_interps A (* output: <no prefix>, p1 *) |
126 thm p5.asm_A |
|
127 interpret p6: C [alpha beta] by (auto intro: C_axioms.intro) |
126 interpret p6: C [alpha beta] by (auto intro: C_axioms.intro) |
128 print_interps A (* p6 not added! *) |
127 print_interps A (* output: <no prefix>, p1 *) |
129 print_interps C |
128 print_interps C (* output: <no prefix>, p1, p6 *) |
130 qed rule |
129 qed rule |
131 |
130 |
132 theorem (in A) True |
131 theorem (in A) True |
133 proof - |
132 proof - |
134 print_interps A |
133 print_interps A |