DOM: Towards a Formal Specification

27
DOM: DOM: Towards a Formal Towards a Formal Specification Specification Author: Mark Wheelhouse Supervisor: Dr. Philippa Gardner Thanks to: Gareth Smith, Uri Zarfaty, Ian Hodkinson

description

DOM: Towards a Formal Specification. Author: Mark Wheelhouse Supervisor: Dr. Philippa Gardner Thanks to: Gareth Smith, Uri Zarfaty, Ian Hodkinson. Current Spec. English Verbose Ambiguous Automated Verification Not Possible Extensions Hard Time-consuming. What We Want Formalism - PowerPoint PPT Presentation

Transcript of DOM: Towards a Formal Specification

Page 1: DOM: Towards a Formal Specification

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

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

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

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

Minimal DOMMinimal DOM

createNodecreateNode

getNodeNamegetNodeName

getChildNodesgetChildNodes

appendappend

getLengthgetLength

getItemgetItem

getParentNodegetParentNode

insertBeforeinsertBefore

removeChildremoveChild

Page 6: DOM: Towards a Formal Specification

Minimal DOMMinimal DOM

createNodecreateNode

getNodeNamegetNodeName

getChildNodesgetChildNodes

appendappend

getLengthgetLength

getItemgetItem

getParentNodegetParentNode

insertBeforeinsertBefore

removeChildremoveChild

Page 7: DOM: Towards a Formal Specification

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

Context Logic - ApplicationContext Logic - Application

Pre: P Command: C Post: Q

Page 9: DOM: Towards a Formal Specification

Context Logic – Right Context Logic – Right TriangleTriangle

K = (P Q)

Page 10: DOM: Towards a Formal Specification

Data StructureData Structure

Page 11: DOM: Towards a Formal Specification

Command AxiomsCommand Axioms

{ Pre-condition }

{ Post-condition }

Command

Specifying the Local Behaviour of the commands:

Page 12: DOM: Towards a Formal Specification

getNodeNamegetNodeName

tag’ = getNodeName(id);

tag’ = tag

Page 13: DOM: Towards a Formal Specification

getNodeName - Small getNodeName - Small AxiomAxiom

Page 14: DOM: Towards a Formal Specification

Weakest Pre-conditionWeakest Pre-condition

Page 15: DOM: Towards a Formal Specification

Weakest Pre-conditionWeakest Pre-condition

Page 16: DOM: Towards a Formal Specification

Weakest Pre-conditionWeakest Pre-condition

Page 17: DOM: Towards a Formal Specification

Weakest Pre-conditionWeakest Pre-condition

Page 18: DOM: Towards a Formal Specification

insertBeforeinsertBefore

insertBefore(parent, newChild, ref);

Page 19: DOM: Towards a Formal Specification

Ancestor IssueAncestor Issue

Page 20: DOM: Towards a Formal Specification

insertBefore - AxiominsertBefore - Axiom

Why not Small ?

Page 21: DOM: Towards a Formal Specification

Weakest Pre-conditionWeakest Pre-condition

Page 22: DOM: Towards a Formal Specification

Weakest Pre-conditionWeakest Pre-condition

Page 23: DOM: Towards a Formal Specification

Axiom CompositionAxiom Composition- insertAfter- insertAfter

insertBefore(parent, newChild, ref);

insertBefore(parent, ref, newChild);

Page 24: DOM: Towards a Formal Specification

Axiom CompositionAxiom Composition- insertAfter- insertAfter

Page 25: DOM: Towards a Formal Specification

More than Minimal DOMMore than Minimal DOM

cloneNodecloneNode

replaceChildreplaceChild

hasChildNodeshasChildNodes

insertAfter

nodeEquality

DOM Core Level 1:

Page 26: DOM: Towards a Formal Specification

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

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