source: src/RTLabs/RTLabsToRTLAxiom.ma @ 2947

Last change on this file since 2947 was 2946, checked in by tranquil, 7 years ago

main novelties:

  • there is an in-built stack_usage nat in joint states, at the base of the new division of RTL's semantics (with separate stacks, with separate stacks but with an artificial overflow error, with a unique stack)
  • a premain is added semantically to the global env, so initial cost label and main call and return are observed
  • proper initialization is now in LINToASM (to be sure, endianess should be checked ;-)

The update breaks proofs of back end atm. compiler.ma should be okay, but I have not had time to complete its compilation.

File size: 2.4 KB
Line 
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
15include "RTLabs/RTLabsToRTL.ma".
16include "common/StatusSimulation.ma".
17include "joint/Traces.ma".
18include "RTLabs/RTLabs_abstract.ma".
19include "RTL/RTL_semantics.ma".
20
21(* this is in incomplete RTLabs/MeasurableToStructured.ma *)
22definition make_ext_initial_state : ∀p:RTLabs_program. res (RTLabs_ext_state (make_global p)) ≝
23λp.
24  let ge ≝ make_global p in
25  do m ← init_mem … (λx.[Init_space x]) p;
26  let main ≝ prog_main ?? p in
27  do b ← opt_to_res ? [MSG MissingSymbol; CTX ? main] (find_symbol … ge main);
28  do f as Ef ← opt_to_res ? [MSG BadFunction; CTX ? main] (find_funct_ptr … ge b);
29  let s ≝ Callstate main f (nil ?) (None ?) (nil ?) m in
30  return (mk_RTLabs_ext_state (make_global p) s [b] ?).
31% [ @Ef | % ]
32qed.
33
34(* this should say something like λf,p.∀〈i, Internal f〉 ∈ functs p.f i ≥ stacksize f. *)
35axiom RTLabsToRTLstacksizes_ok : (ident → option ℕ) → RTLabs_program → Prop.
36
37axiom RTLabsToRTL_ok :
38∀stacksizes : ident → option ℕ.
39∀p_in : RTLabs_program.
40RTLabsToRTLstacksizes_ok stacksizes p_in →
41let p_out ≝ rtlabs_to_rtl p_in in
42∃[1] R.
43  status_simulation
44    (RTLabs_status (make_global … p_in))
45    (joint_status RTL_semantics_separate p_out stacksizes) R ∧
46  ∀init_in.make_ext_initial_state p_in = OK … init_in →
47  ∃init_out : state_pc RTL_semantics_separate.
48    make_initial_state
49     (mk_prog_params RTL_semantics_separate p_out stacksizes) =
50      OK ? init_out ∧
51   R init_in init_out.
Note: See TracBrowser for help on using the repository browser.