src/HOL/ex/Chinese.thy
author haftmann
Wed, 08 Sep 2010 19:21:46 +0200
changeset 39246 9e58f0499f57
parent 24312 bb5ec06f7c7a
child 40967 5eb59b62e7de
permissions -rw-r--r--
modernized primrec
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24312
bb5ec06f7c7a added encoding spec for jEdit;
wenzelm
parents: 17553
diff changeset
     1
(* -*- coding: utf-8 -*- :encoding=utf-8:
17505
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
     2
    Author:     Ning Zhang and Christian Urban
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
     3
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
     4
Example theory involving Unicode characters (UTF-8 encoding) -- both
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
     5
formal and informal ones.
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
     6
*)
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
     7
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
     8
header {* A Chinese theory *}
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
     9
17553
d7b304d05956 isatool fixheaders;
wenzelm
parents: 17505
diff changeset
    10
theory Chinese imports Main begin
17505
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    11
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    12
text{* 数学家能把咖啡变成理论,如今中国的数学家也可
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    13
       以在伊莎贝拉的帮助下把茶变成理论.  
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    14
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    15
       伊莎贝拉-世界数学家的新宠,现今能识别中文,成为
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    16
       中国数学家理论推导的得力助手.
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    17
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    18
    *}
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    19
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    20
datatype shuzi =
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    21
    One   ("一")
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    22
  | Two   ("二")
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    23
  | Three ("三") 
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    24
  | Four  ("四")
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    25
  | Five  ("五")
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    26
  | Six   ("六")
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    27
  | Seven ("七")
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    28
  | Eight ("八")
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    29
  | Nine  ("九")
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    30
  | Ten   ("十")
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    31
39246
9e58f0499f57 modernized primrec
haftmann
parents: 24312
diff changeset
    32
primrec translate :: "shuzi \<Rightarrow> nat" ("|_|" [100] 100) where
17505
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    33
 "|一| = 1"
39246
9e58f0499f57 modernized primrec
haftmann
parents: 24312
diff changeset
    34
|"|二| = 2"
9e58f0499f57 modernized primrec
haftmann
parents: 24312
diff changeset
    35
|"|三| = 3"
9e58f0499f57 modernized primrec
haftmann
parents: 24312
diff changeset
    36
|"|四| = 4"
9e58f0499f57 modernized primrec
haftmann
parents: 24312
diff changeset
    37
|"|五| = 5"
9e58f0499f57 modernized primrec
haftmann
parents: 24312
diff changeset
    38
|"|六| = 6"
9e58f0499f57 modernized primrec
haftmann
parents: 24312
diff changeset
    39
|"|七| = 7"
9e58f0499f57 modernized primrec
haftmann
parents: 24312
diff changeset
    40
|"|八| = 8"
9e58f0499f57 modernized primrec
haftmann
parents: 24312
diff changeset
    41
|"|九| = 9"
9e58f0499f57 modernized primrec
haftmann
parents: 24312
diff changeset
    42
|"|十| = 10"
17505
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    43
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    44
thm translate.simps
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    45
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    46
lemma "|四| + |六| = |十|"
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    47
  by simp 
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    48
928bd7053d6a Chinese Unicode example;
wenzelm
parents:
diff changeset
    49
end