1 | (**************************************************************************) |
---|
2 | (* ___ *) |
---|
3 | (* ||M|| *) |
---|
4 | (* ||A|| A project by Andrea Asperti *) |
---|
5 | (* ||T|| *) |
---|
6 | (* ||I|| Developers: *) |
---|
7 | (* ||T|| The HELM team. *) |
---|
8 | (* ||A|| http://helm.cs.unibo.it *) |
---|
9 | (* \ / *) |
---|
10 | (* \ / This file is distributed under the terms of the *) |
---|
11 | (* v GNU General Public License Version 2 *) |
---|
12 | (* *) |
---|
13 | (**************************************************************************) |
---|
14 | |
---|
15 | include "RTLabs/RTLabsToRTL.ma". |
---|
16 | include "common/StatusSimulation.ma". |
---|
17 | include "joint/Traces.ma". |
---|
18 | include "RTLabs/RTLabs_abstract.ma". |
---|
19 | include "RTL/RTL_semantics.ma". |
---|
20 | include "RTLabs/MeasurableToStructured.ma". (* for make_ext_initial_state *) |
---|
21 | |
---|
22 | definition RTLabsToRTLstacksizes_ok : (ident → option ℕ) → RTLabs_program → Prop ≝ |
---|
23 | λstack_sizes,p. |
---|
24 | All … |
---|
25 | (λi_f.let 〈i, f〉 ≝ i_f in |
---|
26 | match f with |
---|
27 | [ External _ ⇒ True |
---|
28 | | Internal def ⇒ |
---|
29 | ∃sz.stack_sizes i = Some ? sz ∧ f_stacksize … def ≤ sz |
---|
30 | ]) (prog_funct … p). |
---|
31 | |
---|
32 | axiom RTLabsToRTL_ok : |
---|
33 | ∀stacksizes : ident → option ℕ. |
---|
34 | ∀cost. |
---|
35 | ∀p_in : RTLabs_program. |
---|
36 | RTLabsToRTLstacksizes_ok stacksizes p_in → |
---|
37 | let p_out ≝ rtlabs_to_rtl cost p_in in |
---|
38 | ∀init_in.make_ext_initial_state p_in = OK … init_in → |
---|
39 | ∃init_out : state_pc RTL_semantics_separate. |
---|
40 | make_initial_state |
---|
41 | (mk_prog_params RTL_semantics_separate p_out stacksizes) = |
---|
42 | OK ? init_out ∧ |
---|
43 | ∃[1] R. |
---|
44 | status_simulation_with_init |
---|
45 | (RTLabs_status (make_global … p_in)) |
---|
46 | (joint_status RTL_semantics_separate p_out stacksizes) R |
---|
47 | init_in init_out. |
---|