source: src/ERTL/ERTL_paolo.ma @ 2214

Last change on this file since 2214 was 2214, checked in by tranquil, 8 years ago
  • changed order of parameters of joint_internal_function and genv in semantics
  • in semantics, unified more_sem_unserialized_params and more_sem_genv_params
  • renamed all <language>_params to <LANGUAGE>
File size: 3.2 KB
Line 
1
2include "joint/Joint_paolo.ma".
3include "RTL/RTL_paolo.ma".
4
5inductive move_dst: Type[0] ≝
6  | PSD: register → move_dst
7  | HDW: Register → move_dst.
8
9definition move_src ≝ argument move_dst.
10
11definition move_src_from_dst : move_dst → move_src ≝ Reg move_dst.
12coercion move_dst_to_src : ∀r : move_dst.move_src ≝ move_src_from_dst on _r : move_dst to move_src.
13
14definition psd_argument_move_src : psd_argument → move_src ≝
15  λarg.match arg with
16  [ Imm b ⇒ Imm ? b
17  | Reg r ⇒ Reg ? (PSD r)
18  ].
19coercion psd_argument_to_move_src : ∀a:psd_argument.move_src ≝
20  psd_argument_move_src on _a : psd_argument to move_src.
21
22inductive ertl_seq : Type[0] ≝
23  | ertl_new_frame: ertl_seq
24  | ertl_del_frame: ertl_seq
25  | ertl_frame_size: register → ertl_seq.
26
27definition ertl_uns_params ≝ mk_unserialized_params
28  (mk_step_params
29    (* acc_a_reg ≝ *) register
30    (* acc_b_reg ≝ *) register
31    (* acc_a_arg ≝ *) psd_argument
32    (* acc_b_arg ≝ *) psd_argument
33    (* dpl_reg   ≝ *) register
34    (* dph_reg   ≝ *) register
35    (* dpl_arg   ≝ *) psd_argument
36    (* dph_arg   ≝ *) psd_argument
37    (* snd_arg   ≝ *) psd_argument
38    (* pair_move ≝ *) (move_dst × move_src)
39    (* call_args ≝ *) ℕ
40    (* call_dest ≝ *) unit
41    (* ext_seq ≝ *) ertl_seq
42    (* ext_call ≝ *) void
43    (* ext_tailcall ≝ *) void
44  )
45  (mk_local_params
46    (mk_funct_params
47      (* resultT ≝ *) unit
48      (* paramsT ≝ *) ℕ)
49      (* localsT ≝ *) register).
50
51definition ERTL ≝ mk_graph_params ertl_uns_params.
52definition ertl_program ≝ joint_program ERTL.
53
54interpretation "move" 'mov r a = (MOVE ?? (mk_Prod move_dst move_src r a)).
55
56(* aid unification *)
57unification hint 0 ≔
58(*---------------*) ⊢
59pair_move ERTL ≡ move_dst × move_src.
60unification hint 0 ≔
61(*---------------*) ⊢
62acc_a_reg ERTL ≡ register.
63unification hint 0 ≔
64(*---------------*) ⊢
65acc_b_reg ERTL ≡ register.
66unification hint 0 ≔
67(*---------------*) ⊢
68acc_a_arg ERTL ≡ psd_argument.
69unification hint 0 ≔
70(*---------------*) ⊢
71acc_b_arg ERTL ≡ psd_argument.
72unification hint 0 ≔
73(*---------------*) ⊢
74dpl_reg ERTL ≡ register.
75unification hint 0 ≔
76(*---------------*) ⊢
77dph_reg ERTL ≡ register.
78unification hint 0 ≔
79(*---------------*) ⊢
80dpl_arg ERTL ≡ psd_argument.
81unification hint 0 ≔
82(*---------------*) ⊢
83dph_arg ERTL ≡ psd_argument.
84unification hint 0 ≔
85(*---------------*) ⊢
86snd_arg ERTL ≡ psd_argument.
87unification hint 0 ≔
88(*---------------*) ⊢
89call_args ERTL ≡ ℕ.
90unification hint 0 ≔
91(*---------------*) ⊢
92call_dest ERTL ≡ unit.
93
94unification hint 0 ≔
95(*---------------*) ⊢
96ext_seq ERTL ≡ ertl_seq.
97unification hint 0 ≔
98(*---------------*) ⊢
99ext_call ERTL ≡ void.
100unification hint 0 ≔
101(*---------------*) ⊢
102ext_tailcall ERTL ≡ void.
103
104coercion reg_to_ertl_snd_argument : ∀r : register.snd_arg ERTL ≝
105  psd_argument_from_reg
106  on _r : register to snd_arg ERTL.
107coercion byte_to_ertl_snd_argument : ∀b : Byte.snd_arg ERTL ≝
108  psd_argument_from_byte
109  on _b : Byte to snd_arg ERTL.
110 
111definition ertl_seq_joint ≝ extension_seq ERTL.
112coercion ertl_seq_to_joint_seq : ∀globals.∀s : ertl_seq.joint_seq ERTL globals ≝ ertl_seq_joint
113  on _s : ertl_seq to joint_seq ERTL.
Note: See TracBrowser for help on using the repository browser.