Theory OpUbx
theory OpUbx
imports OpInl Unboxed
begin
section βΉn-ary operationsβΊ
locale nary_operations_ubx =
nary_operations_inl ππ ππ―π¦π±πΆ βπ«π©ππ βπ«π© βπ°βπ«π© ππ’βπ«π© +
unboxedval unitialized is_true is_false box_ubx1 unbox_ubx1 box_ubx2 unbox_ubx2
for
ππ :: "'op β 'dyn list β 'dyn" and ππ―π¦π±πΆ and
βπ«π©ππ and βπ«π© and βπ°βπ«π© and ππ’βπ«π© :: "'opinl β 'op" and
unitialized :: 'dyn and is_true and is_false and
box_ubx1 :: "'ubx1 β 'dyn" and unbox_ubx1 and
box_ubx2 :: "'ubx2 β 'dyn" and unbox_ubx2 +
fixes
πππ΅ππ :: "'opubx β ('dyn, 'ubx1, 'ubx2) unboxed list β ('dyn, 'ubx1, 'ubx2) unboxed option" and
πππ΅ :: "'opinl β type option list β 'opubx option" and
π
π¬π΅ :: "'opubx β 'opinl" and
ππΆππ’ππ£ππ :: "'opubx β type option list Γ type option"
assumes
πππ΅_invertible:
"πππ΅ opinl ts = Some opubx βΉ π
π¬π΅ opubx = opinl" and
πππ΅ππ_correct:
"πππ΅ππ opubx Ξ£ = Some z βΉ βπ«π©ππ (π
π¬π΅ opubx) (map norm_unboxed Ξ£) = norm_unboxed z" and
πππ΅ππ_to_βπ«π©:
"πππ΅ππ opubx Ξ£ = Some z βΉ βπ«π© (ππ’βπ«π© (π
π¬π΅ opubx)) (map norm_unboxed Ξ£) = Some (π
π¬π΅ opubx)" and
ππΆππ’ππ£ππ_ππ―π¦π±πΆ:
"ππ―π¦π±πΆ (ππ’βπ«π© (π
π¬π΅ opubx)) = length (fst (ππΆππ’ππ£ππ opubx))" and
πππ΅_opubx_type:
"πππ΅ opinl ts = Some opubx βΉ fst (ππΆππ’ππ£ππ opubx) = ts" and
ππΆππ’ππ£ππ_correct:
"ππΆππ’ππ£ππ opubx = (map typeof xs, Ο) βΉ
βy. πππ΅ππ opubx xs = Some y β§ typeof y = Ο" and
ππΆππ’ππ£ππ_complete:
"πππ΅ππ opubx xs = Some y βΉ ππΆππ’ππ£ππ opubx = (map typeof xs, typeof y)"
end