src/HOL/Codatatype/Examples/Misc_Data.thy
changeset 49185 073d7d1b7488
parent 49166 e075733fa8c2
child 49186 4b5fa9d5e330
equal deleted inserted replaced
49184:83fdea0c4779 49185:073d7d1b7488
    49 
    49 
    50 data ('a, 'b) exp = Term "('a, 'b) trm" | Sum "('a, 'b) trm" "('a, 'b) exp"
    50 data ('a, 'b) exp = Term "('a, 'b) trm" | Sum "('a, 'b) trm" "('a, 'b) exp"
    51  and ('a, 'b) trm = Factor "('a, 'b) factor" | Prod "('a, 'b) factor" "('a, 'b) trm"
    51  and ('a, 'b) trm = Factor "('a, 'b) factor" | Prod "('a, 'b) factor" "('a, 'b) trm"
    52  and ('a, 'b) factor = C 'a | V 'b | Paren "('a, 'b) exp"
    52  and ('a, 'b) factor = C 'a | V 'b | Paren "('a, 'b) exp"
    53 
    53 
    54 data_raw some_killing: 'A = "'a \<Rightarrow> 'b \<Rightarrow> ('A + 'B)"
       
    55      and in_here: 'B = "'b \<times> 'a + 'c"
       
    56 
       
    57 (* FIXME
       
    58 data ('a, 'b, 'c) some_killing =
    54 data ('a, 'b, 'c) some_killing =
    59   SK "'a \<Rightarrow> 'b \<Rightarrow> ('a, 'b, 'c) some_killing + ('a, 'b, 'c) in_here"
    55   SK "'a \<Rightarrow> 'b \<Rightarrow> ('a, 'b, 'c) some_killing + ('a, 'b, 'c) in_here"
    60  and ('a, 'b, 'c) in_here =
    56  and ('a, 'b, 'c) in_here =
    61   IH1 'b 'a | IH2 'c
    57   IH1 'b 'a | IH2 'c
    62 *)
       
    63 
    58 
    64 data 'b nofail1 = NF11 "'b nofail1 \<times> 'b" | NF12 'b
    59 data 'b nofail1 = NF11 "'b nofail1 \<times> 'b" | NF12 'b
    65 data 'b nofail2 = NF2 "('b nofail2 \<times> 'b \<times> 'b nofail2 \<times> 'b) list"
    60 data 'b nofail2 = NF2 "('b nofail2 \<times> 'b \<times> 'b nofail2 \<times> 'b) list"
    66 data 'b nofail3 = NF3 "'b \<times> ('b nofail3 \<times> 'b \<times> 'b nofail3 \<times> 'b) fset"
    61 data 'b nofail3 = NF3 "'b \<times> ('b nofail3 \<times> 'b \<times> 'b nofail3 \<times> 'b) fset"
    67 data 'b nofail4 = NF4 "('b nofail3 \<times> ('b nofail3 \<times> 'b \<times> 'b nofail3 \<times> 'b) fset) list"
    62 data 'b nofail4 = NF4 "('b nofail3 \<times> ('b nofail3 \<times> 'b \<times> 'b nofail3 \<times> 'b) fset) list"
   148  and s6 = S61 s6 | S62 s1 s2 | S63 s6
   143  and s6 = S61 s6 | S62 s1 s2 | S63 s6
   149  and s7 = S71 s8 | S72 s5
   144  and s7 = S71 s8 | S72 s5
   150  and s8 = S8 nat
   145  and s8 = S8 nat
   151 *)
   146 *)
   152 
   147 
       
   148 data ('a, 'b) bar = BAR "'b \<Rightarrow> 'a"
       
   149 data ('a, 'b, 'c, 'd) foo = FOO "'d + 'b \<Rightarrow> 'c + 'a"
       
   150 
       
   151 data 'a dead_foo = A
       
   152 (* FIXME: handle unknown type constructors using DEADID?
       
   153 data ('a, 'b) use_dead_foo = Y "'a" "'b dead_foo"
       
   154 *)
   153 end
   155 end