src/HOL/Enum.thy
changeset 58310 91ea607a34d8
parent 58152 6fe60a9a5bad
child 58334 7553a1bcecb7
equal deleted inserted replaced
58309:a09ec6daaa19 58310:91ea607a34d8
   491 
   491 
   492 subsection {* Small finite types *}
   492 subsection {* Small finite types *}
   493 
   493 
   494 text {* We define small finite types for the use in Quickcheck *}
   494 text {* We define small finite types for the use in Quickcheck *}
   495 
   495 
   496 datatype_new finite_1 = a\<^sub>1
   496 datatype finite_1 = a\<^sub>1
   497 
   497 
   498 notation (output) a\<^sub>1  ("a\<^sub>1")
   498 notation (output) a\<^sub>1  ("a\<^sub>1")
   499 
   499 
   500 lemma UNIV_finite_1:
   500 lemma UNIV_finite_1:
   501   "UNIV = {a\<^sub>1}"
   501   "UNIV = {a\<^sub>1}"
   593 end
   593 end
   594 
   594 
   595 declare [[simproc del: finite_1_eq]]
   595 declare [[simproc del: finite_1_eq]]
   596 hide_const (open) a\<^sub>1
   596 hide_const (open) a\<^sub>1
   597 
   597 
   598 datatype_new finite_2 = a\<^sub>1 | a\<^sub>2
   598 datatype finite_2 = a\<^sub>1 | a\<^sub>2
   599 
   599 
   600 notation (output) a\<^sub>1  ("a\<^sub>1")
   600 notation (output) a\<^sub>1  ("a\<^sub>1")
   601 notation (output) a\<^sub>2  ("a\<^sub>2")
   601 notation (output) a\<^sub>2  ("a\<^sub>2")
   602 
   602 
   603 lemma UNIV_finite_2:
   603 lemma UNIV_finite_2:
   699      split: finite_2.splits)
   699      split: finite_2.splits)
   700 end
   700 end
   701 
   701 
   702 hide_const (open) a\<^sub>1 a\<^sub>2
   702 hide_const (open) a\<^sub>1 a\<^sub>2
   703 
   703 
   704 datatype_new finite_3 = a\<^sub>1 | a\<^sub>2 | a\<^sub>3
   704 datatype finite_3 = a\<^sub>1 | a\<^sub>2 | a\<^sub>3
   705 
   705 
   706 notation (output) a\<^sub>1  ("a\<^sub>1")
   706 notation (output) a\<^sub>1  ("a\<^sub>1")
   707 notation (output) a\<^sub>2  ("a\<^sub>2")
   707 notation (output) a\<^sub>2  ("a\<^sub>2")
   708 notation (output) a\<^sub>3  ("a\<^sub>3")
   708 notation (output) a\<^sub>3  ("a\<^sub>3")
   709 
   709 
   823      split: finite_3.splits)
   823      split: finite_3.splits)
   824 end
   824 end
   825 
   825 
   826 hide_const (open) a\<^sub>1 a\<^sub>2 a\<^sub>3
   826 hide_const (open) a\<^sub>1 a\<^sub>2 a\<^sub>3
   827 
   827 
   828 datatype_new finite_4 = a\<^sub>1 | a\<^sub>2 | a\<^sub>3 | a\<^sub>4
   828 datatype finite_4 = a\<^sub>1 | a\<^sub>2 | a\<^sub>3 | a\<^sub>4
   829 
   829 
   830 notation (output) a\<^sub>1  ("a\<^sub>1")
   830 notation (output) a\<^sub>1  ("a\<^sub>1")
   831 notation (output) a\<^sub>2  ("a\<^sub>2")
   831 notation (output) a\<^sub>2  ("a\<^sub>2")
   832 notation (output) a\<^sub>3  ("a\<^sub>3")
   832 notation (output) a\<^sub>3  ("a\<^sub>3")
   833 notation (output) a\<^sub>4  ("a\<^sub>4")
   833 notation (output) a\<^sub>4  ("a\<^sub>4")
   925 end
   925 end
   926 
   926 
   927 hide_const (open) a\<^sub>1 a\<^sub>2 a\<^sub>3 a\<^sub>4
   927 hide_const (open) a\<^sub>1 a\<^sub>2 a\<^sub>3 a\<^sub>4
   928 
   928 
   929 
   929 
   930 datatype_new finite_5 = a\<^sub>1 | a\<^sub>2 | a\<^sub>3 | a\<^sub>4 | a\<^sub>5
   930 datatype finite_5 = a\<^sub>1 | a\<^sub>2 | a\<^sub>3 | a\<^sub>4 | a\<^sub>5
   931 
   931 
   932 notation (output) a\<^sub>1  ("a\<^sub>1")
   932 notation (output) a\<^sub>1  ("a\<^sub>1")
   933 notation (output) a\<^sub>2  ("a\<^sub>2")
   933 notation (output) a\<^sub>2  ("a\<^sub>2")
   934 notation (output) a\<^sub>3  ("a\<^sub>3")
   934 notation (output) a\<^sub>3  ("a\<^sub>3")
   935 notation (output) a\<^sub>4  ("a\<^sub>4")
   935 notation (output) a\<^sub>4  ("a\<^sub>4")