source: src/ERTL/ERTL.ma @ 1163

Last change on this file since 1163 was 1163, checked in by mulligan, 9 years ago

even more streamlining and fixes to get things type checking

File size: 3.6 KB
Line 
1include "ASM/I8051.ma".
2include "LIN/JointLTLLIN.ma".
3include "utilities/BitVectorTrieSet.ma".
4include "utilities/IdentifierTools.ma".
5include "common/Graphs.ma".
6include "common/CostLabel.ma".
7include "common/Registers.ma".
8
9definition registers ≝ list register.
10
11inductive move_registers: Type[0] ≝
12  | pseudo: register → move_registers
13  | hardware: Register → move_registers.
14
15definition pre_ertl_statement ≝
16  λglobals: list ident.
17  joint_statement label globals register
18                  register register register
19                  (move_registers × move_registers) register.
20                 
21inductive ertl_statement (globals: list ident): Type[0] ≝
22  | ertl_st_lift_pre: pre_ertl_statement globals → ertl_statement globals
23  | ertl_st_new_frame: label → ertl_statement globals
24  | ertl_st_del_frame: label → ertl_statement globals
25  | ertl_st_frame_size: register → label → ertl_statement globals.
26
27(*
28inductive ertl_statement: Type[0] ≝
29  | ertl_st_skip: label → ertl_statement
30  | ertl_st_comment: String → label → ertl_statement
31  | ertl_st_cost: costlabel → label → ertl_statement
32  | ertl_st_get_hdw: register → Register → label → ertl_statement
33  | ertl_st_set_hdw: Register → register → label → ertl_statement
34  | ertl_st_hdw_to_hdw: Register → Register → label → ertl_statement
35  | ertl_st_new_frame: label → ertl_statement
36  | ertl_st_del_frame: label → ertl_statement
37  | ertl_st_frame_size: register → label → ertl_statement
38  | ertl_st_pop: register → label → ertl_statement
39  | ertl_st_push: register → label → ertl_statement
40  | ertl_st_addr: register → register → ident → label → ertl_statement
41  | ertl_st_int: register → Byte → label → ertl_statement
42  | ertl_st_move: register → register → label → ertl_statement
43  | ertl_st_opaccs: OpAccs → register → register → register → register → label → ertl_statement
44  | ertl_st_op1: Op1 → register → register → label → ertl_statement
45  | ertl_st_op2: Op2 → register → register → register → label → ertl_statement
46  | ertl_st_clear_carry: label → ertl_statement
47  | ertl_st_set_carry: label → ertl_statement
48  | ertl_st_load: register → register → register → label → ertl_statement
49  | ertl_st_store: register → register → register → label → ertl_statement
50  | ertl_st_call_id: ident → nat → label → ertl_statement
51  | ertl_st_cond: register → label → label → ertl_statement
52  | ertl_st_return: ertl_statement.
53*)
54
55definition ertl_statement_graph ≝ λglobals. graph (ertl_statement globals).
56
57record ertl_internal_function (globals: list ident): Type[0] ≝
58{
59  ertl_if_luniverse: universe LabelTag;
60  ertl_if_runiverse: universe RegisterTag;
61  ertl_if_params: nat;
62  ertl_if_locals: registers;
63  ertl_if_stacksize: nat;
64  ertl_if_graph: ertl_statement_graph globals;
65  ertl_if_entry: Σl: label. lookup ? ? ertl_if_graph l ≠ None ?;
66  ertl_if_exit: Σl: label. lookup ? ? ertl_if_graph l ≠ None ?
67}.
68
69definition ertl_function ≝ λglobals. fundef (ertl_internal_function globals).
70 
71record ertl_program (globals: list ident): Type[0] ≝
72{
73  ertl_pr_vars: list (ident × nat);
74  ertl_pr_funcs: list (ident × (ertl_function globals));
75  ertl_pr_main: option ident
76}.
77
78
79(* XXX: changed from O'Caml
80  | ertl_st_addr_h: register → ident → label → ertl_statement
81  | ertl_st_addr_l: register → ident → label → ertl_statement
82*)
83
84(* XXX: changed from O'Caml
85  | ertl_st_opaccs_a: OpAccs → register → register → register → label → ertl_statement
86  | ertl_st_opaccs_b: OpAccs → register → register → register → label → ertl_statement
87*)
Note: See TracBrowser for help on using the repository browser.