section‹Value Types› theory Valuetypes imports ReadShow begin fun iter :: "(int ⇒ 'b ⇒ 'b) ⇒ 'b ⇒ int ⇒ 'b" where "iter f v x = (if x ≤ 0 then v else f (x-1) (iter f v (x-1)))" fun iter' :: "(int ⇒ 'b ⇒ 'b option) ⇒ 'b ⇒ int ⇒ 'b option" where "iter' f v x = (if x ≤ 0 then Some v else case iter' f v (x-1) of Some v' ⇒ f (x-1) v' | None ⇒ None)" type_synonym Address = String.literal type_synonym Location = String.literal type_synonym Valuetype = String.literal (*Covered*)