include "joint/Joint_paolo.ma". include "RTL/RTL_paolo.ma". inductive move_dst: Type[0] ≝ | PSD: register → move_dst | HDW: Register → move_dst. inductive move_src: Type[0] ≝ | INT: Byte → move_src | REG: move_dst → move_src. coercion move_dst_to_src : ∀r : move_dst.move_src ≝ REG on _r : move_dst to move_src. definition rtl_argument_move_src : rtl_argument → move_src ≝ λarg.match arg with [ Imm b ⇒ INT b | Reg r ⇒ REG (PSD r) ]. coercion rtl_argument_to_move_src : ∀a:rtl_argument.move_src ≝ rtl_argument_move_src on _a : rtl_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_params ≝ mk_unserialized_params (mk_step_params (* acc_a_reg ≝ *) register (* acc_b_reg ≝ *) register (* acc_a_arg ≝ *) rtl_argument (* acc_b_arg ≝ *) rtl_argument (* dpl_reg ≝ *) register (* dph_reg ≝ *) register (* dpl_arg ≝ *) rtl_argument (* dph_arg ≝ *) rtl_argument (* snd_arg ≝ *) rtl_argument (* pair_move ≝ *) (move_dst × move_src) (* call_args ≝ *) ℕ (* call_dest ≝ *) unit (* ext_seq ≝ *) ertl_seq (* ext_call ≝ *) void (* ext_tailcall ≝ *) void ) (mk_local_params (mk_funct_params (* resultT ≝ *) unit (* paramsT ≝ *) ℕ) (* localsT ≝ *) register). definition ertl_params ≝ mk_graph_params ertl_uns_params. definition ertl_internal_function ≝ λglobals. joint_internal_function globals ertl_params. definition ertl_program ≝ joint_program ertl_params. interpretation "move" 'mov r a = (MOVE ?? (mk_Prod move_dst move_src r a)). (* aid unification *) unification hint 0 ≔ (*---------------*) ⊢ pair_move ertl_params ≡ move_dst × move_src. unification hint 0 ≔ (*---------------*) ⊢ acc_a_reg ertl_params ≡ register. unification hint 0 ≔ (*---------------*) ⊢ acc_b_reg ertl_params ≡ register. unification hint 0 ≔ (*---------------*) ⊢ acc_a_arg ertl_params ≡ rtl_argument. unification hint 0 ≔ (*---------------*) ⊢ acc_b_arg ertl_params ≡ rtl_argument. unification hint 0 ≔ (*---------------*) ⊢ dpl_reg ertl_params ≡ register. unification hint 0 ≔ (*---------------*) ⊢ dph_reg ertl_params ≡ register. unification hint 0 ≔ (*---------------*) ⊢ dpl_arg ertl_params ≡ rtl_argument. unification hint 0 ≔ (*---------------*) ⊢ dph_arg ertl_params ≡ rtl_argument. unification hint 0 ≔ (*---------------*) ⊢ snd_arg ertl_params ≡ rtl_argument. unification hint 0 ≔ (*---------------*) ⊢ call_args ertl_params ≡ ℕ. unification hint 0 ≔ (*---------------*) ⊢ call_dest ertl_params ≡ unit. unification hint 0 ≔ (*---------------*) ⊢ ext_seq ertl_params ≡ ertl_seq. unification hint 0 ≔ (*---------------*) ⊢ ext_call ertl_params ≡ void. unification hint 0 ≔ (*---------------*) ⊢ ext_tailcall ertl_params ≡ void. coercion reg_to_ertl_snd_argument : ∀r : register.snd_arg ertl_params ≝ Reg on _r : register to snd_arg ertl_params. coercion byte_to_ertl_snd_argument : ∀b : Byte.snd_arg ertl_params ≝ Imm on _b : Byte to snd_arg ertl_params. definition ertl_seq_joint ≝ extension_seq ertl_params. coercion ertl_seq_to_joint_seq : ∀globals.∀s : ertl_seq.joint_seq ertl_params globals ≝ ertl_seq_joint on _s : ertl_seq to joint_seq ertl_params.