Open alxest opened 4 years ago
Such "refresh"ability is useful in the following scenario. We define simulation primitive as follows in SimSIR.v:
| sim_st_choose_src
X_src
k_src i_tgt
(SIM: exists x_src, sim_st (k_src x_src) i_tgt)
:
_sim_st sim_st
(Vis (subevent _ (EChoose X_src)) k_src)
(i_tgt)
| sim_st_choose_tgt
X_tgt
k_tgt i_src
(INHAB: inhabited X_tgt)
(SIM: forall x_tgt, sim_st i_src (k_tgt x_tgt))
:
_sim_st sim_st
(i_src)
(Vis (subevent _ (EChoose X_tgt)) k_tgt)
[[SIMULATION INDEXES OMITTED]]
and by composing them, I would also like to simulate "choose_both" case, like:
(Vis (subevent _ (EChoose X)) k_src)
(Vis (subevent _ (EChoose X)) k_tgt)
About future sim --> maybe just lexicographic order would suffice. Recall f2b simulation.
Problem
If we prove simulation as follows,
current simulation definition does not allow us to refresh the index. However, src/tgt together made the progress, so we should be able to refresh the index.
Solution
Adopting the idea from gpaco, we can generalize the simulation with additional parameters:
gs gt: bool
. gs/gt means whether src/tgt is guarded: it is guarded if it haven't took a step since last refresh, and unguarded otherwise. Then, we can relax the simulation definition as follows:(bsim, sfsim are omitted)
Note: proving the soundness might require future-aware simulation. To be more specific, proving soundness transitively "xsim => bsim => adequacy" might && proving directly (xsim => adequacy) might not.