src/Doc/Datatypes/Datatypes.thy
changeset 62333 e4e09a6e3922
parent 62331 e923f200bda5
child 62336 4a8d2f0d7fdd
equal deleted inserted replaced
62332:eeaa2f7b5329 62333:e4e09a6e3922
  1432 For convenience, the predicator can be used instead of the map function,
  1432 For convenience, the predicator can be used instead of the map function,
  1433 typically when defining predicates. For example:
  1433 typically when defining predicates. For example:
  1434 \<close>
  1434 \<close>
  1435 
  1435 
  1436 primrec increasing_tree :: "int \<Rightarrow> int tree\<^sub>f\<^sub>f \<Rightarrow> bool" where
  1436 primrec increasing_tree :: "int \<Rightarrow> int tree\<^sub>f\<^sub>f \<Rightarrow> bool" where
  1437   "increasing_tree m (Node\<^sub>f\<^sub>f n ts) \<longleftrightarrow> n \<ge> m \<and> pred_list (increasing_tree (n + 1)) ts"
  1437   "increasing_tree m (Node\<^sub>f\<^sub>f n ts) \<longleftrightarrow> n \<ge> m \<and> list_all (increasing_tree (n + 1)) ts"
  1438 
  1438 
  1439 text \<open>
  1439 text \<open>
  1440 \noindent
  1440 \noindent
  1441 Also for convenience, recursion through functions can also be expressed using
  1441 Also for convenience, recursion through functions can also be expressed using
  1442 $\lambda$-abstractions and function application rather than through composition.
  1442 $\lambda$-abstractions and function application rather than through composition.
  2920     record 'a point =
  2920     record 'a point =
  2921       xval :: 'a
  2921       xval :: 'a
  2922       yval :: 'a
  2922       yval :: 'a
  2923 
  2923 
  2924 text \<open> \blankline \<close>
  2924 text \<open> \blankline \<close>
  2925     
  2925 
  2926     copy_bnf ('a, 'z) point_ext
  2926     copy_bnf ('a, 'z) point_ext
  2927 
  2927 
  2928 text \<open>
  2928 text \<open>
  2929 In the general case, the proof obligations generated by @{command lift_bnf} are
  2929 In the general case, the proof obligations generated by @{command lift_bnf} are
  2930 simpler than the acual BNF properties. In particular, no cardinality reasoning
  2930 simpler than the acual BNF properties. In particular, no cardinality reasoning