src/HOL/Library/IArray.thy
changeset 80914 d97fdabd9e2b
parent 75936 d2e6a1342c90
child 81706 7beb0cf38292
equal deleted inserted replaced
80913:46f59511b7bb 80914:d97fdabd9e2b
    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