27081
|
1 |
(* $Id$ *)
|
|
2 |
|
27063
|
3 |
theory Examples2
|
|
4 |
imports Examples
|
|
5 |
begin
|
|
6 |
|
|
7 |
text {* This is achieved by unfolding suitable equations during
|
|
8 |
interpretation. These equations are given after the keyword
|
|
9 |
\isakeyword{where} and require proofs. The revised command,
|
|
10 |
replacing @{text "\<sqsubset>"} by @{text "<"}, is: *}
|
|
11 |
|
|
12 |
interpretation %visible nat: partial_order ["op \<le> :: [nat, nat] \<Rightarrow> bool"]
|
|
13 |
where "partial_order.less op \<le> (x::nat) y = (x < y)"
|
|
14 |
proof -
|
|
15 |
txt {* The goals are @{subgoals [display]}
|
|
16 |
The proof that @{text \<le>} is a partial order is a above. *}
|
|
17 |
show "partial_order (op \<le> :: nat \<Rightarrow> nat \<Rightarrow> bool)"
|
|
18 |
by unfold_locales auto
|
|
19 |
txt {* The second goal is shown by unfolding the
|
|
20 |
definition of @{term "partial_order.less"}. *}
|
|
21 |
show "partial_order.less op \<le> (x::nat) y = (x < y)"
|
|
22 |
unfolding partial_order.less_def [OF `partial_order op \<le>`]
|
|
23 |
by auto
|
|
24 |
qed
|
|
25 |
|
|
26 |
text {* Note that the above proof is not in the context of a locale.
|
|
27 |
Hence, the correct interpretation of @{text
|
|
28 |
"partial_order.less_def"} is obtained manually with @{text OF}.
|
|
29 |
*}
|
|
30 |
|
|
31 |
end
|