include "joint/Joint_paolo.ma". include "RTL/RTL_paolo.ma". inductive move_dst: Type[0] ≝ | PSD: register → move_dst | HDW: Register → move_dst. definition move_src ≝ argument move_dst. definition move_src_from_dst : move_dst → move_src ≝ Reg move_dst. coercion move_dst_to_src : ∀r : move_dst.move_src ≝ move_src_from_dst on _r : move_dst to move_src. definition psd_argument_move_src : psd_argument → move_src ≝ λarg.match arg with [ Imm b ⇒ Imm ? b | Reg r ⇒ Reg ? (PSD r) ]. coercion psd_argument_to_move_src : ∀a:psd_argument.move_src ≝ psd_argument_move_src on _a : psd_argument to move_src. inductive ertl_seq : Type[0] ≝ | ertl_new_frame: ertl_seq | ertl_del_frame: ertl_seq | ertl_frame_size: register → ertl_seq. definition ERTL_uns ≝ mk_unserialized_params (* acc_a_reg ≝ *) register (* acc_b_reg ≝ *) register (* acc_a_arg ≝ *) psd_argument (* acc_b_arg ≝ *) psd_argument (* dpl_reg ≝ *) register (* dph_reg ≝ *) register (* dpl_arg ≝ *) psd_argument (* dph_arg ≝ *) psd_argument (* snd_arg ≝ *) psd_argument (* pair_move ≝ *) (move_dst × move_src) (* call_args ≝ *) ℕ (* call_dest ≝ *) unit (* ext_seq ≝ *) ertl_seq (* ext_call ≝ *) void (* ext_tailcall ≝ *) void (* paramsT ≝ *) ℕ (* localsT ≝ *) register. definition ERTL ≝ mk_graph_params ERTL_uns. definition ertl_program ≝ joint_program ERTL. interpretation "move" 'mov r a = (MOVE ?? (mk_Prod move_dst move_src r a)). (* aid unification *) unification hint 0 ≔ (*---------------*) ⊢ pair_move ERTL ≡ move_dst × move_src. unification hint 0 ≔ (*---------------*) ⊢ acc_a_reg ERTL ≡ register. unification hint 0 ≔ (*---------------*) ⊢ acc_b_reg ERTL ≡ register. unification hint 0 ≔ (*---------------*) ⊢ acc_a_arg ERTL ≡ psd_argument. unification hint 0 ≔ (*---------------*) ⊢ acc_b_arg ERTL ≡ psd_argument. unification hint 0 ≔ (*---------------*) ⊢ dpl_reg ERTL ≡ register. unification hint 0 ≔ (*---------------*) ⊢ dph_reg ERTL ≡ register. unification hint 0 ≔ (*---------------*) ⊢ dpl_arg ERTL ≡ psd_argument. unification hint 0 ≔ (*---------------*) ⊢ dph_arg ERTL ≡ psd_argument. unification hint 0 ≔ (*---------------*) ⊢ snd_arg ERTL ≡ psd_argument. unification hint 0 ≔ (*---------------*) ⊢ call_args ERTL ≡ ℕ. unification hint 0 ≔ (*---------------*) ⊢ call_dest ERTL ≡ unit. unification hint 0 ≔ (*---------------*) ⊢ ext_seq ERTL ≡ ertl_seq. unification hint 0 ≔ (*---------------*) ⊢ ext_call ERTL ≡ void. unification hint 0 ≔ (*---------------*) ⊢ ext_tailcall ERTL ≡ void. coercion reg_to_ertl_snd_argument : ∀r : register.snd_arg ERTL ≝ psd_argument_from_reg on _r : register to snd_arg ERTL. coercion byte_to_ertl_snd_argument : ∀b : Byte.snd_arg ERTL ≝ psd_argument_from_byte on _b : Byte to snd_arg ERTL. definition ertl_seq_joint ≝ extension_seq ERTL. coercion ertl_seq_to_joint_seq : ∀globals.∀s : ertl_seq.joint_seq ERTL globals ≝ ertl_seq_joint on _s : ertl_seq to joint_seq ERTL.