source: src/ERTL/ERTL_paolo.ma @ 2254

Last change on this file since 2254 was 2217, checked in by tranquil, 8 years ago
  • collapsed step_params, unserialized_params, funct_params and local_params into one (unserialized_params)
  • completed update of RTL, LTL and LIN semantics
File size: 3.1 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 ≝ mk_unserialized_params
28    (* acc_a_reg ≝ *) register
29    (* acc_b_reg ≝ *) register
30    (* acc_a_arg ≝ *) psd_argument
31    (* acc_b_arg ≝ *) psd_argument
32    (* dpl_reg   ≝ *) register
33    (* dph_reg   ≝ *) register
34    (* dpl_arg   ≝ *) psd_argument
35    (* dph_arg   ≝ *) psd_argument
36    (* snd_arg   ≝ *) psd_argument
37    (* pair_move ≝ *) (move_dst × move_src)
38    (* call_args ≝ *) ℕ
39    (* call_dest ≝ *) unit
40    (* ext_seq ≝ *) ertl_seq
41    (* ext_call ≝ *) void
42    (* ext_tailcall ≝ *) void
43    (* paramsT ≝ *) ℕ
44    (* localsT ≝ *) register.
45
46definition ERTL ≝ mk_graph_params ERTL_uns.
47definition ertl_program ≝ joint_program ERTL.
48
49interpretation "move" 'mov r a = (MOVE ?? (mk_Prod move_dst move_src r a)).
50
51(* aid unification *)
52unification hint 0 ≔
53(*---------------*) ⊢
54pair_move ERTL ≡ move_dst × move_src.
55unification hint 0 ≔
56(*---------------*) ⊢
57acc_a_reg ERTL ≡ register.
58unification hint 0 ≔
59(*---------------*) ⊢
60acc_b_reg ERTL ≡ register.
61unification hint 0 ≔
62(*---------------*) ⊢
63acc_a_arg ERTL ≡ psd_argument.
64unification hint 0 ≔
65(*---------------*) ⊢
66acc_b_arg ERTL ≡ psd_argument.
67unification hint 0 ≔
68(*---------------*) ⊢
69dpl_reg ERTL ≡ register.
70unification hint 0 ≔
71(*---------------*) ⊢
72dph_reg ERTL ≡ register.
73unification hint 0 ≔
74(*---------------*) ⊢
75dpl_arg ERTL ≡ psd_argument.
76unification hint 0 ≔
77(*---------------*) ⊢
78dph_arg ERTL ≡ psd_argument.
79unification hint 0 ≔
80(*---------------*) ⊢
81snd_arg ERTL ≡ psd_argument.
82unification hint 0 ≔
83(*---------------*) ⊢
84call_args ERTL ≡ ℕ.
85unification hint 0 ≔
86(*---------------*) ⊢
87call_dest ERTL ≡ unit.
88
89unification hint 0 ≔
90(*---------------*) ⊢
91ext_seq ERTL ≡ ertl_seq.
92unification hint 0 ≔
93(*---------------*) ⊢
94ext_call ERTL ≡ void.
95unification hint 0 ≔
96(*---------------*) ⊢
97ext_tailcall ERTL ≡ void.
98
99coercion reg_to_ertl_snd_argument : ∀r : register.snd_arg ERTL ≝
100  psd_argument_from_reg
101  on _r : register to snd_arg ERTL.
102coercion byte_to_ertl_snd_argument : ∀b : Byte.snd_arg ERTL ≝
103  psd_argument_from_byte
104  on _b : Byte to snd_arg ERTL.
105 
106definition ertl_seq_joint ≝ extension_seq ERTL.
107coercion ertl_seq_to_joint_seq : ∀globals.∀s : ertl_seq.joint_seq ERTL globals ≝ ertl_seq_joint
108  on _s : ertl_seq to joint_seq ERTL.
Note: See TracBrowser for help on using the repository browser.