Theory Stfun
section ‹States and state functions for TLA as an "intensional" logic›
theory Stfun
imports Intensional
begin
typedecl state
instance state :: world ..
type_synonym 'a stfun = "state ⇒ 'a"
type_synonym stpred = "bool stfun"
consts
stvars :: "'a stfun ⇒ bool"
syntax
"_PRED" :: "lift ⇒ 'a" ("PRED _")
"_stvars" :: "lift ⇒ bool" ("basevars _")
translations
"PRED P" => "(P::state ⇒ _)"
"_stvars" == "CONST stvars"
overloading stvars ≡ stvars
begin
definition stvars :: "(state ⇒ 'a) ⇒ bool"
where basevars_def: "stvars vs == range vs = UNIV"
end
lemma basevars: "⋀vs. basevars vs ⟹ ∃u. vs u = c"
apply (unfold basevars_def)
apply (rule_tac b = c and f = vs in rangeE)
apply auto
done
lemma base_pair1: "⋀x y. basevars (x,y) ⟹ basevars x"
apply (simp (no_asm) add: basevars_def)
apply (rule equalityI)
apply (rule subset_UNIV)
apply (rule subsetI)
apply (drule_tac c = "(xa, _) " in basevars)
apply auto
done
lemma base_pair2: "⋀x y. basevars (x,y) ⟹ basevars y"
apply (simp (no_asm) add: basevars_def)
apply (rule equalityI)
apply (rule subset_UNIV)
apply (rule subsetI)
apply (drule_tac c = "(_, xa) " in basevars)
apply auto
done
lemma base_pair: "⋀x y. basevars (x,y) ⟹ basevars x & basevars y"
apply (rule conjI)
apply (erule base_pair1)
apply (erule base_pair2)
done
lemma unit_base: "basevars (v::unit stfun)"
apply (unfold basevars_def)
apply auto
done
lemma baseE: "⟦ basevars v; ⋀x. v x = c ⟹ Q ⟧ ⟹ Q"
apply (erule basevars [THEN exE])
apply blast
done
lemma "⋀v. basevars (v::bool stfun, v) ⟹ False"
apply (erule baseE)
apply (subgoal_tac "(LIFT (v,v)) x = (True, False)")
prefer 2
apply assumption
apply simp
done
end