source: src/ERTL/ERTL.ma @ 2578

Last change on this file since 2578 was 2563, checked in by piccolo, 7 years ago

Repairing ERTL: show stopper found.

File size: 2.9 KB
Line 
1include "joint/Joint.ma".
2
3inductive move_dst: Type[0] ≝
4  | PSD: register → move_dst
5  | HDW: Register → move_dst.
6
7definition move_src ≝ argument move_dst.
8
9definition move_src_from_dst : move_dst → move_src ≝ Reg move_dst.
10coercion move_dst_to_src : ∀r : move_dst.move_src ≝ move_src_from_dst on _r : move_dst to move_src.
11
12definition psd_argument_move_src : psd_argument → move_src ≝
13  λarg.match arg with
14  [ Imm b ⇒ Imm ? b
15  | Reg r ⇒ Reg ? (PSD r)
16  ].
17coercion psd_argument_to_move_src : ∀a:psd_argument.move_src ≝
18  psd_argument_move_src on _a : psd_argument to move_src.
19
20inductive ertl_seq : Type[0] ≝
21  | ertl_new_frame: ertl_seq
22  | ertl_del_frame: ertl_seq
23  | ertl_frame_size: register → ertl_seq.
24
25definition ERTL_uns ≝ mk_unserialized_params
26    (* acc_a_reg ≝ *) register
27    (* acc_b_reg ≝ *) register
28    (* acc_a_arg ≝ *) psd_argument
29    (* acc_b_arg ≝ *) psd_argument
30    (* dpl_reg   ≝ *) register
31    (* dph_reg   ≝ *) register
32    (* dpl_arg   ≝ *) psd_argument
33    (* dph_arg   ≝ *) psd_argument
34    (* snd_arg   ≝ *) psd_argument
35    (* pair_move ≝ *) (move_dst × move_src)
36    (* call_args ≝ *) ℕ
37    (* call_dest ≝ *) unit
38    (* ext_seq ≝ *) ertl_seq
39    (* ext_seq_labels ≝ *) (λ_.[])
40    (* has_tailcall ≝ *) false
41    (* paramsT ≝ *) ℕ
42    (* localsT ≝ *) register.
43
44definition ERTL ≝ mk_graph_params ERTL_uns.
45definition ertl_program ≝ joint_program ERTL.
46
47interpretation "move" 'mov r a = (MOVE ?? (mk_Prod move_dst move_src r a)).
48
49(* aid unification *)
50unification hint 0 ≔
51(*---------------*) ⊢
52pair_move ERTL ≡ move_dst × move_src.
53unification hint 0 ≔
54(*---------------*) ⊢
55acc_a_reg ERTL ≡ register.
56unification hint 0 ≔
57(*---------------*) ⊢
58acc_b_reg ERTL ≡ register.
59unification hint 0 ≔
60(*---------------*) ⊢
61acc_a_arg ERTL ≡ psd_argument.
62unification hint 0 ≔
63(*---------------*) ⊢
64acc_b_arg ERTL ≡ psd_argument.
65unification hint 0 ≔
66(*---------------*) ⊢
67dpl_reg ERTL ≡ register.
68unification hint 0 ≔
69(*---------------*) ⊢
70dph_reg ERTL ≡ register.
71unification hint 0 ≔
72(*---------------*) ⊢
73dpl_arg ERTL ≡ psd_argument.
74unification hint 0 ≔
75(*---------------*) ⊢
76dph_arg ERTL ≡ psd_argument.
77unification hint 0 ≔
78(*---------------*) ⊢
79snd_arg ERTL ≡ psd_argument.
80unification hint 0 ≔
81(*---------------*) ⊢
82call_args ERTL ≡ ℕ.
83unification hint 0 ≔
84(*---------------*) ⊢
85call_dest ERTL ≡ unit.
86
87unification hint 0 ≔
88(*---------------*) ⊢
89ext_seq ERTL ≡ ertl_seq.
90
91coercion reg_to_ertl_snd_argument : ∀r : register.snd_arg ERTL ≝
92  psd_argument_from_reg
93  on _r : register to snd_arg ERTL.
94coercion byte_to_ertl_snd_argument : ∀b : Byte.snd_arg ERTL ≝
95  psd_argument_from_byte
96  on _b : Byte to snd_arg ERTL.
97 
98definition ertl_seq_joint ≝ extension_seq ERTL.
99coercion ertl_seq_to_joint_seq : ∀globals.∀s : ertl_seq.joint_seq ERTL globals ≝ ertl_seq_joint
100  on _s : ertl_seq to joint_seq ERTL.
Note: See TracBrowser for help on using the repository browser.