include "joint/Joint_paolo.ma". inductive rtl_seq : Type[0] ≝ | rtl_stack_address: register → register → rtl_seq. inductive rtl_call : Type[0] ≝ | rtl_call_ptr: register → register → list psd_argument → list register → rtl_call. inductive rtl_tailcall : Type[0] ≝ | rtl_tailcall_id: ident → list psd_argument → rtl_tailcall | rtl_tailcall_ptr: register → register → list psd_argument → rtl_tailcall. definition RTL_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 ≝ *) (register × psd_argument) (* call_args ≝ *) (list psd_argument) (* call_dest ≝ *) (list register) (* ext_seq ≝ *) rtl_seq (* ext_call ≝ *) rtl_call (* ext_tailcall ≝ *) rtl_tailcall (* paramsT ≝ *) (list register) (* localsT ≝ *) register. definition RTL ≝ mk_graph_params RTL_uns. definition rtl_program ≝ joint_program RTL. interpretation "move" 'mov r a = (MOVE RTL ? (mk_Prod ? psd_argument r a)). (* aid unification *) include "hints_declaration.ma". unification hint 0 ≔ (*---------------*) ⊢ acc_a_reg RTL ≡ register. unification hint 0 ≔ (*---------------*) ⊢ acc_b_reg RTL ≡ register. unification hint 0 ≔ (*---------------*) ⊢ acc_a_arg RTL ≡ psd_argument. unification hint 0 ≔ (*---------------*) ⊢ acc_b_arg RTL ≡ psd_argument. unification hint 0 ≔ (*---------------*) ⊢ dpl_reg RTL ≡ register. unification hint 0 ≔ (*---------------*) ⊢ dph_reg RTL ≡ register. unification hint 0 ≔ (*---------------*) ⊢ dpl_arg RTL ≡ psd_argument. unification hint 0 ≔ (*---------------*) ⊢ dph_arg RTL ≡ psd_argument. unification hint 0 ≔ (*---------------*) ⊢ snd_arg RTL ≡ psd_argument. unification hint 0 ≔ (*---------------*) ⊢ pair_move RTL ≡ register × psd_argument. unification hint 0 ≔ (*---------------*) ⊢ call_args RTL ≡ list psd_argument. unification hint 0 ≔ (*---------------*) ⊢ call_dest RTL ≡ list register. unification hint 0 ≔ (*---------------*) ⊢ ext_seq RTL ≡ rtl_seq. unification hint 0 ≔ (*---------------*) ⊢ ext_call RTL ≡ rtl_call. unification hint 0 ≔ (*---------------*) ⊢ ext_tailcall RTL ≡ rtl_tailcall. coercion reg_to_rtl_snd_argument : ∀r : register.snd_arg RTL ≝ psd_argument_from_reg on _r : register to snd_arg RTL. coercion byte_to_rtl_snd_argument : ∀b : Byte.snd_arg RTL ≝ psd_argument_from_byte on _b : Byte to snd_arg RTL. (************ Same without tail calls ****************) definition RTL_ntc ≝ mk_graph_params (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 ≝ *) (register × psd_argument) (* call_args ≝ *) (list psd_argument) (* call_dest ≝ *) (list register) (* ext_seq ≝ *) rtl_seq (* ext_call ≝ *) rtl_call (* ext_tailcall ≝ *) void (* paramsT ≝ *) (list register) (* localsT ≝ *) register). definition rtl_ntc_program ≝ joint_program RTL_ntc.