source: src/ASM/Interpret2.ma @ 2771

Last change on this file since 2771 was 2764, checked in by sacerdot, 7 years ago

preclassified_system for object code

File size: 1.5 KB
Line 
1include "ASM/ASMCosts.ma".
2include "common/Measurable.ma".
3
4(* Move where abstract_status is defined! *)
5definition mk_trans_system_of_abstract_status:
6 ∀S:abstract_status. (S → IOMonad io_out io_in S) → trans_system io_out io_in
7
8 λS,as_eval.
9  mk_trans_system ?? unit (λ_.as_status S) (λ_.as_result S)
10   (λ_.λstatus.
11     let tr ≝
12      match as_label … status with
13      [ Some cst ⇒ Echarge cst
14      | None ⇒ E0 ] in
15     ! status' ← as_eval … status ;
16     return 〈 tr, status' 〉).
17
18definition mk_fullexec_of_abstract_status:
19 ∀S:abstract_status. (S → IOMonad io_out io_in S) → as_status S → fullexec io_out io_in
20≝ λS,as_eval,as_init.
21   mk_fullexec ?? unit (mk_trans_system_of_abstract_status S as_eval) (λ_.it)
22    (λ_.return as_init).
23
24definition mk_preclassified_system_of_abstract_status:
25 ∀S:abstract_status. (S → IOMonad io_out io_in S) → as_status S → preclassified_system
26≝ λS,as_eval,as_init.
27   mk_preclassified_system
28    (mk_fullexec_of_abstract_status S as_eval as_init)
29    (λ_.λst. ¬(is_none … (as_label … st)))
30    (λ_.as_classify S)
31    (λ_.λst,prf. as_call_ident S «st,?»).
32 @hide_prf cases (as_classify ??) in prf; normalize // *
33qed.
34
35(* End move *)
36
37definition OC_preclassified_system: labelled_object_code → preclassified_system ≝
38 λc:labelled_object_code.
39  let cm ≝ load_code_memory (oc c) in
40  mk_preclassified_system_of_abstract_status
41   (ASM_abstract_status cm (costlabels c))
42   (λst. return (execute_1 … st))
43   (initialise_status … cm).
Note: See TracBrowser for help on using the repository browser.