Changeset 2946 for src/ERTL/ERTL.ma


Ignore:
Timestamp:
Mar 24, 2013, 11:29:01 AM (8 years ago)
Author:
tranquil
Message:

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:
1 edited

Legend:

Unmodified
Added
Removed
  • src/ERTL/ERTL.ma

    r2783 r2946  
    6868definition ERTL ≝ mk_graph_params (mk_uns_params ERTL_uns ERTL_functs).
    6969definition ertl_program ≝ joint_program ERTL.
     70unification hint 0 ≔ ⊢ ertl_program ≡ joint_program ERTL.
    7071
    7172interpretation "move" 'mov r a = (MOVE ?? (mk_Prod move_dst move_src r a)).
     
    123124coercion ertl_seq_to_joint_seq : ∀globals.∀s : ertl_seq.joint_seq ERTL globals ≝ ertl_seq_joint
    124125  on _s : ertl_seq to joint_seq ERTL ?.
     126
     127definition ERTL_premain : ∀p : ertl_program.joint_closed_internal_function ERTL (prog_var_names ?? p) ≝
     128λp.
     129let l1 : label ≝ an_identifier … one in
     130let l2 : label ≝ an_identifier … (p0 one) in
     131let l3 : label ≝ an_identifier … (p1 one) in
     132let res ≝
     133  mk_joint_internal_function ERTL (prog_var_names … p)
     134  (mk_universe … (p0 (p0 one)))
     135  (mk_universe … one)
     136  it 4 0 0 (empty_map …) l1 in
     137(* todo: args for main? *)
     138let res ≝ add_graph … l1
     139  (sequential … (COST_LABEL … (init_cost_label … p)) l2)
     140  res in
     141let res ≝ add_graph … l2
     142  (sequential … (CALL ERTL ? (inl … (prog_main … p)) 4 it) l3)
     143  res in
     144let res ≝ add_graph … l3
     145  (GOTO ? l3)
     146  res in
     147res.
     148%
     149[ ** [2,3: * [2,3,5,6: #p ]] #s whd in ⊢ (??%?→?); #EQ destruct
     150  %
     151  [1,3,5: %{I} % whd in ⊢ (??%(??%)→?); #EQ destruct
     152  |2: %
     153  |4,6: % whd in ⊢ (??%%→?); #EQ destruct
     154  ]
     155| ** [2,3: * [2,3,5,6: #p ]] #s whd in ⊢ (??%?→?); #EQ destruct % try @I %{I I}
     156| ** [2,3: * [2,3,5,6: #p ]] * whd whd in ⊢ (?%%); //
     157| ** [2,3: * [2,3,5,6: #p ]] #s whd in ⊢ (??%%→?); #EQ destruct @I
     158| %{l2} %{(init_cost_label … p)} %
     159]
     160qed.
Note: See TracChangeset for help on using the changeset viewer.