src/Doc/Tutorial/Trie/Trie.thy
changeset 58305 57752a91eec4
parent 48985 5386df44a037
child 58860 fee7cfa69c50
equal deleted inserted replaced
58304:acc2f1801acc 58305:57752a91eec4
   206 apply (case_tac[!] bs, auto);
   206 apply (case_tac[!] bs, auto);
   207 done
   207 done
   208 
   208 
   209 
   209 
   210 (* Exercise 3. Solution by Getrud Bauer *)
   210 (* Exercise 3. Solution by Getrud Bauer *)
   211 datatype ('a,'v) triem = Triem  "'v option" "'a \<Rightarrow> ('a,'v) triem option";
   211 datatype ('a,dead 'v) triem = Triem  "'v option" "'a \<Rightarrow> ('a,'v) triem option";
   212 
   212 
   213 primrec valuem :: "('a, 'v) triem \<Rightarrow> 'v option" where
   213 primrec valuem :: "('a, 'v) triem \<Rightarrow> 'v option" where
   214 "valuem (Triem ov m) = ov"
   214 "valuem (Triem ov m) = ov"
   215 
   215 
   216 primrec mapping :: "('a,'v) triem \<Rightarrow> 'a \<Rightarrow> ('a, 'v) triem option" where
   216 primrec mapping :: "('a,'v) triem \<Rightarrow> 'a \<Rightarrow> ('a, 'v) triem option" where