equal
deleted
inserted
replaced
26 "list_of (IArray xs) = xs" |
26 "list_of (IArray xs) = xs" |
27 |
27 |
28 qualified definition of_fun :: "(nat \<Rightarrow> 'a) \<Rightarrow> nat \<Rightarrow> 'a iarray" where |
28 qualified definition of_fun :: "(nat \<Rightarrow> 'a) \<Rightarrow> nat \<Rightarrow> 'a iarray" where |
29 [simp]: "of_fun f n = IArray (map f [0..<n])" |
29 [simp]: "of_fun f n = IArray (map f [0..<n])" |
30 |
30 |
31 qualified definition sub :: "'a iarray \<Rightarrow> nat \<Rightarrow> 'a" (infixl "!!" 100) where |
31 qualified definition sub :: "'a iarray \<Rightarrow> nat \<Rightarrow> 'a" (infixl \<open>!!\<close> 100) where |
32 [simp]: "as !! n = IArray.list_of as ! n" |
32 [simp]: "as !! n = IArray.list_of as ! n" |
33 |
33 |
34 qualified definition length :: "'a iarray \<Rightarrow> nat" where |
34 qualified definition length :: "'a iarray \<Rightarrow> nat" where |
35 [simp]: "length as = List.length (IArray.list_of as)" |
35 [simp]: "length as = List.length (IArray.list_of as)" |
36 |
36 |