src/HOL/Nitpick_Examples/Manual_Nits.thy
changeset 58310 91ea607a34d8
parent 58249 180f1b3508ed
child 58889 5b7a9633cfa8
equal deleted inserted replaced
58309:a09ec6daaa19 58310:91ea607a34d8
   221 sorry
   221 sorry
   222 
   222 
   223 
   223 
   224 subsection {* 2.10. Boxing *}
   224 subsection {* 2.10. Boxing *}
   225 
   225 
   226 datatype_new tm = Var nat | Lam tm | App tm tm
   226 datatype tm = Var nat | Lam tm | App tm tm
   227 
   227 
   228 primrec lift where
   228 primrec lift where
   229 "lift (Var j) k = Var (if j < k then j else j + 1)" |
   229 "lift (Var j) k = Var (if j < k then j else j + 1)" |
   230 "lift (Lam t) k = Lam (lift t (k + 1))" |
   230 "lift (Lam t) k = Lam (lift t (k + 1))" |
   231 "lift (App t u) k = App (lift t k) (lift u k)"
   231 "lift (App t u) k = App (lift t k) (lift u k)"
   304 nitpick_params [max_potential = 0]
   304 nitpick_params [max_potential = 0]
   305 
   305 
   306 
   306 
   307 subsection {* 3.1. A Context-Free Grammar *}
   307 subsection {* 3.1. A Context-Free Grammar *}
   308 
   308 
   309 datatype_new alphabet = a | b
   309 datatype alphabet = a | b
   310 
   310 
   311 inductive_set S\<^sub>1 and A\<^sub>1 and B\<^sub>1 where
   311 inductive_set S\<^sub>1 and A\<^sub>1 and B\<^sub>1 where
   312   "[] \<in> S\<^sub>1"
   312   "[] \<in> S\<^sub>1"
   313 | "w \<in> A\<^sub>1 \<Longrightarrow> b # w \<in> S\<^sub>1"
   313 | "w \<in> A\<^sub>1 \<Longrightarrow> b # w \<in> S\<^sub>1"
   314 | "w \<in> B\<^sub>1 \<Longrightarrow> a # w \<in> S\<^sub>1"
   314 | "w \<in> B\<^sub>1 \<Longrightarrow> a # w \<in> S\<^sub>1"
   379 sorry
   379 sorry
   380 
   380 
   381 
   381 
   382 subsection {* 3.2. AA Trees *}
   382 subsection {* 3.2. AA Trees *}
   383 
   383 
   384 datatype_new 'a aa_tree = \<Lambda> | N "'a\<Colon>linorder" nat "'a aa_tree" "'a aa_tree"
   384 datatype 'a aa_tree = \<Lambda> | N "'a\<Colon>linorder" nat "'a aa_tree" "'a aa_tree"
   385 
   385 
   386 primrec data where
   386 primrec data where
   387 "data \<Lambda> = undefined" |
   387 "data \<Lambda> = undefined" |
   388 "data (N x _ _ _) = x"
   388 "data (N x _ _ _) = x"
   389 
   389