dom: towards a formal specification author: mark wheelhouse supervisor: dr. philippa gardner thanks...

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

Upload: sybil-summers

Post on 17-Dec-2015

215 views

Category:

Documents


0 download

TRANSCRIPT

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

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 Author: Mark Wheelhouse Supervisor: Dr. Philippa Gardner Thanks to: Gareth Smith, Uri Zarfaty, Ian Hodkinson

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 Author: Mark Wheelhouse Supervisor: Dr. Philippa Gardner Thanks to: Gareth Smith, Uri Zarfaty, Ian Hodkinson

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 Author: Mark Wheelhouse Supervisor: Dr. Philippa Gardner Thanks to: Gareth Smith, Uri Zarfaty, Ian Hodkinson

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 Author: Mark Wheelhouse Supervisor: Dr. Philippa Gardner Thanks to: Gareth Smith, Uri Zarfaty, Ian Hodkinson

Minimal DOMMinimal DOM

createNodecreateNode

getNodeNamegetNodeName

getChildNodesgetChildNodes

appendappend

getLengthgetLength

getItemgetItem

getParentNodegetParentNode

insertBeforeinsertBefore

removeChildremoveChild

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

Minimal DOMMinimal DOM

createNodecreateNode

getNodeNamegetNodeName

getChildNodesgetChildNodes

appendappend

getLengthgetLength

getItemgetItem

getParentNodegetParentNode

insertBeforeinsertBefore

removeChildremoveChild

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

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 Author: Mark Wheelhouse Supervisor: Dr. Philippa Gardner Thanks to: Gareth Smith, Uri Zarfaty, Ian Hodkinson

Context Logic - ApplicationContext Logic - Application

Pre: P Command: C Post: Q

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

Context Logic – Right Context Logic – Right TriangleTriangle

K = (P Q)

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

Data StructureData Structure

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

Command AxiomsCommand Axioms

{ Pre-condition }

{ Post-condition }

Command

Specifying the Local Behaviour of the commands:

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

getNodeNamegetNodeName

tag’ = getNodeName(id);

tag’ = tag

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

getNodeName - Small getNodeName - Small AxiomAxiom

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

Weakest Pre-conditionWeakest Pre-condition

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

Weakest Pre-conditionWeakest Pre-condition

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

Weakest Pre-conditionWeakest Pre-condition

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

Weakest Pre-conditionWeakest Pre-condition

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

insertBeforeinsertBefore

insertBefore(parent, newChild, ref);

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

Ancestor IssueAncestor Issue

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

insertBefore - AxiominsertBefore - Axiom

Why not Small ?

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

Weakest Pre-conditionWeakest Pre-condition

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

Weakest Pre-conditionWeakest Pre-condition

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

Axiom CompositionAxiom Composition- insertAfter- insertAfter

insertBefore(parent, newChild, ref);

insertBefore(parent, ref, newChild);

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

Axiom CompositionAxiom Composition- insertAfter- insertAfter

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

More than Minimal DOMMore than Minimal DOM

cloneNodecloneNode

replaceChildreplaceChild

hasChildNodeshasChildNodes

insertAfter

nodeEquality

DOM Core Level 1:

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

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 Author: Mark Wheelhouse Supervisor: Dr. Philippa Gardner Thanks to: Gareth Smith, Uri Zarfaty, Ian Hodkinson

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