DOM: Towards a Formal Specification
-
Upload
ella-kirkland -
Category
Documents
-
view
32 -
download
1
description
Transcript of DOM: Towards a Formal Specification
![Page 1: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/1.jpg)
DOM:DOM:Towards a Formal Towards a Formal
SpecificationSpecification
Author: Mark Wheelhouse
Supervisor: Dr. Philippa Gardner
Thanks to: Gareth Smith, Uri Zarfaty, Ian Hodkinson
![Page 2: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/2.jpg)
DOMDOM(Document Object Model)(Document Object Model)
Current Spec.Current Spec. EnglishEnglish
VerboseVerbose AmbiguousAmbiguous
Automated VerificationAutomated Verification Not PossibleNot Possible
ExtensionsExtensions HardHard Time-consumingTime-consuming
What We WantWhat We Want FormalismFormalism
Data StructureData Structure Logical FrameworkLogical Framework
Automated VerificationAutomated Verification PossiblePossible
ExtensionsExtensions EasierEasier QuickerQuicker
![Page 3: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/3.jpg)
What is DOM?What is DOM?DOM Tree
High Level XML UpdateHigh Level XML Update
W3CW3C
Aimed at Object Aimed at Object
Orientated ProgrammersOrientated Programmers
Stores XML in Tree StructureStores XML in Tree Structure
![Page 4: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/4.jpg)
Minimal DOMMinimal DOM
DOM Core Level 3
DOM Core Level 2
DOM Core Level 1
Application Based
Consider Structural Behaviour Only
![Page 5: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/5.jpg)
Minimal DOMMinimal DOM
createNodecreateNode
getNodeNamegetNodeName
getChildNodesgetChildNodes
appendappend
getLengthgetLength
getItemgetItem
getParentNodegetParentNode
insertBeforeinsertBefore
removeChildremoveChild
![Page 6: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/6.jpg)
Minimal DOMMinimal DOM
createNodecreateNode
getNodeNamegetNodeName
getChildNodesgetChildNodes
appendappend
getLengthgetLength
getItemgetItem
getParentNodegetParentNode
insertBeforeinsertBefore
removeChildremoveChild
![Page 7: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/7.jpg)
Context LogicContext Logic
Local Reasoning Tool for Tree UpdateLocal Reasoning Tool for Tree Update
Proved CorrectProved Correct
Used on Toy ExamplesUsed on Toy Examples
Provides Compositional ReasoningProvides Compositional Reasoning
First Real-World TestFirst Real-World Test
![Page 8: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/8.jpg)
Context Logic - ApplicationContext Logic - Application
Pre: P Command: C Post: Q
![Page 9: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/9.jpg)
Context Logic – Right Context Logic – Right TriangleTriangle
K = (P Q)
![Page 10: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/10.jpg)
Data StructureData Structure
![Page 11: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/11.jpg)
Command AxiomsCommand Axioms
{ Pre-condition }
{ Post-condition }
Command
Specifying the Local Behaviour of the commands:
![Page 12: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/12.jpg)
getNodeNamegetNodeName
tag’ = getNodeName(id);
tag’ = tag
![Page 13: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/13.jpg)
getNodeName - Small getNodeName - Small AxiomAxiom
![Page 14: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/14.jpg)
Weakest Pre-conditionWeakest Pre-condition
![Page 15: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/15.jpg)
Weakest Pre-conditionWeakest Pre-condition
![Page 16: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/16.jpg)
Weakest Pre-conditionWeakest Pre-condition
![Page 17: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/17.jpg)
Weakest Pre-conditionWeakest Pre-condition
![Page 18: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/18.jpg)
insertBeforeinsertBefore
insertBefore(parent, newChild, ref);
![Page 19: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/19.jpg)
Ancestor IssueAncestor Issue
![Page 20: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/20.jpg)
insertBefore - AxiominsertBefore - Axiom
Why not Small ?
![Page 21: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/21.jpg)
Weakest Pre-conditionWeakest Pre-condition
![Page 22: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/22.jpg)
Weakest Pre-conditionWeakest Pre-condition
![Page 23: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/23.jpg)
Axiom CompositionAxiom Composition- insertAfter- insertAfter
insertBefore(parent, newChild, ref);
insertBefore(parent, ref, newChild);
![Page 24: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/24.jpg)
Axiom CompositionAxiom Composition- insertAfter- insertAfter
![Page 25: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/25.jpg)
More than Minimal DOMMore than Minimal DOM
cloneNodecloneNode
replaceChildreplaceChild
hasChildNodeshasChildNodes
insertAfter
nodeEquality
DOM Core Level 1:
![Page 26: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/26.jpg)
ConclusionConclusion
Complete Spec. for Minimal DOMComplete Spec. for Minimal DOM
Complete Spec. for Structural DOM Core Complete Spec. for Structural DOM Core Level 1Level 1
Highly ExtendableHighly Extendable
Automated Verification now possibleAutomated Verification now possible
![Page 27: DOM: Towards a Formal Specification](https://reader035.fdocuments.net/reader035/viewer/2022062422/56812d68550346895d9279a0/html5/thumbnails/27.jpg)
Future WorkFuture Work Automated Verification ToolAutomated Verification Tool
Getting it SmallGetting it Small
The Rest of Core Level 1The Rest of Core Level 1
Higher Levels of DOMHigher Levels of DOM
Concurrent DOMConcurrent DOM