Theory RG_Garbage_Collector
theory RG_Garbage_Collector imports Main begin
section ‹Preliminaries›
lemma holds_for_all:
assumes "guar_b σ σ'"
and "p s σ"
and "∀ w. (guar_b σ σ' ∧ p w σ ⟶ q w σ σ')"
and "p s σ ∧ q s σ σ' ⟶ rely_a σ σ'"
shows "rely_a σ σ'"
using assms by blast
definition reach
:: "'a set ⇒ 'a rel ⇒ 'a set" where
"reach S R ≡ rtrancl R `` S"
lemma reach_base:
"w ∈ S ⟹ w ∈ reach S R"
unfolding reach_def by blast
lemma reach_step:
"⟦ w ∈ reach S R ; (w,w') ∈ R ⟧ ⟹ w' ∈ reach S R"
unfolding reach_def apply clarsimp
by (meson ImageI rtrancl.simps)
lemma reach_induct:
assumes "w ∈ reach S R"
and "⋀ v. v ∈ S ⟹ P v"
and "⋀ u v. u ∈ reach S R ⟹ P u ⟹ (u,v) ∈ R ⟹ P v"
shows "P w"
using assms unfolding reach_def apply clarsimp
by (metis (full_types) ImageI rtrancl_induct)
section ‹Definitions›
text ‹The \emph{nodes} in memory are represented as an arbitrary type @{typ 'a}.›
text ‹Part of the system state is the local variables of the Collector,
which cannot be accessed by the Mutator.›
record 'a localC =
safe :: "'a set"
consid :: "'a set"
text ‹The state of the system is defined as the following record-type.›