186 (*code_pred [inductify] one_or_two .*) |
186 (*code_pred [inductify] one_or_two .*) |
187 code_pred [inductify, random] one_or_two . |
187 code_pred [inductify, random] one_or_two . |
188 (*values "{x. one_or_two x}"*) |
188 (*values "{x. one_or_two x}"*) |
189 values [random] "{x. one_or_two x}" |
189 values [random] "{x. one_or_two x}" |
190 |
190 |
191 definition one_or_two': |
191 inductive one_or_two' :: "nat => bool" |
192 "one_or_two' == {1, (2::nat)}" |
192 where |
193 |
193 "one_or_two' 1" |
194 code_pred [inductify] one_or_two' . |
194 | "one_or_two' 2" |
|
195 |
|
196 code_pred one_or_two' . |
195 thm one_or_two'.equation |
197 thm one_or_two'.equation |
196 (* TODO: handling numerals *) |
198 |
197 (*values "{x. one_or_two' x}"*) |
199 values "{x. one_or_two' x}" |
|
200 |
|
201 definition one_or_two'': |
|
202 "one_or_two'' == {1, (2::nat)}" |
|
203 |
|
204 code_pred [inductify] one_or_two'' . |
|
205 thm one_or_two''.equation |
|
206 |
|
207 values "{x. one_or_two'' x}" |
198 |
208 |
199 |
209 |
200 subsection {* even predicate *} |
210 subsection {* even predicate *} |
201 |
211 |
202 inductive even :: "nat \<Rightarrow> bool" and odd :: "nat \<Rightarrow> bool" where |
212 inductive even :: "nat \<Rightarrow> bool" and odd :: "nat \<Rightarrow> bool" where |