Theory ShadowRootClass
section ‹The Shadow DOM Data Model›
theory ShadowRootClass
imports
Core_SC_DOM.ShadowRootPointer
Core_SC_DOM.DocumentClass
begin
subsection ‹ShadowRoot›
datatype shadow_root_mode = Open | Closed
record ('node_ptr, 'element_ptr, 'character_data_ptr) RShadowRoot =
"('node_ptr, 'element_ptr, 'character_data_ptr) RDocument" +
nothing :: unit
mode :: shadow_root_mode
child_nodes :: "('node_ptr, 'element_ptr, 'character_data_ptr) node_ptr list"
type_synonym ('node_ptr, 'element_ptr, 'character_data_ptr, 'ShadowRoot) ShadowRoot
= "('node_ptr, 'element_ptr, 'character_data_ptr, 'ShadowRoot option) RShadowRoot_scheme"
register_default_tvars "('node_ptr, 'element_ptr, 'character_data_ptr, 'ShadowRoot) ShadowRoot"
type_synonym ('node_ptr, 'element_ptr, 'character_data_ptr, 'Document, 'ShadowRoot) Document
= "('node_ptr, 'element_ptr, 'character_data_ptr, ('node_ptr, 'element_ptr, 'character_data_ptr,
'ShadowRoot option) RShadowRoot_ext + 'Document) Document"
register_default_tvars "('node_ptr, 'element_ptr, 'character_data_ptr, 'Document, 'ShadowRoot) Document"
type_synonym ('node_ptr, 'element_ptr, 'character_data_ptr, 'shadow_root_ptr, 'Object, 'Node,
'Element, 'CharacterData, 'Document,
'ShadowRoot) Object
= "('node_ptr, 'element_ptr, 'character_data_ptr, 'shadow_root_ptr, 'Object, 'Node, 'Element,
'CharacterData, ('node_ptr, 'element_ptr, 'character_data_ptr, 'ShadowRoot option)
RShadowRoot_ext + 'Document) Object"
register_default_tvars "('node_ptr, 'element_ptr, 'character_data_ptr, 'shadow_root_ptr, 'Object,
'Node, 'Element, 'CharacterData,
'Document, 'ShadowRoot) Object"
type_synonym ('object_ptr, 'node_ptr, 'element_ptr, 'character_data_ptr, 'document_ptr,
'shadow_root_ptr, 'Object, 'Node,
'Element, 'CharacterData, 'Document, 'ShadowRoot) heap
= "('object_ptr, 'node_ptr, 'element_ptr, 'character_data_ptr, 'document_ptr, 'shadow_root_ptr,
'Object, 'Node, 'Element, 'CharacterData, ('node_ptr, 'element_ptr,
'character_data_ptr, 'ShadowRoot option) RShadowRoot_ext + 'Document) heap"
register_default_tvars "('object_ptr, 'node_ptr, 'element_ptr, 'character_data_ptr, 'document_ptr,
'shadow_root_ptr, 'Object,
'Node, 'Element, 'CharacterData, 'Document, 'ShadowRoot) heap"
type_synonym heap⇩f⇩i⇩n⇩a⇩l = "(unit, unit, unit, unit, unit, unit, unit, unit, unit, unit, unit, unit) heap"
definition shadow_root_ptr_kinds :: "(_) heap ⇒ (_) shadow_root_ptr fset"
where
"shadow_root_ptr_kinds heap =
the |`| (cast⇩d⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩_⇩p⇩t⇩r⇩2⇩s⇩h⇩a⇩d⇩o⇩w⇩_⇩r⇩o⇩o⇩t⇩_⇩p⇩t⇩r |`| (ffilter is_shadow_root_ptr_kind (document_ptr_kinds heap)))"
lemma shadow_root_ptr_kinds_simp [simp]:
"shadow_root_ptr_kinds (Heap (fmupd (cast shadow_root_ptr) shadow_root (the_heap h))) =
{|shadow_root_ptr|} |∪| shadow_root_ptr_kinds h"
by (auto simp add: shadow_root_ptr_kinds_def)
definition shadow_root_ptrs :: "(_) heap ⇒ (_) shadow_root_ptr fset"
where
"shadow_root_ptrs heap = ffilter is_shadow_root_ptr (shadow_root_ptr_kinds heap)"
definition cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t :: "(_) Document ⇒ (_) ShadowRoot option"
where
"cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t document = (case RDocument.more document of Some (Inl shadow_root) ⇒
Some (RDocument.extend (RDocument.truncate document) shadow_root) | _ ⇒ None)"
adhoc_overloading cast cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t
abbreviation cast⇩O⇩b⇩j⇩e⇩c⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t :: "(_) Object ⇒ (_) ShadowRoot option"
where
"cast⇩O⇩b⇩j⇩e⇩c⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t obj ≡ (case cast⇩O⇩b⇩j⇩e⇩c⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t obj of
Some document ⇒ cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t document | None ⇒ None)"
adhoc_overloading cast cast⇩O⇩b⇩j⇩e⇩c⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t
definition cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t :: "(_) ShadowRoot ⇒ (_) Document"
where
"cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t shadow_root = RDocument.extend (RDocument.truncate shadow_root)
(Some (Inl (RDocument.more shadow_root)))"
adhoc_overloading cast cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t
abbreviation cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩O⇩b⇩j⇩e⇩c⇩t :: "(_) ShadowRoot ⇒ (_) Object"
where
"cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩O⇩b⇩j⇩e⇩c⇩t ptr ≡ cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩O⇩b⇩j⇩e⇩c⇩t (cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t ptr)"
adhoc_overloading cast cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩O⇩b⇩j⇩e⇩c⇩t
consts is_shadow_root_kind :: 'a
definition is_shadow_root_kind⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t :: "(_) Document ⇒ bool"
where
"is_shadow_root_kind⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t ptr ⟷ cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr ≠ None"
adhoc_overloading is_shadow_root_kind is_shadow_root_kind⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t
lemmas is_shadow_root_kind_def = is_shadow_root_kind⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def
abbreviation is_shadow_root_kind⇩O⇩b⇩j⇩e⇩c⇩t :: "(_) Object ⇒ bool"
where
"is_shadow_root_kind⇩O⇩b⇩j⇩e⇩c⇩t ptr ≡ cast⇩O⇩b⇩j⇩e⇩c⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr ≠ None"
adhoc_overloading is_shadow_root_kind is_shadow_root_kind⇩O⇩b⇩j⇩e⇩c⇩t
definition get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t :: "(_) shadow_root_ptr ⇒ (_) heap ⇒ (_) ShadowRoot option"
where
"get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h = Option.bind (get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t (cast shadow_root_ptr) h) cast"
adhoc_overloading get get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t
locale l_type_wf_def⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t
begin
definition a_type_wf :: "(_) heap ⇒ bool"
where
"a_type_wf h = (DocumentClass.type_wf h ∧ (∀shadow_root_ptr ∈ fset (shadow_root_ptr_kinds h)
.get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h ≠ None))"
end
global_interpretation l_type_wf_def⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t defines type_wf = a_type_wf .
lemmas type_wf_defs = a_type_wf_def
locale l_type_wf⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t = l_type_wf type_wf for type_wf :: "((_) heap ⇒ bool)" +
assumes type_wf⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t: "type_wf h ⟹ ShadowRootClass.type_wf h"
sublocale l_type_wf⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ⊆ l_type_wf⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t
apply(unfold_locales)
using DocumentClass.a_type_wf_def
by (meson ShadowRootClass.a_type_wf_def l_type_wf⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_axioms l_type_wf⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def)
locale l_get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_lemmas = l_type_wf⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t
begin
sublocale l_get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_lemmas by unfold_locales
lemma get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_type_wf:
assumes "type_wf h"
shows "shadow_root_ptr |∈| shadow_root_ptr_kinds h ⟷ get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h ≠ None"
proof
assume "shadow_root_ptr |∈| shadow_root_ptr_kinds h"
then
show "get shadow_root_ptr h ≠ None"
using l_type_wf⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_axioms[unfolded l_type_wf⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def type_wf_defs] assms
by meson
next
assume "get shadow_root_ptr h ≠ None"
then
show "shadow_root_ptr |∈| shadow_root_ptr_kinds h"
apply(auto simp add: get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def get⇩O⇩b⇩j⇩e⇩c⇩t_def shadow_root_ptr_kinds_def
document_ptr_kinds_def object_ptr_kinds_def
split: Option.bind_splits)[1]
by (metis (no_types, lifting) IntI document_ptr_casts_commute2 document_ptr_document_ptr_cast
fmdomI image_iff is_shadow_root_ptr_kind_cast mem_Collect_eq option.sel
shadow_root_ptr_casts_commute2)
qed
end
global_interpretation l_get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_lemmas type_wf
by unfold_locales
definition put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t :: "(_) shadow_root_ptr ⇒ (_) ShadowRoot ⇒ (_) heap ⇒ (_) heap"
where
"put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr shadow_root = put⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t (cast shadow_root_ptr) (cast shadow_root)"
adhoc_overloading put put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t
lemma put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_ptr_in_heap:
assumes "put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr shadow_root h = h'"
shows "shadow_root_ptr |∈| shadow_root_ptr_kinds h'"
using assms
unfolding put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def shadow_root_ptr_kinds_def
by (metis ffmember_filter fimage_eqI is_shadow_root_ptr_kind_cast option.sel
put⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_ptr_in_heap shadow_root_ptr_casts_commute2)
lemma put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_put_ptrs:
assumes "put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr shadow_root h = h'"
shows "object_ptr_kinds h' = object_ptr_kinds h |∪| {|cast shadow_root_ptr|}"
using assms
by (simp add: put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def put⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_put_ptrs)
lemma cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_inject [simp]:
"cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t x = cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t y ⟷ x = y"
apply(auto simp add: cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def RObject.extend_def RDocument.extend_def
RDocument.truncate_def)[1]
by (metis RDocument.select_convs(5) RShadowRoot.surjective old.unit.exhaust)
lemma cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_none [simp]:
"cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t document = None ⟷ ¬ (∃shadow_root. cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t shadow_root = document)"
apply(auto simp add: cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def RObject.extend_def
RDocument.extend_def RDocument.truncate_def
split: sum.splits option.splits)[1]
by (metis (mono_tags, lifting) RDocument.select_convs(2) RDocument.select_convs(3)
RDocument.select_convs(4) RDocument.select_convs(5) RDocument.surjective old.unit.exhaust)
lemma cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_some [simp]:
"cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t document = Some shadow_root ⟷ cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t shadow_root = document"
apply(auto simp add: cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def RObject.extend_def
RDocument.extend_def RDocument.truncate_def
split: sum.splits option.splits)[1]
by (metis RDocument.select_convs(5) RShadowRoot.surjective old.unit.exhaust)
lemma cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_inv [simp]:
"cast⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t⇩2⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t (cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t shadow_root) = Some shadow_root"
by simp
lemma is_shadow_root_kind_doctype [simp]:
"is_shadow_root_kind x ⟷ is_shadow_root_kind (doctype_update (λ_. v) x)"
apply(auto simp add: is_shadow_root_kind_def cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def RDocument.extend_def
RDocument.truncate_def split: option.splits)[1]
apply (metis RDocument.ext_inject RDocument.select_convs(3) RDocument.surjective RObject.ext_inject)
by (smt RDocument.select_convs(2) RDocument.select_convs(3) RDocument.select_convs(4)
RDocument.select_convs(5) RDocument.surjective RDocument.update_convs(2) old.unit.exhaust)
lemma is_shadow_root_kind_document_element [simp]:
"is_shadow_root_kind x ⟷ is_shadow_root_kind (document_element_update (λ_. v) x)"
apply(auto simp add: is_shadow_root_kind_def cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def RDocument.extend_def
RDocument.truncate_def split: option.splits)[1]
apply (metis RDocument.ext_inject RDocument.select_convs(3) RDocument.surjective RObject.ext_inject)
by (metis (no_types, lifting) RDocument.ext_inject RDocument.surjective RDocument.update_convs(3)
RObject.select_convs(1) RObject.select_convs(2))
lemma is_shadow_root_kind_disconnected_nodes [simp]:
"is_shadow_root_kind x ⟷ is_shadow_root_kind (disconnected_nodes_update (λ_. v) x)"
apply(auto simp add: is_shadow_root_kind_def cast⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t⇩2⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def RDocument.extend_def
RDocument.truncate_def split: option.splits)[1]
apply (metis RDocument.ext_inject RDocument.select_convs(3) RDocument.surjective RObject.ext_inject)
by (metis (no_types, lifting) RDocument.ext_inject RDocument.surjective RDocument.update_convs(4)
RObject.select_convs(1) RObject.select_convs(2))
lemma shadow_root_ptr_kinds_commutes [simp]:
"cast shadow_root_ptr |∈| document_ptr_kinds h ⟷ shadow_root_ptr |∈| shadow_root_ptr_kinds h"
apply(auto simp add: document_ptr_kinds_def shadow_root_ptr_kinds_def)[1]
by (metis Int_iff imageI is_shadow_root_ptr_kind_cast mem_Collect_eq option.sel
shadow_root_ptr_casts_commute2)
lemma get_shadow_root_ptr_simp1 [simp]:
"get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr (put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr shadow_root h) = Some shadow_root"
by(auto simp add: get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def)
lemma get_shadow_root_ptr_simp2 [simp]:
"shadow_root_ptr ≠ shadow_root_ptr'
⟹ get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr (put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr' shadow_root h) =
get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h"
by(auto simp add: get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def)
lemma get_shadow_root_ptr_simp3 [simp]:
"get⇩E⇩l⇩e⇩m⇩e⇩n⇩t element_ptr (put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr f h) = get⇩E⇩l⇩e⇩m⇩e⇩n⇩t element_ptr h"
by(auto simp add: get⇩E⇩l⇩e⇩m⇩e⇩n⇩t_def get⇩N⇩o⇩d⇩e_def put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def put⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def)
lemma get_shadow_root_ptr_simp4 [simp]:
"get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr (put⇩E⇩l⇩e⇩m⇩e⇩n⇩t element_ptr f h) = get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h"
by(auto simp add: get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def put⇩E⇩l⇩e⇩m⇩e⇩n⇩t_def put⇩N⇩o⇩d⇩e_def)
lemma get_shadow_root_ptr_simp5 [simp]:
"get⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a character_data_ptr (put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr f h) = get⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a character_data_ptr h"
by(auto simp add: get⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a_def get⇩N⇩o⇩d⇩e_def put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def put⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def)
lemma get_shadow_root_ptr_simp6 [simp]:
"get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr (put⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a character_data_ptr f h) = get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h"
by(auto simp add: get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def put⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a_def put⇩N⇩o⇩d⇩e_def)
lemma get_shadow_root_put_document [simp]:
"cast shadow_root_ptr ≠ document_ptr
⟹ get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr (put⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t document_ptr document h) = get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h"
by(auto simp add: get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def)
lemma get_document_put_shadow_root [simp]:
"document_ptr ≠ cast shadow_root_ptr
⟹ get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t document_ptr (put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr shadow_root h) = get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t document_ptr h"
by(auto simp add: put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def)
lemma new⇩E⇩l⇩e⇩m⇩e⇩n⇩t_get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t [simp]:
assumes "new⇩E⇩l⇩e⇩m⇩e⇩n⇩t h = (new_element_ptr, h')"
shows "get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr h = get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr h'"
using assms
by(auto simp add: new⇩E⇩l⇩e⇩m⇩e⇩n⇩t_def Let_def)
lemma new⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a_get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t [simp]:
assumes "new⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a h = (new_character_data_ptr, h')"
shows "get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr h = get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr h'"
using assms
by(auto simp add: new⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a_def Let_def)
lemma new⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t [simp]:
assumes "new⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t h = (new_document_ptr, h')"
assumes "cast ptr ≠ new_document_ptr"
shows "get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr h = get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr h'"
using assms
by(auto simp add: new⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def Let_def)
abbreviation "create_shadow_root_obj mode_arg child_nodes_arg
≡ ⦇ RObject.nothing = (), RDocument.nothing = (), RDocument.doctype = ''html'',
RDocument.document_element = None, RDocument.disconnected_nodes = [], RShadowRoot.nothing = (),
mode = mode_arg, RShadowRoot.child_nodes = child_nodes_arg, … = None ⦈"
definition new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t :: "(_)heap ⇒ ((_) shadow_root_ptr × (_) heap)"
where
"new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t h = (let new_shadow_root_ptr = shadow_root_ptr.Ref
(Suc (fMax (shadow_root_ptr.the_ref |`| (shadow_root_ptrs h)))) in
(new_shadow_root_ptr, put new_shadow_root_ptr (create_shadow_root_obj Open []) h))"
lemma new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_ptr_in_heap:
assumes "new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t h = (new_shadow_root_ptr, h')"
shows "new_shadow_root_ptr |∈| shadow_root_ptr_kinds h'"
using assms
unfolding new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def Let_def
using put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_ptr_in_heap by blast
lemma new_shadow_root_ptr_new: "shadow_root_ptr.Ref
(Suc (fMax (finsert 0 (shadow_root_ptr.the_ref |`| shadow_root_ptrs h)))) |∉| shadow_root_ptrs h"
by (metis Suc_n_not_le_n shadow_root_ptr.sel(1) fMax_ge fimage_finsert finsertI1 finsertI2
set_finsert)
lemma new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_ptr_not_in_heap:
assumes "new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t h = (new_shadow_root_ptr, h')"
shows "new_shadow_root_ptr |∉| shadow_root_ptr_kinds h"
using assms
apply(auto simp add: Let_def new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def shadow_root_ptr_kinds_def)[1]
by (metis Suc_n_not_le_n fMax_ge ffmember_filter fimageI is_shadow_root_ptr_ref
shadow_root_ptr.disc(1) shadow_root_ptr.exhaust shadow_root_ptr.is_Ref_def shadow_root_ptr.sel(1)
shadow_root_ptr.simps(4) shadow_root_ptr_casts_commute3 shadow_root_ptr_kinds_commutes
shadow_root_ptrs_def)
lemma new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_new_ptr:
assumes "new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t h = (new_shadow_root_ptr, h')"
shows "object_ptr_kinds h' = object_ptr_kinds h |∪| {|cast new_shadow_root_ptr|}"
using assms
by (metis Pair_inject new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_put_ptrs)
lemma new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_is_shadow_root_ptr:
assumes "new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t h = (new_shadow_root_ptr, h')"
shows "is_shadow_root_ptr new_shadow_root_ptr"
using assms
by(auto simp add: new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def Let_def)
lemma new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_get⇩O⇩b⇩j⇩e⇩c⇩t [simp]:
assumes "new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t h = (new_shadow_root_ptr, h')"
assumes "ptr ≠ cast new_shadow_root_ptr"
shows "get⇩O⇩b⇩j⇩e⇩c⇩t ptr h = get⇩O⇩b⇩j⇩e⇩c⇩t ptr h'"
using assms
by(auto simp add: new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def Let_def put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def put⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def)
lemma new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_get⇩N⇩o⇩d⇩e [simp]:
assumes "new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t h = (new_shadow_root_ptr, h')"
shows "get⇩N⇩o⇩d⇩e ptr h = get⇩N⇩o⇩d⇩e ptr h'"
using assms
apply(simp add: new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def Let_def put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def put⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def)
by(auto simp add: get⇩N⇩o⇩d⇩e_def)
lemma new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_get⇩E⇩l⇩e⇩m⇩e⇩n⇩t [simp]:
assumes "new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t h = (new_shadow_root_ptr, h')"
shows "get⇩E⇩l⇩e⇩m⇩e⇩n⇩t ptr h = get⇩E⇩l⇩e⇩m⇩e⇩n⇩t ptr h'"
using assms
by(auto simp add: new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def Let_def)
lemma new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_get⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a [simp]:
assumes "new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t h = (new_shadow_root_ptr, h')"
shows "get⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a ptr h = get⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a ptr h'"
using assms
by(auto simp add: new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def Let_def)
lemma new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t [simp]:
assumes "new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t h = (new_shadow_root_ptr, h')"
assumes "ptr ≠ cast new_shadow_root_ptr"
shows "get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t ptr h = get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t ptr h'"
using assms
apply(simp add: new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def Let_def put⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def put⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def)
by(auto simp add: get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def)
lemma new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t [simp]:
assumes "new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t h = (new_shadow_root_ptr, h')"
assumes "ptr ≠ new_shadow_root_ptr"
shows "get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr h = get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr h'"
using assms
by(auto simp add: new⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def Let_def)
locale l_known_ptr⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t
begin
definition a_known_ptr :: "(_) object_ptr ⇒ bool"
where
"a_known_ptr ptr = (known_ptr ptr ∨ is_shadow_root_ptr ptr)"
lemma known_ptr_not_shadow_root_ptr: "a_known_ptr ptr ⟹ ¬is_shadow_root_ptr ptr ⟹ known_ptr ptr"
by(simp add: a_known_ptr_def)
lemma known_ptr_new_shadow_root_ptr: "a_known_ptr ptr ⟹ ¬known_ptr ptr ⟹ is_shadow_root_ptr ptr"
using l_known_ptr⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t.known_ptr_not_shadow_root_ptr by blast
end
global_interpretation l_known_ptr⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t defines known_ptr = a_known_ptr .
lemmas known_ptr_defs = a_known_ptr_def
locale l_known_ptrs⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t = l_known_ptr known_ptr for known_ptr :: "(_) object_ptr ⇒ bool"
begin
definition a_known_ptrs :: "(_) heap ⇒ bool"
where
"a_known_ptrs h = (∀ptr ∈ fset (object_ptr_kinds h). known_ptr ptr)"
lemma known_ptrs_known_ptr: "a_known_ptrs h ⟹ ptr |∈| object_ptr_kinds h ⟹ known_ptr ptr"
by (simp add: a_known_ptrs_def)
lemma known_ptrs_preserved:
"object_ptr_kinds h = object_ptr_kinds h' ⟹ a_known_ptrs h = a_known_ptrs h'"
by(auto simp add: a_known_ptrs_def)
lemma known_ptrs_subset:
"object_ptr_kinds h' |⊆| object_ptr_kinds h ⟹ a_known_ptrs h ⟹ a_known_ptrs h'"
by(simp add: a_known_ptrs_def less_eq_fset.rep_eq subsetD)
lemma known_ptrs_new_ptr:
"object_ptr_kinds h' = object_ptr_kinds h |∪| {|new_ptr|} ⟹ known_ptr new_ptr ⟹
a_known_ptrs h ⟹ a_known_ptrs h'"
by(simp add: a_known_ptrs_def)
end
global_interpretation l_known_ptrs⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t known_ptr defines known_ptrs = a_known_ptrs .
lemmas known_ptrs_defs = a_known_ptrs_def
lemma known_ptrs_is_l_known_ptrs [instances]: "l_known_ptrs known_ptr known_ptrs"
using known_ptrs_known_ptr known_ptrs_preserved l_known_ptrs_def known_ptrs_subset known_ptrs_new_ptr
by blast
lemma known_ptrs_implies: "DocumentClass.known_ptrs h ⟹ ShadowRootClass.known_ptrs h"
by(auto simp add: DocumentClass.known_ptrs_defs DocumentClass.known_ptr_defs
ShadowRootClass.known_ptrs_defs ShadowRootClass.known_ptr_defs)
definition delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t :: "(_) shadow_root_ptr ⇒ (_) heap ⇒ (_) heap option" where
"delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr = delete⇩O⇩b⇩j⇩e⇩c⇩t (cast shadow_root_ptr)"
lemma delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_pointer_removed:
assumes "delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr h = Some h'"
shows "ptr |∉| shadow_root_ptr_kinds h'"
using assms
by(auto simp add: delete⇩O⇩b⇩j⇩e⇩c⇩t_pointer_removed delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def shadow_root_ptr_kinds_def
document_ptr_kinds_def split: if_splits)
lemma delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_pointer_ptr_in_heap:
assumes "delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr h = Some h'"
shows "ptr |∈| shadow_root_ptr_kinds h"
using assms
apply(auto simp add: delete⇩O⇩b⇩j⇩e⇩c⇩t_pointer_ptr_in_heap delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def split: if_splits)[1]
using delete⇩O⇩b⇩j⇩e⇩c⇩t_pointer_ptr_in_heap
by fastforce
lemma delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_ok:
assumes "ptr |∈| shadow_root_ptr_kinds h"
shows "delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t ptr h ≠ None"
using assms
by (simp add: delete⇩O⇩b⇩j⇩e⇩c⇩t_ok delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def)
lemma shadow_root_delete_get_1 [simp]:
"delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h = Some h' ⟹ get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h' = None"
by(auto simp add: delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def delete⇩O⇩b⇩j⇩e⇩c⇩t_def get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def get⇩O⇩b⇩j⇩e⇩c⇩t_def
split: if_splits)
lemma shadow_root_delete_get_2 [simp]:
"shadow_root_ptr ≠ shadow_root_ptr' ⟹ delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr' h = Some h' ⟹
get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h' = get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h"
by(auto simp add: delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def delete⇩O⇩b⇩j⇩e⇩c⇩t_def get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def get⇩O⇩b⇩j⇩e⇩c⇩t_def
split: if_splits)
lemma shadow_root_delete_get_3 [simp]:
"delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h = Some h' ⟹ object_ptr ≠ cast shadow_root_ptr ⟹
get⇩O⇩b⇩j⇩e⇩c⇩t object_ptr h' = get⇩O⇩b⇩j⇩e⇩c⇩t object_ptr h"
by(auto simp add: delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def delete⇩O⇩b⇩j⇩e⇩c⇩t_def get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def get⇩O⇩b⇩j⇩e⇩c⇩t_def split: if_splits)
lemma shadow_root_delete_get_4 [simp]: "delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h = Some h' ⟹
get⇩N⇩o⇩d⇩e node_ptr h' = get⇩N⇩o⇩d⇩e node_ptr h"
by(auto simp add: get⇩N⇩o⇩d⇩e_def)
lemma shadow_root_delete_get_5 [simp]: "delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h = Some h' ⟹
get⇩E⇩l⇩e⇩m⇩e⇩n⇩t element_ptr h' = get⇩E⇩l⇩e⇩m⇩e⇩n⇩t element_ptr h"
by(simp add: get⇩E⇩l⇩e⇩m⇩e⇩n⇩t_def)
lemma shadow_root_delete_get_6 [simp]: "delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h = Some h' ⟹
get⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a character_data_ptr h' = get⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a character_data_ptr h"
by(simp add: get⇩C⇩h⇩a⇩r⇩a⇩c⇩t⇩e⇩r⇩D⇩a⇩t⇩a_def)
lemma shadow_root_delete_get_7 [simp]:
"delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h = Some h' ⟹ document_ptr ≠ cast shadow_root_ptr ⟹
get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t document_ptr h' = get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t document_ptr h"
by(simp add: get⇩D⇩o⇩c⇩u⇩m⇩e⇩n⇩t_def)
lemma shadow_root_delete_get_8 [simp]:
"delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr h = Some h' ⟹ shadow_root_ptr' ≠ shadow_root_ptr ⟹
get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr' h' = get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t shadow_root_ptr' h"
by(auto simp add: delete⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def delete⇩O⇩b⇩j⇩e⇩c⇩t_def get⇩S⇩h⇩a⇩d⇩o⇩w⇩R⇩o⇩o⇩t_def get⇩O⇩b⇩j⇩e⇩c⇩t_def split: if_splits)
end