equal
deleted
inserted
replaced
3125 |
3125 |
3126 |
3126 |
3127 subsubsection {* Generation of efficient code *} |
3127 subsubsection {* Generation of efficient code *} |
3128 |
3128 |
3129 consts |
3129 consts |
3130 member :: "'a \<Rightarrow> 'a list \<Rightarrow> bool" (infixl "mem" 55) |
|
3131 null:: "'a list \<Rightarrow> bool" |
3130 null:: "'a list \<Rightarrow> bool" |
3132 list_inter :: "'a list \<Rightarrow> 'a list \<Rightarrow> 'a list" |
3131 list_inter :: "'a list \<Rightarrow> 'a list \<Rightarrow> 'a list" |
3133 list_ex :: "('a \<Rightarrow> bool) \<Rightarrow> 'a list \<Rightarrow> bool" |
3132 list_ex :: "('a \<Rightarrow> bool) \<Rightarrow> 'a list \<Rightarrow> bool" |
3134 list_all :: "('a \<Rightarrow> bool) \<Rightarrow> ('a list \<Rightarrow> bool)" |
3133 list_all :: "('a \<Rightarrow> bool) \<Rightarrow> ('a list \<Rightarrow> bool)" |
3135 filtermap :: "('a \<Rightarrow> 'b option) \<Rightarrow> 'a list \<Rightarrow> 'b list" |
3134 filtermap :: "('a \<Rightarrow> 'b option) \<Rightarrow> 'a list \<Rightarrow> 'b list" |
3136 map_filter :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> 'a list \<Rightarrow> 'b list" |
3135 map_filter :: "('a \<Rightarrow> 'b) \<Rightarrow> ('a \<Rightarrow> bool) \<Rightarrow> 'a list \<Rightarrow> 'b list" |
3137 |
3136 |
3138 primrec |
3137 (* "fun" is used for authentic syntax. Revert to primrec later. *) |
|
3138 fun member :: "'a \<Rightarrow> 'a list \<Rightarrow> bool" (infixl "mem" 55) |
|
3139 where |
3139 "x mem [] = False" |
3140 "x mem [] = False" |
3140 "x mem (y#ys) = (x = y \<or> x mem ys)" |
3141 | "x mem (y#ys) = (x = y \<or> x mem ys)" |
3141 |
3142 |
3142 primrec |
3143 primrec |
3143 "null [] = True" |
3144 "null [] = True" |
3144 "null (x#xs) = False" |
3145 "null (x#xs) = False" |
3145 |
3146 |