source: src/LIN/joint_LTL_LIN_semantics.ma @ 1386

Last change on this file since 1386 was 1386, checked in by sacerdot, 8 years ago

Structure of semantic parameters simplified.

File size: 3.6 KB
Line 
1include "LIN/joint_LTL_LIN.ma".
2include "joint/SemanticUtils.ma".
3
4(*CSC: re-organize to take succ_pc out of lin_more_sem_params? *)
5definition ltl_lin_more_sem_params: ∀succT,succ,pointer_of_label. more_sem_params (mk_params_ ltl_lin_params__ succT) :=
6 λsuccT,succ,pointer_of_label.
7 mk_more_sem_params ?
8  unit hw_register_env succ
9   hwreg_store hwreg_retrieve (λ_.hwreg_store RegisterA) (λe.λ_.hwreg_retrieve e RegisterA)
10    (λ_.hwreg_store RegisterB) (λe.λ_.hwreg_retrieve e RegisterB)
11    (λ_.hwreg_store RegisterDPL) (λe.λ_.hwreg_retrieve e RegisterDPL)
12    (λ_.hwreg_store RegisterDPH) (λe.λ_.hwreg_retrieve e RegisterDPH)
13     (λlocals,dest_src.
14       match dest_src with
15       [ from_acc reg ⇒
16          do v ← hwreg_retrieve locals RegisterA ;
17          hwreg_store reg v locals
18       | to_acc reg ⇒
19          do v ← hwreg_retrieve locals reg ;
20          hwreg_store RegisterA v locals ])
21     pointer_of_label.
22
23definition ltl_lin_sem_params:
24 ∀succT,succ,pointer_of_label. sem_params ≝
25 λsuccT,succ,pointer_of_label.mk_sem_params … (ltl_lin_more_sem_params succT succ pointer_of_label).
26
27
28definition ltl_lin_init_locals : unit → hw_register_env → hw_register_env ≝ λ_.λe.e.
29definition ltl_lin_pop_frame:
30 ∀succT,succ,pointer_of_label,codeT,lookup.
31 ∀globals. genv globals (mk_params globals succT ltl_lin_params1 (codeT globals) (lookup globals)) →
32 state … (ltl_lin_sem_params succT succ pointer_of_label) → res (state … (ltl_lin_sem_params … succ pointer_of_label)) ≝
33 λ_.λ_.λ_.λ_.λ_.λ_.λ_.λt.OK … t.
34definition ltl_lin_save_frame:
35 ∀succT,succ,pointer_of_label. address → nat → unit → nat → unit → state … (ltl_lin_sem_params succT succ pointer_of_label) → res (state … (ltl_lin_sem_params … succ pointer_of_label)) ≝
36 λ_.λ_.λ_.λl.λ_.λ_.λ_.λ_.λst.save_ra … st l.
37
38(*CSC: XXXXX, for is_final only *)
39axiom ltl_lin_fetch_result:
40 ∀succT,succ,pointer_of_label,codeT,lookup.
41 ∀globals. genv globals (mk_params globals succT ltl_lin_params1 (codeT globals) (lookup globals)) →
42 state (ltl_lin_sem_params succT succ pointer_of_label) → res (list beval).
43
44(*CSC: XXXX, for external functions only*)
45axiom ltl_lin_fetch_external_args: ∀succT,succ,pointer_of_label.external_function → state (ltl_lin_sem_params succT succ pointer_of_label) → res (list val).
46axiom ltl_lin_set_result: ∀succT,succ,pointer_of_label.list val → state (ltl_lin_sem_params succT succ pointer_of_label) → res (state (ltl_lin_sem_params … succ pointer_of_label)).
47
48definition ltl_lin_exec_extended: ∀succT,succ,pointer_of_label.∀p.∀globals. genv globals (p globals) → False → succT → state (ltl_lin_sem_params succT succ pointer_of_label) → IO io_out io_in (trace × (state (ltl_lin_sem_params … succ pointer_of_label)))
49 ≝ λsuccT,succ,pointer_of_label,p,globals,ge,abs. ⊥.
50@abs qed.
51
52definition ltl_lin_more_sem_params2:
53 ∀succT,succ,pointer_of_label,codeT,lookup,fetch.
54 ∀globals. more_sem_params2 … (mk_params globals succT ltl_lin_params1 (codeT globals) (lookup globals)) ≝
55 λsuccT,succ,pointer_of_label,codeT,lookup,fetch,globals.
56  mk_more_sem_params2 … (ltl_lin_more_sem_params … succ pointer_of_label)
57   (fetch globals) (load_ra …) (ltl_lin_fetch_result …)
58   ltl_lin_init_locals (ltl_lin_save_frame …) (ltl_lin_pop_frame …)
59   (ltl_lin_fetch_external_args …) (ltl_lin_set_result …) (ltl_lin_exec_extended …).
60
61definition ltl_lin_fullexec ≝
62 λsuccT,succ,pointer_of_label,codeT,lookup,fetch.
63  joint_fullexec … (λp. ltl_lin_more_sem_params2 succT succ pointer_of_label codeT lookup fetch (prog_var_names … p)).
Note: See TracBrowser for help on using the repository browser.