24312
|
1 |
(* -*- coding: utf-8 -*- :encoding=utf-8:
|
17505
|
2 |
Author: Ning Zhang and Christian Urban
|
|
3 |
|
|
4 |
Example theory involving Unicode characters (UTF-8 encoding) -- both
|
|
5 |
formal and informal ones.
|
|
6 |
*)
|
|
7 |
|
|
8 |
header {* A Chinese theory *}
|
|
9 |
|
17553
|
10 |
theory Chinese imports Main begin
|
17505
|
11 |
|
|
12 |
text{* 数学家能把咖啡变成理论,如今中国的数学家也可
|
|
13 |
以在伊莎贝拉的帮助下把茶变成理论.
|
|
14 |
|
|
15 |
伊莎贝拉-世界数学家的新宠,现今能识别中文,成为
|
|
16 |
中国数学家理论推导的得力助手.
|
|
17 |
|
|
18 |
*}
|
|
19 |
|
|
20 |
datatype shuzi =
|
|
21 |
One ("一")
|
|
22 |
| Two ("二")
|
|
23 |
| Three ("三")
|
|
24 |
| Four ("四")
|
|
25 |
| Five ("五")
|
|
26 |
| Six ("六")
|
|
27 |
| Seven ("七")
|
|
28 |
| Eight ("八")
|
|
29 |
| Nine ("九")
|
|
30 |
| Ten ("十")
|
|
31 |
|
39246
|
32 |
primrec translate :: "shuzi \<Rightarrow> nat" ("|_|" [100] 100) where
|
17505
|
33 |
"|一| = 1"
|
39246
|
34 |
|"|二| = 2"
|
|
35 |
|"|三| = 3"
|
|
36 |
|"|四| = 4"
|
|
37 |
|"|五| = 5"
|
|
38 |
|"|六| = 6"
|
|
39 |
|"|七| = 7"
|
|
40 |
|"|八| = 8"
|
|
41 |
|"|九| = 9"
|
|
42 |
|"|十| = 10"
|
17505
|
43 |
|
|
44 |
thm translate.simps
|
|
45 |
|
|
46 |
lemma "|四| + |六| = |十|"
|
|
47 |
by simp
|
|
48 |
|
|
49 |
end
|