sp_rewrite_prog: fixes Finca_empty :: "'l"   and Finca_get :: "'l \<Rightarrow> 'm \<Rightarrow> ('n, 'o, 'm, 'p, 'q) Inca.instr fundef option"   and Finca_add :: "'l \<Rightarrow> 'm \<Rightarrow> ('n, 'o, 'm, 'p, 'q) Inca.instr fundef \<Rightarrow> 'l"   and Finca_to_list :: "'l \<Rightarrow> ('m \<times> ('n, 'o, 'm, 'p, 'q) Inca.instr fundef) list"   and Fubx_empty :: "'r"   and Fubx_get :: "'r \<Rightarrow> 'm \<Rightarrow> ('n, 'o, 'm, 'p, 'q, 's, 't, 'u) Ubx.instr fundef option"   and Fubx_add :: "'r \<Rightarrow> 'm \<Rightarrow> ('n, 'o, 'm, 'p, 'q, 's, 't, 'u) Ubx.instr fundef \<Rightarrow> 'r"   and Fubx_to_list :: "'r \<Rightarrow> ('m \<times> ('n, 'o, 'm, 'p, 'q, 's, 't, 'u) Ubx.instr fundef) list"   and heap_empty :: "'v"   and heap_get :: "'v \<Rightarrow> 'o \<times> 'n \<Rightarrow> 'n option"   and heap_add :: "'v \<Rightarrow> 'o \<times> 'n \<Rightarrow> 'n \<Rightarrow> 'v"   and heap_to_list :: "'v \<Rightarrow> (('o \<times> 'n) \<times> 'n) list"   and is_true :: "'n \<Rightarrow> bool"   and is_false :: "'n \<Rightarrow> bool"   and box_ubx1 :: "'t \<Rightarrow> 'n"   and unbox_ubx1 :: "'n \<Rightarrow> 't option"   and box_ubx2 :: "'u \<Rightarrow> 'n"   and unbox_ubx2 :: "'n \<Rightarrow> 'u option"   and \<OO>\<pp> :: "'p \<Rightarrow> 'n list \<Rightarrow> 'n"   and \<AA>\<rr>\<ii>\<tt>\<yy> :: "'p \<Rightarrow> nat"   and \<II>\<nn>\<ll>\<OO>\<pp> :: "'q \<Rightarrow> 'n list \<Rightarrow> 'n"   and \<II>\<nn>\<ll> :: "'p \<Rightarrow> 'n list \<Rightarrow> 'q option"   and \<II>\<ss>\<II>\<nn>\<ll> :: "'q \<Rightarrow> 'n list \<Rightarrow> bool"   and \<DD>\<ee>\<II>\<nn>\<ll> :: "'q \<Rightarrow> 'p"   and \<UU>\<bb>\<xx>\<OO>\<pp> :: "'s \<Rightarrow> ('n, 't, 'u) unboxed list \<Rightarrow> ('n, 't, 'u) unboxed option"   and \<UU>\<bb>\<xx> :: "'q \<Rightarrow> Unboxed.type option list \<Rightarrow> 's option"   and \<BB>\<oo>\<xx> :: "'s \<Rightarrow> 'q"   and \<TT>\<yy>\<pp>\<ee>\<OO>\<ff>\<OO>\<pp> :: "'s \<Rightarrow> Unboxed.type option list \<times> Unboxed.type option"   and f :: "nat \<Rightarrow> 'ac \<Rightarrow> Unboxed.type option list \<Rightarrow> ('w, ('x, 'y, 'z, 'p, 'q, 's, 'aa, 'ab) Ubx.instr \<times> Unboxed.type option list) result"   and n :: "nat"   and p1 :: "'ac list"   and \<Sigma>1 :: "Unboxed.type option list"   and p2 :: "('x, 'y, 'z, 'p, 'q, 's, 'aa, 'ab) Ubx.instr list"   and \<Sigma>2 :: "Unboxed.type option list"   and F :: "'z \<Rightarrow> 'ad fundef option" assumes "inca_to_ubx_simulation Finca_empty Finca_get Finca_add Finca_to_list Fubx_empty Fubx_get Fubx_add Fubx_to_list heap_empty heap_get heap_add heap_to_list is_true is_false box_ubx1 unbox_ubx1 box_ubx2 unbox_ubx2 \<OO>\<pp> \<AA>\<rr>\<ii>\<tt>\<yy> \<II>\<nn>\<ll>\<OO>\<pp> \<II>\<nn>\<ll> \<II>\<ss>\<II>\<nn>\<ll> \<DD>\<ee>\<II>\<nn>\<ll> \<UU>\<bb>\<xx>\<OO>\<pp> \<UU>\<bb>\<xx> \<BB>\<oo>\<xx> \<TT>\<yy>\<pp>\<ee>\<OO>\<ff>\<OO>\<pp>"   and "rewrite_prog f n p1 \<Sigma>1 = Ok (p2, \<Sigma>2)"   and "\<And>x \<Sigma>1 n x' \<Sigma>2. f n x \<Sigma>1 = Ok (x', \<Sigma>2) \<Longrightarrow> ubx_sp.sp_instr \<AA>\<rr>\<ii>\<tt>\<yy> \<DD>\<ee>\<II>\<nn>\<ll> \<TT>\<yy>\<pp>\<ee>\<OO>\<ff>\<OO>\<pp> F x' \<Sigma>1 = Ok \<Sigma>2" shows "ubx_sp.sp \<AA>\<rr>\<ii>\<tt>\<yy> \<DD>\<ee>\<II>\<nn>\<ll> \<TT>\<yy>\<pp>\<ee>\<OO>\<ff>\<OO>\<pp> F p2 \<Sigma>1 = Ok \<Sigma>2"