175
Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations, Trees, XPath Lecture VI Harvest: Core XPath 1.0 as a Modal Logic for Trees Axiomatizations and Complexity Tadeusz Litak Department of Computer Science University of Leicester July 2010: draft Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (1/59)

Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Queries, Modalities, Relations, Trees, XPathLecture VI

Harvest: Core XPath 1.0as a Modal Logic for Trees

Axiomatizations and Complexity

Tadeusz Litak

Department of Computer ScienceUniversity of Leicester

July 2010: draft

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (1/59)

Page 2: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Before we begin . . .

I am sometimes asked by students (not researchers, as theyknow the answer)

why theory is needed?is it possible to just do applications

without any theory?

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (2/59)

Page 3: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

The answer

was provided by

Charles-Louis de Secondat,baron de La Bréde et de Montesquieu,

one of the greatest European philosophers of law(XVIIIth century)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (3/59)

Page 4: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (4/59)

Page 5: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

An Idea of Despotic PowerWhen the savages of Louisiana are desirous of fruit,

they cut the tree to the root, and gather the fruit.

This is an emblem of despotic government.

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (5/59)

Page 6: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Trying to learn “applications” without necessary background

means cutting the tree of learning

In the long run, you are not going to have any fruits

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (6/59)

Page 7: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Only after you learn theory properly, you realize

how many results you can produce

how closely things are connected

how many tools and techniques from the past you canreuse

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (7/59)

Page 8: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Only after you learn theory properly, you realize

how many results you can produce

how closely things are connected

how many tools and techniques from the past you canreuse

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (7/59)

Page 9: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Only after you learn theory properly, you realize

how many results you can produce

how closely things are connected

how many tools and techniques from the past you canreuse

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (7/59)

Page 10: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Only after you learn theory properly, you realize

how many results you can produce

how closely things are connected

how many tools and techniques from the past you canreuse

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (7/59)

Page 11: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

FROM NOW ON, THE LECTURE IS MEANTTO ILLUSTRATE THIS

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (8/59)

Page 12: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

To use José’s terminology, the contents belong

to Web Services Architecture

and more specifically, of course,

to XML Technologies

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (9/59)

Page 13: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XML and Web Technologies

A good overall reference:

Webpage for the book: http://www.brics.dk/ixwt/

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (10/59)

Page 14: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XPath

Most detailed reference on XPath(except for W3C specification itself):

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (11/59)

Page 15: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XML and Semi-structured Data

XMLeXtensible Markup Language

began as a subset of SGML:

Standard Generalized Markup Language

(HTML: simplified and corrupted subset of SGML)developed to

RSSAtomSOAPXHTML . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (12/59)

Page 16: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XML and Semi-structured Data

XMLeXtensible Markup Language

began as a subset of SGML:

Standard Generalized Markup Language

(HTML: simplified and corrupted subset of SGML)developed to

RSSAtomSOAPXHTML . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (12/59)

Page 17: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XML and Semi-structured Data

XMLeXtensible Markup Language

began as a subset of SGML:

Standard Generalized Markup Language

(HTML: simplified and corrupted subset of SGML)

developed to

RSSAtomSOAPXHTML . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (12/59)

Page 18: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XML and Semi-structured Data

XMLeXtensible Markup Language

began as a subset of SGML:

Standard Generalized Markup Language

(HTML: simplified and corrupted subset of SGML)developed to

RSS

AtomSOAPXHTML . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (12/59)

Page 19: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XML and Semi-structured Data

XMLeXtensible Markup Language

began as a subset of SGML:

Standard Generalized Markup Language

(HTML: simplified and corrupted subset of SGML)developed to

RSSAtom

SOAPXHTML . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (12/59)

Page 20: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XML and Semi-structured Data

XMLeXtensible Markup Language

began as a subset of SGML:

Standard Generalized Markup Language

(HTML: simplified and corrupted subset of SGML)developed to

RSSAtomSOAP

XHTML . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (12/59)

Page 21: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XML and Semi-structured Data

XMLeXtensible Markup Language

began as a subset of SGML:

Standard Generalized Markup Language

(HTML: simplified and corrupted subset of SGML)developed to

RSSAtomSOAPXHTML . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (12/59)

Page 22: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Example Document

No XML talk can do without its own example document:

<?xml version=’1.0’ encoding=’UTF-8’?><talk date=’23-Jul-2010’>

<speaker uni=’Leicester’>T. Litak</speaker><title>

<i>Core XPath 1.0</i>as a Modal Logic</title><location>

<i>JXNU</i><b>Nanchang</b></location>

</talk>

(no DTD given, but you can easily come up with one)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (13/59)

Page 23: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Example Document

No XML talk can do without its own example document:

<?xml version=’1.0’ encoding=’UTF-8’?><talk date=’23-Jul-2010’>

<speaker uni=’Leicester’>T. Litak</speaker><title>

<i>Core XPath 1.0</i>as a Modal Logic</title><location>

<i>JXNU</i><b>Nanchang</b></location>

</talk>

(no DTD given, but you can easily come up with one)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (13/59)

Page 24: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

What we’ll see through our dim glasses

E

ither this . . .

talk

speaker title

i

location

i b

(

we cannot even see attributes, each node is labelled with a single label: its name)

At any rate, we are too blind to see actual text content

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (14/59)

Page 25: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

What we’ll see through our dim glasses

Either this . . .

talk

speaker title

i

location

i b

(we cannot even see attributes, each node is labelled with a single label: its name)

At any rate, we are too blind to see actual text content

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (14/59)

Page 26: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

What we’ll see through our dim glasses

or that . . .

talk,@date=’23-Jul-2010’

speaker,@uni=’Leicester’ title

i

location

i b

(attribute-value pairs are additional labels)

At any rate, we are too blind to see actual text content

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (14/59)

Page 27: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

What we’ll see through our dim glasses

or perhaps . . .

talk

@date=’23-Jul-2010’ speaker

@uni=’Leicester’

title

i

location

i b

(back to the unique labelling idea, attribute-value pairs are a special kind of children)

At any rate, we are too blind to see actual text content

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (14/59)

Page 28: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

What we’ll see through our dim glasses

or perhaps . . .

talk

@date=’23-Jul-2010’ speaker

@uni=’Leicester’

title

i

location

i b

(back to the unique labelling idea, attribute-value pairs are a special kind of children)

At any rate, we are too blind to see actual text content

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (14/59)

Page 29: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XPath 1.0: W3C Specification

Provides a common syntax and semantics for functionalityshared between [XQuery], XSL Transformations and XPointer

Primary purpose: to address parts of an XML document

In support of this primary purpose, it also providesbasic facilities for manipulation of strings, numbers and booleans

Uses a compact, non-XML syntaxto facilitate use of XPath within URIs and XML attribute values

Operates on the abstract, logical structure of an XML document,rather than its surface syntax

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (15/59)

Page 30: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XPath 1.0: W3C Specification

Provides a common syntax and semantics for functionalityshared between [XQuery], XSL Transformations and XPointer

Primary purpose: to address parts of an XML document

In support of this primary purpose, it also providesbasic facilities for manipulation of strings, numbers and booleans

Uses a compact, non-XML syntaxto facilitate use of XPath within URIs and XML attribute values

Operates on the abstract, logical structure of an XML document,rather than its surface syntax

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (15/59)

Page 31: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XPath 1.0: W3C Specification

Provides a common syntax and semantics for functionalityshared between [XQuery], XSL Transformations and XPointer

Primary purpose: to address parts of an XML document

In support of this primary purpose, it also providesbasic facilities for manipulation of strings, numbers and booleans

Uses a compact, non-XML syntaxto facilitate use of XPath within URIs and XML attribute values

Operates on the abstract, logical structure of an XML document,rather than its surface syntax

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (15/59)

Page 32: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XPath 1.0: W3C Specification

Provides a common syntax and semantics for functionalityshared between [XQuery], XSL Transformations and XPointer

Primary purpose: to address parts of an XML document

In support of this primary purpose, it also providesbasic facilities for manipulation of strings, numbers and booleans

Uses a compact, non-XML syntaxto facilitate use of XPath within URIs and XML attribute values

Operates on the abstract, logical structure of an XML document,rather than its surface syntax

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (15/59)

Page 33: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

XPath 1.0: W3C Specification

Provides a common syntax and semantics for functionalityshared between [XQuery], XSL Transformations and XPointer

Primary purpose: to address parts of an XML document

In support of this primary purpose, it also providesbasic facilities for manipulation of strings, numbers and booleans

Uses a compact, non-XML syntaxto facilitate use of XPath within URIs and XML attribute values

Operates on the abstract, logical structure of an XML document,rather than its surface syntax

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (15/59)

Page 34: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Samples of XPath Expressions

Unions. For example: /note/from | /note/to.

Counting. For example: /node/to[1]

Descendant and ancestor steps. For example: /node//i

Filters. For example: /note[from]/to

Attributes. For example: /note[@date="10-nov-2006"]

String functions. For example:/note[substring(body,1,3)="It’s"]

Arithmetical functions. . . .

. . .

Specification of XPath 1.0 (W3C, Nov ’99): ± 30 pages.

Specification of XPath 2.0 (W3C, Nov ’05): ± 90 pages.

Specification of XPath 3.0: ± 270 pages? (Balder’sextrapolation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (16/59)

Page 35: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Samples of XPath Expressions

Unions. For example: /note/from | /note/to.

Counting. For example: /node/to[1]

Descendant and ancestor steps. For example: /node//i

Filters. For example: /note[from]/to

Attributes. For example: /note[@date="10-nov-2006"]

String functions. For example:/note[substring(body,1,3)="It’s"]

Arithmetical functions. . . .

. . .

Specification of XPath 1.0 (W3C, Nov ’99): ± 30 pages.

Specification of XPath 2.0 (W3C, Nov ’05): ± 90 pages.

Specification of XPath 3.0: ± 270 pages? (Balder’sextrapolation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (16/59)

Page 36: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Samples of XPath Expressions

Unions. For example: /note/from | /note/to.

Counting. For example: /node/to[1]

Descendant and ancestor steps. For example: /node//i

Filters. For example: /note[from]/to

Attributes. For example: /note[@date="10-nov-2006"]

String functions. For example:/note[substring(body,1,3)="It’s"]

Arithmetical functions. . . .

. . .

Specification of XPath 1.0 (W3C, Nov ’99): ± 30 pages.

Specification of XPath 2.0 (W3C, Nov ’05): ± 90 pages.

Specification of XPath 3.0: ± 270 pages? (Balder’sextrapolation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (16/59)

Page 37: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Samples of XPath Expressions

Unions. For example: /note/from | /note/to.

Counting. For example: /node/to[1]

Descendant and ancestor steps. For example: /node//i

Filters. For example: /note[from]/to

Attributes. For example: /note[@date="10-nov-2006"]

String functions. For example:/note[substring(body,1,3)="It’s"]

Arithmetical functions. . . .

. . .

Specification of XPath 1.0 (W3C, Nov ’99): ± 30 pages.

Specification of XPath 2.0 (W3C, Nov ’05): ± 90 pages.

Specification of XPath 3.0: ± 270 pages? (Balder’sextrapolation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (16/59)

Page 38: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Samples of XPath Expressions

Unions. For example: /note/from | /note/to.

Counting. For example: /node/to[1]

Descendant and ancestor steps. For example: /node//i

Filters. For example: /note[from]/to

Attributes. For example: /note[@date="10-nov-2006"]

String functions. For example:/note[substring(body,1,3)="It’s"]

Arithmetical functions. . . .

. . .

Specification of XPath 1.0 (W3C, Nov ’99): ± 30 pages.

Specification of XPath 2.0 (W3C, Nov ’05): ± 90 pages.

Specification of XPath 3.0: ± 270 pages? (Balder’sextrapolation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (16/59)

Page 39: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Samples of XPath Expressions

Unions. For example: /note/from | /note/to.

Counting. For example: /node/to[1]

Descendant and ancestor steps. For example: /node//i

Filters. For example: /note[from]/to

Attributes. For example: /note[@date="10-nov-2006"]

String functions. For example:/note[substring(body,1,3)="It’s"]

Arithmetical functions. . . .

. . .

Specification of XPath 1.0 (W3C, Nov ’99): ± 30 pages.

Specification of XPath 2.0 (W3C, Nov ’05): ± 90 pages.

Specification of XPath 3.0: ± 270 pages? (Balder’sextrapolation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (16/59)

Page 40: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Samples of XPath Expressions

Unions. For example: /note/from | /note/to.

Counting. For example: /node/to[1]

Descendant and ancestor steps. For example: /node//i

Filters. For example: /note[from]/to

Attributes. For example: /note[@date="10-nov-2006"]

String functions. For example:/note[substring(body,1,3)="It’s"]

Arithmetical functions. . . .

. . .

Specification of XPath 1.0 (W3C, Nov ’99): ± 30 pages.

Specification of XPath 2.0 (W3C, Nov ’05): ± 90 pages.

Specification of XPath 3.0: ± 270 pages? (Balder’sextrapolation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (16/59)

Page 41: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Samples of XPath Expressions

Unions. For example: /note/from | /note/to.

Counting. For example: /node/to[1]

Descendant and ancestor steps. For example: /node//i

Filters. For example: /note[from]/to

Attributes. For example: /note[@date="10-nov-2006"]

String functions. For example:/note[substring(body,1,3)="It’s"]

Arithmetical functions. . . .

. . .

Specification of XPath 1.0 (W3C, Nov ’99): ± 30 pages.

Specification of XPath 2.0 (W3C, Nov ’05): ± 90 pages.

Specification of XPath 3.0: ± 270 pages? (Balder’sextrapolation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (16/59)

Page 42: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Samples of XPath Expressions

Unions. For example: /note/from | /note/to.

Counting. For example: /node/to[1]

Descendant and ancestor steps. For example: /node//i

Filters. For example: /note[from]/to

Attributes. For example: /note[@date="10-nov-2006"]

String functions. For example:/note[substring(body,1,3)="It’s"]

Arithmetical functions. . . .

. . .

Specification of XPath 1.0 (W3C, Nov ’99): ± 30 pages.

Specification of XPath 2.0 (W3C, Nov ’05): ± 90 pages.

Specification of XPath 3.0: ± 270 pages? (Balder’sextrapolation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (16/59)

Page 43: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Samples of XPath Expressions

Unions. For example: /note/from | /note/to.

Counting. For example: /node/to[1]

Descendant and ancestor steps. For example: /node//i

Filters. For example: /note[from]/to

Attributes. For example: /note[@date="10-nov-2006"]

String functions. For example:/note[substring(body,1,3)="It’s"]

Arithmetical functions. . . .

. . .

Specification of XPath 1.0 (W3C, Nov ’99): ± 30 pages.

Specification of XPath 2.0 (W3C, Nov ’05): ± 90 pages.

Specification of XPath 3.0: ± 270 pages? (Balder’sextrapolation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (16/59)

Page 44: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Samples of XPath Expressions

Unions. For example: /note/from | /note/to.

Counting. For example: /node/to[1]

Descendant and ancestor steps. For example: /node//i

Filters. For example: /note[from]/to

Attributes. For example: /note[@date="10-nov-2006"]

String functions. For example:/note[substring(body,1,3)="It’s"]

Arithmetical functions. . . .

. . .

Specification of XPath 1.0 (W3C, Nov ’99): ± 30 pages.

Specification of XPath 2.0 (W3C, Nov ’05): ± 90 pages.

Specification of XPath 3.0: ± 270 pages? (Balder’sextrapolation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (16/59)

Page 45: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath 1.0

We focus on the basic navigational functionality of XPath:

(no arithmetics, no strings, no counting . . .—recall these features are secondary!)

Core XPath 1.0Isolated by Gottlob, Koch and Pichler in 2002

An additional advantage of such a simple language:

data model discrepancies between XPath 1.0 and 2.0no longer relevant

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (17/59)

Page 46: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath 1.0

We focus on the basic navigational functionality of XPath:(no arithmetics, no strings, no counting . . .—recall these features are secondary!)

Core XPath 1.0Isolated by Gottlob, Koch and Pichler in 2002

An additional advantage of such a simple language:

data model discrepancies between XPath 1.0 and 2.0no longer relevant

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (17/59)

Page 47: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath 1.0

We focus on the basic navigational functionality of XPath:(no arithmetics, no strings, no counting . . .—recall these features are secondary!)

Core XPath 1.0Isolated by Gottlob, Koch and Pichler in 2002

An additional advantage of such a simple language:

data model discrepancies between XPath 1.0 and 2.0no longer relevant

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (17/59)

Page 48: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath 1.0

We focus on the basic navigational functionality of XPath:(no arithmetics, no strings, no counting . . .—recall these features are secondary!)

Core XPath 1.0Isolated by Gottlob, Koch and Pichler in 2002

An additional advantage of such a simple language:

data model discrepancies between XPath 1.0 and 2.0no longer relevant

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (17/59)

Page 49: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath

Core XPath has two types of expressions:Path expressions define binary relationsNode expressions define sets of nodes

Syntax of Core XPath:

s ::= ↓, ↑,←,→a ::= s | s+

pexpr ::= a | · | pexpr/pexpr | pexpr ∪ pexpr | pexpr[nexpr]nexpr ::= p | 〈pexpr〉 | ¬nexpr | nexpr ∨ nexpr (p ∈ Σ)

(Our notation is a bit different from the official XPath notation)

We also consider single axis fragments of CoreXPath—notationCoreXPath(a) for a fixed axis a

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (18/59)

Page 50: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath

Core XPath has two types of expressions:Path expressions define binary relationsNode expressions define sets of nodes

Syntax of Core XPath:

s ::= ↓, ↑,←,→a ::= s | s+

pexpr ::= a | · | pexpr/pexpr | pexpr ∪ pexpr | pexpr[nexpr]nexpr ::= p | 〈pexpr〉 | ¬nexpr | nexpr ∨ nexpr (p ∈ Σ)

(Our notation is a bit different from the official XPath notation)

We also consider single axis fragments of CoreXPath—notationCoreXPath(a) for a fixed axis a

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (18/59)

Page 51: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath

Core XPath has two types of expressions:Path expressions define binary relationsNode expressions define sets of nodes

Syntax of Core XPath:

s ::= ↓, ↑,←,→a ::= s | s+

pexpr ::= a | · | pexpr/pexpr | pexpr ∪ pexpr | pexpr[nexpr]

nexpr ::= p | 〈pexpr〉 | ¬nexpr | nexpr ∨ nexpr (p ∈ Σ)

(Our notation is a bit different from the official XPath notation)

We also consider single axis fragments of CoreXPath—notationCoreXPath(a) for a fixed axis a

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (18/59)

Page 52: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath

Core XPath has two types of expressions:Path expressions define binary relationsNode expressions define sets of nodes

Syntax of Core XPath:

s ::= ↓, ↑,←,→a ::= s | s+

pexpr ::= a | · | pexpr/pexpr | pexpr ∪ pexpr | pexpr[nexpr]nexpr ::= p | 〈pexpr〉 | ¬nexpr | nexpr ∨ nexpr (p ∈ Σ)

(Our notation is a bit different from the official XPath notation)

We also consider single axis fragments of CoreXPath—notationCoreXPath(a) for a fixed axis a

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (18/59)

Page 53: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath

Core XPath has two types of expressions:Path expressions define binary relationsNode expressions define sets of nodes

Syntax of Core XPath:children::*,parent::*,preceding-sibling::*[1],following-sibling::*[1]a ::= s | s+

pexpr ::= a | · | pexpr/pexpr | pexpr ∪ pexpr | pexpr[nexpr]nexpr ::= p | 〈pexpr〉 | ¬nexpr | nexpr ∨ nexpr (p ∈ Σ)

(Our notation is a bit different from the official XPath notation)

We also consider single axis fragments of CoreXPath—notationCoreXPath(a) for a fixed axis a

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (18/59)

Page 54: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath

Core XPath has two types of expressions:Path expressions define binary relationsNode expressions define sets of nodes

Syntax of Core XPath:children::*,parent::*,preceding-sibling::*[1],following-sibling::*[1]. . .descendant::*,ancestor::*,preceding-sibling::*,following-sibling::*pexpr ::= a | · | pexpr/pexpr | pexpr ∪ pexpr | pexpr[nexpr]nexpr ::= p | 〈pexpr〉 | ¬nexpr | nexpr ∨ nexpr (p ∈ Σ)

(Our notation is a bit different from the official XPath notation)

We also consider single axis fragments of CoreXPath—notationCoreXPath(a) for a fixed axis a

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (18/59)

Page 55: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath

Core XPath has two types of expressions:Path expressions define binary relationsNode expressions define sets of nodes

Syntax of Core XPath:children::*,parent::*,preceding-sibling::*[1],following-sibling::*[1]. . .descendant::*,ancestor::*,preceding-sibling::*,following-sibling::*. . .self::*, pexpr/pexpr, pexpr | pexpr, pexpr[nexpr]nexpr ::= p | 〈pexpr〉 | ¬nexpr | nexpr ∨ nexpr (p ∈ Σ)

(Our notation is a bit different from the official XPath notation)

We also consider single axis fragments of CoreXPath—notationCoreXPath(a) for a fixed axis a

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (18/59)

Page 56: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath

Core XPath has two types of expressions:Path expressions define binary relationsNode expressions define sets of nodes

Syntax of Core XPath:children::*,parent::*,preceding-sibling::*[1],following-sibling::*[1]. . .descendant::*,ancestor::*,preceding-sibling::*,following-sibling::*. . .self::*, pexpr/pexpr, pexpr | pexpr, pexpr[nexpr]self::p , pexpr, not(nexpr), nexpr or nexpr

(Our notation is a bit different from the official XPath notation)

We also consider single axis fragments of CoreXPath—notationCoreXPath(a) for a fixed axis a

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (18/59)

Page 57: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath

Core XPath has two types of expressions:Path expressions define binary relationsNode expressions define sets of nodes

Syntax of Core XPath:

s ::= ↓, ↑,←,→a ::= s | s+

pexpr ::= a | · | pexpr/pexpr | pexpr ∪ pexpr | pexpr[nexpr]nexpr ::= p | 〈pexpr〉 | ¬nexpr | nexpr ∨ nexpr (p ∈ Σ)

(Our notation is a bit different from the official XPath notation)

We also consider single axis fragments of CoreXPath—notationCoreXPath(a) for a fixed axis a

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (18/59)

Page 58: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Core XPath

Core XPath has two types of expressions:Path expressions define binary relationsNode expressions define sets of nodes

Syntax of Core XPath:

s ::= ↓, ↑,←,→a ::= s | s+

pexpr ::= a | · | pexpr/pexpr | pexpr ∪ pexpr | pexpr[nexpr]nexpr ::= p | 〈pexpr〉 | ¬nexpr | nexpr ∨ nexpr (p ∈ Σ)

(Our notation is a bit different from the official XPath notation)

We also consider single axis fragments of CoreXPath—notationCoreXPath(a) for a fixed axis a

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (18/59)

Page 59: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Semantics of CoreXPath I

As said above, we see XML documents asfinite sibling-ordered node labelled trees:ideal abstraction for such a simple syntax

XML documentA tuple T = (N,R↓,R→,V ) where

- N is the set of nodes,- R↓ and R→ are ‘child’ and ‘next sibling’ relations of a finite

tree, and- V : Σ→ 2N (or just V : N → Σ if unique labelling assumed)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (19/59)

Page 60: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Semantics of CoreXPath I

As said above, we see XML documents asfinite sibling-ordered node labelled trees:ideal abstraction for such a simple syntax

XML documentA tuple T = (N,R↓,R→,V ) where

- N is the set of nodes,- R↓ and R→ are ‘child’ and ‘next sibling’ relations of a finite

tree, and- V : Σ→ 2N (or just V : N → Σ if unique labelling assumed)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (19/59)

Page 61: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Semantics of CoreXPath I

As said above, we see XML documents asfinite sibling-ordered node labelled trees:ideal abstraction for such a simple syntax

XML documentA tuple T = (N,R↓,R→,V ) where

- N is the set of nodes,

- R↓ and R→ are ‘child’ and ‘next sibling’ relations of a finitetree, and

- V : Σ→ 2N (or just V : N → Σ if unique labelling assumed)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (19/59)

Page 62: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Semantics of CoreXPath I

As said above, we see XML documents asfinite sibling-ordered node labelled trees:ideal abstraction for such a simple syntax

XML documentA tuple T = (N,R↓,R→,V ) where

- N is the set of nodes,- R↓ and R→ are ‘child’ and ‘next sibling’ relations of a finite

tree, and

- V : Σ→ 2N (or just V : N → Σ if unique labelling assumed)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (19/59)

Page 63: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Semantics of CoreXPath I

As said above, we see XML documents asfinite sibling-ordered node labelled trees:ideal abstraction for such a simple syntax

XML documentA tuple T = (N,R↓,R→,V ) where

- N is the set of nodes,- R↓ and R→ are ‘child’ and ‘next sibling’ relations of a finite

tree, and- V : Σ→ 2N (or just V : N → Σ if unique labelling assumed)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (19/59)

Page 64: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Semantics of Core XPath II

pexpr : pairs (context node, reachable node)—subsets of N2

[[s]]T = Rs[[s+]]T = the transitive closure of Rs[[·]]T = the identity relation on N[[A/B]]T = composition of [[A]]T and [[B]]T

[[A ∪ B]]T = union of [[A]]T and [[B]]T

[[A[φ]]]T = {(n,m) ∈ [[A]]T | m ∈ [[φ]]T}

nexpr : subsets of N[[p]]T = {n ∈ N | n ∈ V (p)}[[φ ∧ ψ]]T = [[φ]]T ∩ [[ψ]]T

[[¬φ]]T = N \ [[φ]]T

[[〈A〉]]T = domain of [[A]]T = {n | (n,m) ∈ [[A]]T}

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (20/59)

Page 65: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Remember what we’ve seen yesterday?

A (slightly modified) diagram of Johan Van Benthem:

W W2

unary properties → modes → binary relations

of states ← projections ← between states

propositional operators program operators

ML DRA/TRA

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (21/59)

Page 66: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Examples of modes:

?X :={〈x , x〉 | x ∈ X} (testing)!X :={〈w , x〉 | w ∈W, x ∈ X} (realizing)

Examples of projections:

〈R〉 :={w ∈W | ∃v ∈W.wRWv} (domain)

π−1(R) :={w ∈W | ∃v ∈W.vRWw} (codomain)

∼R :={w ∈W | ∀v ∈W.¬(wRWv)} (antidomain)

∆(R) :={w ∈W | wRWw} (diagonal)

NOTE THAT:

〈R〉 = ∼∼R= R/R^ ∩ ·

∆(R) = R ∩ ·π−1(R) = 〈R^〉

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (22/59)

Page 67: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Examples of modes:

?X :={〈x , x〉 | x ∈ X} (testing)!X :={〈w , x〉 | w ∈W, x ∈ X} (realizing)

Examples of projections:

〈R〉 :={w ∈W | ∃v ∈W.wRWv} (domain)

π−1(R) :={w ∈W | ∃v ∈W.vRWw} (codomain)

∼R :={w ∈W | ∀v ∈W.¬(wRWv)} (antidomain)

∆(R) :={w ∈W | wRWw} (diagonal)

NOTE THAT:

〈R〉 = ∼∼R= R/R^ ∩ ·

∆(R) = R ∩ ·π−1(R) = 〈R^〉Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (22/59)

Page 68: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Comments for logicians

Note we do not allow transitive closure of arbitrary path expressions(allowed in non-standard extensions like Regular XPath)

Note also that path expressions, as opposed to node expressions,are not closed under other boolean connectives than sum(changed in XPath 2.0)

Therefore, we are not exactly in the world of Tarski’s relation algebras

The right algebraic two-sorted setting would beboolean modules over idempotent semirings

It is possible to move the discussion to one-sorted setting, though:

Dynamic Relation Algebras (DRA’s)studied in the 1990’s by a Dutch group in Utrecht (A. Visser, M. Hollenberg)

which are exactly idempotent semirings with antidomain operation ∼(also known as dynamic negation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (23/59)

Page 69: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Comments for logicians

Note we do not allow transitive closure of arbitrary path expressions(allowed in non-standard extensions like Regular XPath)

Note also that path expressions, as opposed to node expressions,are not closed under other boolean connectives than sum(changed in XPath 2.0)

Therefore, we are not exactly in the world of Tarski’s relation algebras

The right algebraic two-sorted setting would beboolean modules over idempotent semirings

It is possible to move the discussion to one-sorted setting, though:

Dynamic Relation Algebras (DRA’s)studied in the 1990’s by a Dutch group in Utrecht (A. Visser, M. Hollenberg)

which are exactly idempotent semirings with antidomain operation ∼(also known as dynamic negation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (23/59)

Page 70: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Comments for logicians

Note we do not allow transitive closure of arbitrary path expressions(allowed in non-standard extensions like Regular XPath)

Note also that path expressions, as opposed to node expressions,are not closed under other boolean connectives than sum(changed in XPath 2.0)

Therefore, we are not exactly in the world of Tarski’s relation algebras

The right algebraic two-sorted setting would beboolean modules over idempotent semirings

It is possible to move the discussion to one-sorted setting, though:

Dynamic Relation Algebras (DRA’s)studied in the 1990’s by a Dutch group in Utrecht (A. Visser, M. Hollenberg)

which are exactly idempotent semirings with antidomain operation ∼(also known as dynamic negation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (23/59)

Page 71: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Comments for logicians

Note we do not allow transitive closure of arbitrary path expressions(allowed in non-standard extensions like Regular XPath)

Note also that path expressions, as opposed to node expressions,are not closed under other boolean connectives than sum(changed in XPath 2.0)

Therefore, we are not exactly in the world of Tarski’s relation algebras

The right algebraic two-sorted setting would beboolean modules over idempotent semirings

It is possible to move the discussion to one-sorted setting, though:

Dynamic Relation Algebras (DRA’s)studied in the 1990’s by a Dutch group in Utrecht (A. Visser, M. Hollenberg)

which are exactly idempotent semirings with antidomain operation ∼(also known as dynamic negation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (23/59)

Page 72: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Comments for logicians

Note we do not allow transitive closure of arbitrary path expressions(allowed in non-standard extensions like Regular XPath)

Note also that path expressions, as opposed to node expressions,are not closed under other boolean connectives than sum(changed in XPath 2.0)

Therefore, we are not exactly in the world of Tarski’s relation algebras

The right algebraic two-sorted setting would beboolean modules over idempotent semirings

It is possible to move the discussion to one-sorted setting, though:

Dynamic Relation Algebras (DRA’s)studied in the 1990’s by a Dutch group in Utrecht (A. Visser, M. Hollenberg)

which are exactly idempotent semirings with antidomain operation ∼(also known as dynamic negation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (23/59)

Page 73: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Comments for logicians

Note we do not allow transitive closure of arbitrary path expressions(allowed in non-standard extensions like Regular XPath)

Note also that path expressions, as opposed to node expressions,are not closed under other boolean connectives than sum(changed in XPath 2.0)

Therefore, we are not exactly in the world of Tarski’s relation algebras

The right algebraic two-sorted setting would beboolean modules over idempotent semirings

It is possible to move the discussion to one-sorted setting, though:

Dynamic Relation Algebras (DRA’s)studied in the 1990’s by a Dutch group in Utrecht (A. Visser, M. Hollenberg)

which are exactly idempotent semirings with antidomain operation ∼(also known as dynamic negation)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (23/59)

Page 74: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Short Core XPath

Enter the Short CoreXPath (SCX) of de Rijke and Marx:one-sorted notational variant

Syntax of Short Core XPath:

s ::= ↓, ↑,←,→a ::= s | s+

exp ::= · | a | exp/exp | exp ∪ exp | ?p | ∼exp (p ∈ Σ)

Definition of a single axis fragment remains the same

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (24/59)

Page 75: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Short Core XPath

Enter the Short CoreXPath (SCX) of de Rijke and Marx:one-sorted notational variant

Syntax of Short Core XPath:

s ::= ↓, ↑,←,→a ::= s | s+

exp ::= · | a | exp/exp | exp ∪ exp

| ?p | ∼exp (p ∈ Σ)

Definition of a single axis fragment remains the same

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (24/59)

Page 76: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Short Core XPath

Enter the Short CoreXPath (SCX) of de Rijke and Marx:one-sorted notational variant

Syntax of Short Core XPath:

s ::= ↓, ↑,←,→a ::= s | s+

exp ::= · | a | exp/exp | exp ∪ exp | ?p | ∼exp (p ∈ Σ)

Definition of a single axis fragment remains the same

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (24/59)

Page 77: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Short Core XPath

Enter the Short CoreXPath (SCX) of de Rijke and Marx:one-sorted notational variant

Syntax of Short Core XPath:

s ::= ↓, ↑,←,→a ::= s | s+

exp ::= · | a | exp/exp | exp ∪ exp | ?p | ∼exp (p ∈ Σ)

Definition of a single axis fragment remains the same

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (24/59)

Page 78: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Semantics of Short Core XPath

pexpr : pairs (context node, reachable node)—subsets of N2

[[s]]T = Rs[[s+]]T = the transitive closure of Rs[[·]]T = the identity relation on N[[A/B]]T = composition of [[A]]T and [[B]]T

[[A ∪ B]]T = union of [[A]]T and [[B]]T

[[A[φ]]]T = {(n,m) ∈ [[A]]T | m ∈ [[φ]]T}nexpr : subsets of N

[[p]]T = {n ∈ N | n ∈ V (p)}[[φ ∧ ψ]]T = [[φ]]T ∩ [[ψ]]T

[[¬φ]]T = N \ [[φ]]T

[[〈A〉]]T = domain of [[A]]T = {n | (n,m) ∈ [[A]]T}

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (25/59)

Page 79: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Semantics of Short Core XPath

exp : pairs (context node, reachable node)—subsets of N2

[[s]]T = Rs[[s+]]T = the transitive closure of Rs[[·]]T = the identity relation on N[[A/B]]T = composition of [[A]]T and [[B]]T

[[A ∪ B]]T = union of [[A]]T and [[B]]T

[[?p]]T = {(n,n) ∈ N2 | n ∈ V (p)}[[∼A]]T = {(n,n) ∈ N2 | ∀m.(n,m) 6∈ [[A]]T}

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (25/59)

Page 80: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Back-and-forth Between Core XPath and SCX

One direction is easy:[[∼A]]T = [[·[¬〈A〉]]]T

But there is also a polynomial translation t in the reversedirection:

t(p) = ?pt(〈A〉) = ∼∼t(A)t(φ ∧ ψ) = ∼(∼t(φ) ∪ ∼t(ψ))t(A[φ]) = t(A)/t(φ)

other connectives being straightforward. Clearly

[[A]]T = [[t(A)]]T for all A ∈ pexpr

[[·[φ]]]T = [[t(φ)]]T for all φ ∈ nexpr

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (26/59)

Page 81: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Back-and-forth Between Core XPath and SCX

One direction is easy:[[∼A]]T = [[·[¬〈A〉]]]TBut there is also a polynomial translation t in the reversedirection:

t(p) = ?pt(〈A〉) = ∼∼t(A)t(φ ∧ ψ) = ∼(∼t(φ) ∪ ∼t(ψ))t(A[φ]) = t(A)/t(φ)

other connectives being straightforward. Clearly

[[A]]T = [[t(A)]]T for all A ∈ pexpr

[[·[φ]]]T = [[t(φ)]]T for all φ ∈ nexpr

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (26/59)

Page 82: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Back-and-forth Between Core XPath and SCX

One direction is easy:[[∼A]]T = [[·[¬〈A〉]]]TBut there is also a polynomial translation t in the reversedirection:

t(p) = ?pt(〈A〉) = ∼∼t(A)t(φ ∧ ψ) = ∼(∼t(φ) ∪ ∼t(ψ))t(A[φ]) = t(A)/t(φ)

other connectives being straightforward. Clearly

[[A]]T = [[t(A)]]T for all A ∈ pexpr

[[·[φ]]]T = [[t(φ)]]T for all φ ∈ nexpr

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (26/59)

Page 83: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

When Two Queries Are Equivalent?

DefinitionLet P and Q be either

both path expressions orboth node expressions

We say P and Q are equivalent (P ≡ Q)if for any document [[P]]T = [[Q]]T

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (27/59)

Page 84: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Which expressions are equivalent?

Let’s give it a try:

is it true that

· ≡ ↑/↓?fine, how about· ≡ ↓/↑and

↑/↓ ≡ ←+ ∪ · ∪→+?

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (28/59)

Page 85: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Which expressions are equivalent?

Let’s give it a try:

is it true that

· ≡ ↑/↓?

fine, how about· ≡ ↓/↑and

↑/↓ ≡ ←+ ∪ · ∪→+?

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (28/59)

Page 86: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Which expressions are equivalent?

Let’s give it a try:

is it true that

· ≡ ↑/↓?

fine, how about· ≡ ↓/↑and

↑/↓ ≡ ←+ ∪ · ∪→+?

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (28/59)

Page 87: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Which expressions are equivalent?

Let’s give it a try:

is it true that

· ≡ ↑/↓?fine, how about· ≡ ↓/↑and

↑/↓ ≡ ←+ ∪ · ∪→+?

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (28/59)

Page 88: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Which expressions are equivalent?

Let’s give it a try:

is it true that

· ≡ ↑/↓?fine, how about· ≡ ↓/↑and

↑/↓ ≡ ←+ ∪ · ∪→+?

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (28/59)

Page 89: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Which expressions are equivalent?

Let’s give it a try:

is it true that

· ≡ ↑/↓?fine, how about· ≡ ↓/↑and

↑/↓ ≡ ←+ ∪ · ∪→+?One last try: how about· [〈↓〉] ≡ ↓/↑and

↑/↓ ≡ ←+ ∪ · [〈↑〉] ∪→+?

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (28/59)

Page 90: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Which expressions are equivalent?

Let’s give it a try:

is it true that

· ≡ ↑/↓?fine, how about· ≡ ↓/↑and

↑/↓ ≡ ←+ ∪ · ∪→+?One last try: how about∼∼↓ ≡ ↓/↑and

↑/↓ ≡ ←+ ∪ ∼∼↑ ∪→+?

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (28/59)

Page 91: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

Which expressions are equivalent?

Let’s give it a try:

is it true that

· ≡ ↑/↓?fine, how about· ≡ ↓/↑and

↑/↓ ≡ ←+ ∪ · ∪→+?One last try: how about∼∼↓ ≡ ↓/↑and

↑/↓ ≡ ←+ ∪ ∼∼↑ ∪→+?

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (28/59)

Page 92: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

A non-trivial problem for query rewrite and optimization:

Evaluation times of two equivalent queriesmay differ up to several orders of magnitude!

When implementing an optimizer,you may need thousands of those equivalencesNow how do you know. . .

(soundness problem). . . all of your equivalences are valid?

some fake equivalences not so easy to spot, especially in hurry

(completeness problem). . . you took care of all (possibly) relevant ones?

there might be classes of equivalences you never thought of!

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (29/59)

Page 93: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

A non-trivial problem for query rewrite and optimization:

Evaluation times of two equivalent queriesmay differ up to several orders of magnitude!

When implementing an optimizer,you may need thousands of those equivalencesNow how do you know. . .

(soundness problem). . . all of your equivalences are valid?

some fake equivalences not so easy to spot, especially in hurry

(completeness problem). . . you took care of all (possibly) relevant ones?

there might be classes of equivalences you never thought of!

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (29/59)

Page 94: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

A non-trivial problem for query rewrite and optimization:

Evaluation times of two equivalent queriesmay differ up to several orders of magnitude!

When implementing an optimizer,you may need thousands of those equivalencesNow how do you know. . .

(soundness problem). . . all of your equivalences are valid?

some fake equivalences not so easy to spot, especially in hurry

(completeness problem). . . you took care of all (possibly) relevant ones?

there might be classes of equivalences you never thought of!

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (29/59)

Page 95: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

XPathIts Navigational CoreQuery Equivalence Problem

A non-trivial problem for query rewrite and optimization:

Evaluation times of two equivalent queriesmay differ up to several orders of magnitude!

When implementing an optimizer,you may need thousands of those equivalencesNow how do you know. . .

(soundness problem). . . all of your equivalences are valid?

some fake equivalences not so easy to spot, especially in hurry

(completeness problem). . . you took care of all (possibly) relevant ones?

there might be classes of equivalences you never thought of!

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (29/59)

Page 96: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Definition (Complete Axiomatization)A complete axiomatization of a given XPath fragment:

A set offinitely many valid equivalence schemesfinitely many validity preserving inference rules

from which every other valid equivalence is derivable.

For logicians again: of course, we are interested only in finite axiomatizations.As intended models are finite, finite axiomatization implies decidability!

One of reasons why we consider Core XPath only:

the whole XPath would be too big to allow an axiomatization

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (30/59)

Page 97: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Definition (Complete Axiomatization)A complete axiomatization of a given XPath fragment:

A set offinitely many valid equivalence schemesfinitely many validity preserving inference rules

from which every other valid equivalence is derivable.

For logicians again: of course, we are interested only in finite axiomatizations.As intended models are finite, finite axiomatization implies decidability!

One of reasons why we consider Core XPath only:

the whole XPath would be too big to allow an axiomatization

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (30/59)

Page 98: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Definition (Complete Axiomatization)A complete axiomatization of a given XPath fragment:

A set offinitely many valid equivalence schemesfinitely many validity preserving inference rules

from which every other valid equivalence is derivable.

For logicians again: of course, we are interested only in finite axiomatizations.As intended models are finite, finite axiomatization implies decidability!

One of reasons why we consider Core XPath only:

the whole XPath would be too big to allow an axiomatization

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (30/59)

Page 99: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

How does a complete axiomatization help?

Solves the soundness problem:if all your rules can be derived from the axioms, they are valid

Solves the completeness problem:if you can handle all the axioms, you did not forget anything

Hopefully, it should also yield better rewrite strategies

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (31/59)

Page 100: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

How does a complete axiomatization help?

Solves the soundness problem:if all your rules can be derived from the axioms, they are valid

Solves the completeness problem:if you can handle all the axioms, you did not forget anything

Hopefully, it should also yield better rewrite strategies

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (31/59)

Page 101: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

How does a complete axiomatization help?

Solves the soundness problem:if all your rules can be derived from the axioms, they are valid

Solves the completeness problem:if you can handle all the axioms, you did not forget anything

Hopefully, it should also yield better rewrite strategies

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (31/59)

Page 102: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Logic—Algebra—Query Languages

Logicians and algebraists have long studiedsimilar problems in a different disguise:

logic: algebras: databases:

formulas terms query planstautologies equations query equivalences

inference rules rewrite rules

In particular, they standarized a beautifully simple set of validitypreserving rules:

Birkhoff’s Calculus For Equational Logic

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (32/59)

Page 103: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Logic—Algebra—Query Languages

Logicians and algebraists have long studiedsimilar problems in a different disguise:

logic: algebras: databases:formulas terms query plans

tautologies equations query equivalencesinference rules rewrite rules

In particular, they standarized a beautifully simple set of validitypreserving rules:

Birkhoff’s Calculus For Equational Logic

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (32/59)

Page 104: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Logic—Algebra—Query Languages

Logicians and algebraists have long studiedsimilar problems in a different disguise:

logic: algebras: databases:formulas terms query planstautologies equations query equivalences

inference rules rewrite rules

In particular, they standarized a beautifully simple set of validitypreserving rules:

Birkhoff’s Calculus For Equational Logic

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (32/59)

Page 105: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Logic—Algebra—Query Languages

Logicians and algebraists have long studiedsimilar problems in a different disguise:

logic: algebras: databases:formulas terms query planstautologies equations query equivalences

inference rules rewrite rules

In particular, they standarized a beautifully simple set of validitypreserving rules:

Birkhoff’s Calculus For Equational Logic

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (32/59)

Page 106: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Logic—Algebra—Query Languages

Logicians and algebraists have long studiedsimilar problems in a different disguise:

logic: algebras: databases:formulas terms query planstautologies equations query equivalences

inference rules rewrite rules

In particular, they standarized a beautifully simple set of validitypreserving rules:

Birkhoff’s Calculus For Equational Logic

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (32/59)

Page 107: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Logic—Algebra—Query Languages

Logicians and algebraists have long studiedsimilar problems in a different disguise:

logic: algebras: databases:formulas terms query planstautologies equations query equivalences

inference rules rewrite rules

In particular, they standarized a beautifully simple set of validitypreserving rules:

Birkhoff’s Calculus For Equational Logic

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (32/59)

Page 108: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Birkhoff’s Calculus For Equational Logic

DefinitionLet Γ be a set of equivalences.Equivalence P ≡ Q is derivable from Γ if it can be obtainedby the following rules:P ≡ P

P ≡ Q =⇒ Q ≡ PP ≡ Q & Q ≡ R =⇒ P ≡ RP ≡ Q =⇒ R ≡ R′

(R′ is obtained from R by replacing occurrences of P by Q)

An axiomatization using Birkhoff’s rules only is orthodox.

Clearly, these rules preserve validity.

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (33/59)

Page 109: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Birkhoff’s Calculus For Equational Logic

DefinitionLet Γ be a set of equivalences.Equivalence P ≡ Q is derivable from Γ if it can be obtainedby the following rules:P ≡ PP ≡ Q =⇒ Q ≡ P

P ≡ Q & Q ≡ R =⇒ P ≡ RP ≡ Q =⇒ R ≡ R′

(R′ is obtained from R by replacing occurrences of P by Q)

An axiomatization using Birkhoff’s rules only is orthodox.

Clearly, these rules preserve validity.

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (33/59)

Page 110: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Birkhoff’s Calculus For Equational Logic

DefinitionLet Γ be a set of equivalences.Equivalence P ≡ Q is derivable from Γ if it can be obtainedby the following rules:P ≡ PP ≡ Q =⇒ Q ≡ PP ≡ Q & Q ≡ R =⇒ P ≡ R

P ≡ Q =⇒ R ≡ R′

(R′ is obtained from R by replacing occurrences of P by Q)

An axiomatization using Birkhoff’s rules only is orthodox.

Clearly, these rules preserve validity.

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (33/59)

Page 111: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Birkhoff’s Calculus For Equational Logic

DefinitionLet Γ be a set of equivalences.Equivalence P ≡ Q is derivable from Γ if it can be obtainedby the following rules:P ≡ PP ≡ Q =⇒ Q ≡ PP ≡ Q & Q ≡ R =⇒ P ≡ RP ≡ Q =⇒ R ≡ R′

(R′ is obtained from R by replacing occurrences of P by Q)

An axiomatization using Birkhoff’s rules only is orthodox.

Clearly, these rules preserve validity.

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (33/59)

Page 112: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Birkhoff’s Calculus For Equational Logic

DefinitionLet Γ be a set of equivalences.Equivalence P ≡ Q is derivable from Γ if it can be obtainedby the following rules:P ≡ PP ≡ Q =⇒ Q ≡ PP ≡ Q & Q ≡ R =⇒ P ≡ RP ≡ Q =⇒ R ≡ R′

(R′ is obtained from R by replacing occurrences of P by Q)

An axiomatization using Birkhoff’s rules only is orthodox.

Clearly, these rules preserve validity.

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (33/59)

Page 113: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Birkhoff’s Calculus For Equational Logic

DefinitionLet Γ be a set of equivalences.Equivalence P ≡ Q is derivable from Γ if it can be obtainedby the following rules:P ≡ PP ≡ Q =⇒ Q ≡ PP ≡ Q & Q ≡ R =⇒ P ≡ RP ≡ Q =⇒ R ≡ R′

(R′ is obtained from R by replacing occurrences of P by Q)

An axiomatization using Birkhoff’s rules only is orthodox.

Clearly, these rules preserve validity.

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (33/59)

Page 114: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q1: Why Birkhoff Calculus?

Before we proceed, you may have two questions:

DefinitionWhat is so great about this derivation system? Is it . . .

. . . the definition itself?Should feel straightforward and natural,not surprising and counterintuitive

. . . the avalanche of results it triggered off?Theory of varieties developed since the 1930’s: semigroups andgroups, semirings, semilattices, lattices and residuated lattices,boolean algebras, abstract relation and cylindric algebras . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (34/59)

Page 115: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q1: Why Birkhoff Calculus?

Before we proceed, you may have two questions:

DefinitionWhat is so great about this derivation system? Is it . . .

. . . the definition itself?Should feel straightforward and natural,not surprising and counterintuitive

. . . the avalanche of results it triggered off?Theory of varieties developed since the 1930’s: semigroups andgroups, semirings, semilattices, lattices and residuated lattices,boolean algebras, abstract relation and cylindric algebras . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (34/59)

Page 116: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q1: Why Birkhoff Calculus?

Before we proceed, you may have two questions:

DefinitionWhat is so great about this derivation system? Is it . . .

. . . the definition itself?

Should feel straightforward and natural,not surprising and counterintuitive

. . . the avalanche of results it triggered off?Theory of varieties developed since the 1930’s: semigroups andgroups, semirings, semilattices, lattices and residuated lattices,boolean algebras, abstract relation and cylindric algebras . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (34/59)

Page 117: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q1: Why Birkhoff Calculus?

Before we proceed, you may have two questions:

DefinitionWhat is so great about this derivation system? Is it . . .

. . . the definition itself?Should feel straightforward and natural,not surprising and counterintuitive

. . . the avalanche of results it triggered off?Theory of varieties developed since the 1930’s: semigroups andgroups, semirings, semilattices, lattices and residuated lattices,boolean algebras, abstract relation and cylindric algebras . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (34/59)

Page 118: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q1: Why Birkhoff Calculus?

Before we proceed, you may have two questions:

DefinitionWhat is so great about this derivation system? Is it . . .

. . . the definition itself?Should feel straightforward and natural,not surprising and counterintuitive

. . . the avalanche of results it triggered off?

Theory of varieties developed since the 1930’s: semigroups andgroups, semirings, semilattices, lattices and residuated lattices,boolean algebras, abstract relation and cylindric algebras . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (34/59)

Page 119: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q1: Why Birkhoff Calculus?

Before we proceed, you may have two questions:

DefinitionWhat is so great about this derivation system? Is it . . .

. . . the definition itself?Should feel straightforward and natural,not surprising and counterintuitive

. . . the avalanche of results it triggered off?Theory of varieties developed since the 1930’s: semigroups andgroups, semirings, semilattices, lattices and residuated lattices,boolean algebras, abstract relation and cylindric algebras . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (34/59)

Page 120: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q1 cntnd: But What Use Are They For Us?

An orthodox axiomatization≡

An elegant, self-contained equational rewrite system(no need to break equational reasoning with intermediate lemmas)

Almost all axiomatizations presented today will be orthodox(you’re going to see one exception at the end of the talk and dislike it)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (35/59)

Page 121: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q1 cntnd: But What Use Are They For Us?

An orthodox axiomatization≡

An elegant, self-contained equational rewrite system(no need to break equational reasoning with intermediate lemmas)

Almost all axiomatizations presented today will be orthodox(you’re going to see one exception at the end of the talk and dislike it)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (35/59)

Page 122: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q1 cntnd: But What Use Are They For Us?

An orthodox axiomatization≡

An elegant, self-contained equational rewrite system(no need to break equational reasoning with intermediate lemmas)

Almost all axiomatizations presented today will be orthodox(you’re going to see one exception at the end of the talk and dislike it)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (35/59)

Page 123: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q2: Anything Special about XPath?

QuestionHow about complete axiomatizations for SQL-like languages?

After all, there has been nothing XML specific to what I said . . .

AnswerEven with no more than three attributes, you soon run intounaxiomatizability results! ( c©by logicians and algebraists)

Some database theorists got into problems not knowing about it . . .It does not mean you cannot find interesting axiomatizablefragments—they are rather small though

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (36/59)

Page 124: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q2: Anything Special about XPath?

QuestionHow about complete axiomatizations for SQL-like languages?

After all, there has been nothing XML specific to what I said . . .

AnswerEven with no more than three attributes, you soon run intounaxiomatizability results! ( c©by logicians and algebraists)

Some database theorists got into problems not knowing about it . . .

It does not mean you cannot find interesting axiomatizablefragments—they are rather small though

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (36/59)

Page 125: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q2: Anything Special about XPath?

QuestionHow about complete axiomatizations for SQL-like languages?

After all, there has been nothing XML specific to what I said . . .

AnswerEven with no more than three attributes, you soon run intounaxiomatizability results! ( c©by logicians and algebraists)

Some database theorists got into problems not knowing about it . . .It does not mean you cannot find interesting axiomatizablefragments—they are rather small though

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (36/59)

Page 126: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q2 cntd: Is XPath Querying Any Better Off, Then?

Short AnswerYes.

Long AnswerYes, precisely because

we can isolate the navigational core . . .(would not make much sense in the relational context)

. . . and this core is related towell-behaved, axiomatizable formalisms:

Node expressions—to modal logicPath expressions—to idempotent (antidomain) semiringsThe duality of path and node expressions:resembles (fragments of) the logic of programs (PDL)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (37/59)

Page 127: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q2 cntd: Is XPath Querying Any Better Off, Then?

Short AnswerYes.

Long AnswerYes, precisely because

we can isolate the navigational core . . .(would not make much sense in the relational context)

. . . and this core is related towell-behaved, axiomatizable formalisms:

Node expressions—to modal logicPath expressions—to idempotent (antidomain) semiringsThe duality of path and node expressions:resembles (fragments of) the logic of programs (PDL)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (37/59)

Page 128: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q2 cntd: Is XPath Querying Any Better Off, Then?

Short AnswerYes.

Long AnswerYes, precisely because

we can isolate the navigational core . . .(would not make much sense in the relational context)

. . . and this core is related towell-behaved, axiomatizable formalisms:

Node expressions—to modal logicPath expressions—to idempotent (antidomain) semiringsThe duality of path and node expressions:resembles (fragments of) the logic of programs (PDL)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (37/59)

Page 129: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q2 cntd: Is XPath Querying Any Better Off, Then?

Short AnswerYes.

Long AnswerYes, precisely because

we can isolate the navigational core . . .(would not make much sense in the relational context)

. . . and this core is related towell-behaved, axiomatizable formalisms:

Node expressions—to modal logic

Path expressions—to idempotent (antidomain) semiringsThe duality of path and node expressions:resembles (fragments of) the logic of programs (PDL)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (37/59)

Page 130: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q2 cntd: Is XPath Querying Any Better Off, Then?

Short AnswerYes.

Long AnswerYes, precisely because

we can isolate the navigational core . . .(would not make much sense in the relational context)

. . . and this core is related towell-behaved, axiomatizable formalisms:

Node expressions—to modal logicPath expressions—to idempotent (antidomain) semirings

The duality of path and node expressions:resembles (fragments of) the logic of programs (PDL)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (37/59)

Page 131: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q2 cntd: Is XPath Querying Any Better Off, Then?

Short AnswerYes.

Long AnswerYes, precisely because

we can isolate the navigational core . . .(would not make much sense in the relational context)

. . . and this core is related towell-behaved, axiomatizable formalisms:

Node expressions—to modal logicPath expressions—to idempotent (antidomain) semiringsThe duality of path and node expressions:resembles (fragments of) the logic of programs (PDL)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (37/59)

Page 132: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

An Axiomatization: What Is It Good For?Connection with Logic and AlgebraBirkhoff’s CalculusTwo Questions

Q2 cntd: Is XPath Querying Any Better Off, Then?

Short AnswerYes.

Long AnswerYes, precisely because

we can isolate the navigational core . . .(would not make much sense in the relational context)

. . . and this core is related towell-behaved, axiomatizable formalisms:

Node expressions—to modal logicPath expressions—to idempotent (antidomain) semiringsThe duality of path and node expressions:resembles (fragments of) the logic of programs (PDL)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (37/59)

Page 133: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Basic Axioms I: Idempotent Semirings

ISAx1 (A ∪ B) ∪ C ≡ A ∪ (B ∪ C)ISAx2 A ∪ B ≡ B ∪ AISAx3 A ∪ A ≡ AISAx4 A/(B/C) ≡ (A/B)/C

ISAx5{ ·/A ≡ AA/· ≡ A

ISAx6{ A/(B ∪ C) ≡ A/B ∪ A/C(A ∪ B)/C ≡ A/C ∪ B/C

ISAx7 ⊥ ⊆ A

Distributive lattices, Kleene algebras, Tarski’s relation algebras:they all have idempotent semiring reducts.

Idempotency is the axiom ISAx3.⊥ abbreviates · [¬〈·〉]

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (38/59)

Page 134: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Basic Axioms II: Predicate Axioms

PrAx1 A [¬〈B〉] /B ≡ ⊥PrAx2 A [φ ∨ ψ] ≡ A [φ] ∪ A [ψ]PrAx3 (A/B) [φ] ≡ A/B [φ]PrAx4 · [〈·〉] ≡ ·

In Tarski’s relation algebras and XPath 2.0,predicates can be defined away

Note that PrAx3 would not be validif we allowed unrestricted positional predicates

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (39/59)

Page 135: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Basic Axioms III: Node Axioms

NdAx1 φ ≡ ¬(¬φ ∨ ψ) ∨ ¬(¬φ ∨ ¬ψ)NdAx2 〈A ∪ B〉 ≡ 〈A〉 ∨ 〈B〉NdAx3 〈A/B〉 ≡ 〈A [〈B〉] 〉NdAx4 〈· [φ] 〉 ≡ φ

Note how little was needed to ensure booleanity!(by Huntington’s result from the 1930’s)

And NdAx2–NdAx4 just mimick PrAx2—PrAx4(redundancy: price to pay for two-sorted signature)

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (40/59)

Page 136: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Axioms in one-sorted signature

Recall all the two-sorted axioms for predicates andexpressions:

PrAx1 A [¬〈B〉] /B ≡ ⊥PrAx2 A [φ ∨ ψ] ≡ A [φ] ∪ A [ψ]PrAx3 (A/B) [φ] ≡ A/B [φ]PrAx4 · [〈·〉] ≡ ·

NdAx1 φ ≡ ¬(¬φ ∨ ψ) ∨ ¬(¬φ ∨ ¬ψ)NdAx2 〈A ∪ B〉 ≡ 〈A〉 ∨ 〈B〉NdAx3 〈A/B〉 ≡ 〈A [〈B〉] 〉NdAx4 〈· [φ] 〉 ≡ φ

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (41/59)

Page 137: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Axioms in one-sorted signature

Here is a one-sorted axiomatization for ∼ over idempotentsemi-ring axioms found by Hollenberg:

∼A/A ≡ ⊥∼∼A/A ≡ A∼(A/B)/A ≡ (∼(A/B)/A)/∼B∼(A ∪ B) ≡ ∼A/∼B∼A ∪ ∼B ≡ ∼∼(∼A ∪ ∼B)

We need to add one more axiom for tests:

?p ≡ ∼∼?p

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (41/59)

Page 138: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Now, you may have the feeling thatthere was nothing XPath-specific yet

But in fact there is a fragment for whichit is all there is:

Core XPath(↓), the child-axis-only fragment!

TheoremThe axioms presented so far are complete for all validequivalences of Core XPath(↓).

In order to find more interesting equivalences,we have to move to other fragments

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (42/59)

Page 139: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Now, you may have the feeling thatthere was nothing XPath-specific yet

But in fact there is a fragment for whichit is all there is:

Core XPath(↓), the child-axis-only fragment!

TheoremThe axioms presented so far are complete for all validequivalences of Core XPath(↓).

In order to find more interesting equivalences,we have to move to other fragments

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (42/59)

Page 140: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Now, you may have the feeling thatthere was nothing XPath-specific yet

But in fact there is a fragment for whichit is all there is:

Core XPath(↓), the child-axis-only fragment!

TheoremThe axioms presented so far are complete for all validequivalences of Core XPath(↓).

In order to find more interesting equivalences,we have to move to other fragments

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (42/59)

Page 141: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Now, you may have the feeling thatthere was nothing XPath-specific yet

But in fact there is a fragment for whichit is all there is:

Core XPath(↓), the child-axis-only fragment!

TheoremThe axioms presented so far are complete for all validequivalences of Core XPath(↓).

In order to find more interesting equivalences,we have to move to other fragments

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (42/59)

Page 142: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Axioms for Linear Axes

The non-transitive case:

LinAx1 s [¬φ] ≡ · [¬〈s [φ] 〉] /s for s ∈ {→,←, ↑}

This forces functionality of the corresponding axis

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (43/59)

Page 143: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Axioms for Transitive Axes

One for node expressions, one for path expressions:

TransAx1 〈s+ [φ] 〉 ≡ 〈s+ [φ ∧ ¬〈s+ [φ] 〉] 〉TransAx2 s+ ≡ s+ ∪ s+/s+

The first one is called the Löb axiom and forces well-foundednessDon’t get modal logicians started on it—people wrote books about this formula

In particular, all the consequences of TransAx2 for node expressionscan be already derived from TransAx1

I can neither prove nor disprove that for path expressionsTransAx2 is (ir-)redundant

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (44/59)

Page 144: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Finally, Axes which Are Both Transitive and Linear

LinAx2 · [〈s+ [φ] 〉] /s+ ≡ s+ [φ] ∪ s+ [φ] /s+ ∪ s+ [〈s+ [φ] 〉]for s ∈ {→,←, ↑}

together with transitivity axioms

This forces the corresponding axis is a linear order

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (45/59)

Page 145: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Single Axis Completeness Result

Theorem

Base axioms are completefor Core XPath(↓)

Base axioms with LinAx1 are completefor other intransitive single axis fragments

Base axioms with TransAx1 and TransAx2 are completefor Core XPath(↓+)

Base axioms with TransAx1, TransAx2 and LinAx2 are completefor other transitive single axis fragments

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (46/59)

Page 146: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

A Few Words About Proofs

First, rewrite node expressions to simple node expressions:

siNode ::= 〈·〉 | p | 〈a [siNode] 〉 | ¬siNode | siNode∨siNode

They are isomorphic variants of modal formulasUsing normal form theorems for modal logic, we provide acompleteness proof for node expressions

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (47/59)

Page 147: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

A Few Words About Proofs

First, rewrite node expressions to simple node expressions:

siNode ::= 〈·〉 | p | 〈a [siNode] 〉 | ¬siNode | siNode∨siNode

They are isomorphic variants of modal formulas

Using normal form theorems for modal logic, we provide acompleteness proof for node expressions

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (47/59)

Page 148: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

A Few Words About Proofs

First, rewrite node expressions to simple node expressions:

siNode ::= 〈·〉 | p | 〈a [siNode] 〉 | ¬siNode | siNode∨siNode

They are isomorphic variants of modal formulasUsing normal form theorems for modal logic, we provide acompleteness proof for node expressions

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (47/59)

Page 149: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

A Few Words About Proofs cntd.

Then we rewrite all path expressions as sums of sum-freeexpressions of the form

S = · [β1] /a [β2] / . . . /a [β`] ,

(all βi are normal forms of

the same nesting degree in case of transitive axesstrictly decreasing degree for intransitive axes)

In case of linear axes, we can even guarantee that every formulais witnessed further down the chain

We prove that for every two such expressions either

one is a subsequence of the other—provably contained orthere is a countermodel for containment

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (48/59)

Page 150: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

A Few Words About Proofs cntd.

Then we rewrite all path expressions as sums of sum-freeexpressions of the form

S = · [β1] /a [β2] / . . . /a [β`] ,

(all βi are normal forms of

the same nesting degree in case of transitive axesstrictly decreasing degree for intransitive axes)

In case of linear axes, we can even guarantee that every formulais witnessed further down the chain

We prove that for every two such expressions either

one is a subsequence of the other—provably contained orthere is a countermodel for containment

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (48/59)

Page 151: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

A Few Words About Proofs cntd.

Then we rewrite all path expressions as sums of sum-freeexpressions of the form

S = · [β1] /a [β2] / . . . /a [β`] ,

(all βi are normal forms of

the same nesting degree in case of transitive axesstrictly decreasing degree for intransitive axes)

In case of linear axes, we can even guarantee that every formulais witnessed further down the chain

We prove that for every two such expressions either

one is a subsequence of the other—provably contained or

there is a countermodel for containment

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (48/59)

Page 152: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

A Few Words About Proofs cntd.

Then we rewrite all path expressions as sums of sum-freeexpressions of the form

S = · [β1] /a [β2] / . . . /a [β`] ,

(all βi are normal forms of

the same nesting degree in case of transitive axesstrictly decreasing degree for intransitive axes)

In case of linear axes, we can even guarantee that every formulais witnessed further down the chain

We prove that for every two such expressions either

one is a subsequence of the other—provably contained orthere is a countermodel for containment

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (48/59)

Page 153: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Aside: the issue of labels

There is a fact about XML trees we did not take into account(unless we opt to render attribute-value pairs as additional labels)

The labels are disjoint!

However, this is easy to fix: add node axiom

p ∧ q ≡ ⊥

for distinct p and qThis axiom itself is not substitution-invariant,this is why we do not like itBut as our proofs used only Birkhoff’s rulesthey are quite flexible and adding this axiom does not hurt

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (49/59)

Page 154: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Aside: the issue of labels

There is a fact about XML trees we did not take into account(unless we opt to render attribute-value pairs as additional labels)

The labels are disjoint!

However, this is easy to fix: add node axiom

p ∧ q ≡ ⊥

for distinct p and qThis axiom itself is not substitution-invariant,this is why we do not like itBut as our proofs used only Birkhoff’s rulesthey are quite flexible and adding this axiom does not hurt

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (49/59)

Page 155: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Aside: the issue of labels

There is a fact about XML trees we did not take into account(unless we opt to render attribute-value pairs as additional labels)

The labels are disjoint!

However, this is easy to fix: add node axiom

p ∧ q ≡ ⊥

for distinct p and qThis axiom itself is not substitution-invariant,this is why we do not like it

But as our proofs used only Birkhoff’s rulesthey are quite flexible and adding this axiom does not hurt

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (49/59)

Page 156: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Aside: the issue of labels

There is a fact about XML trees we did not take into account(unless we opt to render attribute-value pairs as additional labels)

The labels are disjoint!

However, this is easy to fix: add node axiom

p ∧ q ≡ ⊥

for distinct p and qThis axiom itself is not substitution-invariant,this is why we do not like itBut as our proofs used only Birkhoff’s rulesthey are quite flexible and adding this axiom does not hurt

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (49/59)

Page 157: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Starting from the Other End

Instead of beginning with single axesand then trying to combine two or more

LET’S GO FOR THE WHOLE CORE XPATH!

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (50/59)

Page 158: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Starting from the Other End

Instead of beginning with single axesand then trying to combine two or more

LET’S GO FOR THE WHOLE CORE XPATH!

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (50/59)

Page 159: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

Axiom For Axes Dependencies

TreeAx1{ s+/s ∪ s ≡ s+

s/s+ ∪ s ≡ s+

TreeAx2 s [φ] /s^ ≡ · [〈s [φ] 〉] ( for s distinct than ↑)TreeAx3 ↑ [φ] /↓ ≡ (←+ ∪→+ ∪ ·) [〈↑ [φ] 〉]

TreeAx4 { ←+ ≡ ←+ [〈↑〉]→+ ≡ →+ [〈↑〉]

TreeAx1 says: s+ is a transitive closure of sTreeAx2 says non-child axes are functional

and describes their converseTreeAx3 forces ↑ is the converse of (non-functional) ↓

with TreeAx4, it also describes how horizontal and vertical axesinterplay

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (51/59)

Page 160: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

TheoremThe axioms presented so far are complete for

Core XPath node expressions

Proof.By reduction to simple node expressionsand derivation of all axioms of modal logic of finite treesby Blackburn, Meyer-Viol, de Rijke

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (52/59)

Page 161: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

TheoremThe axioms presented so far are complete for

Core XPath node expressions

Proof.By reduction to simple node expressionsand derivation of all axioms of modal logic of finite treesby Blackburn, Meyer-Viol, de Rijke

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (52/59)

Page 162: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

(boolean axioms)〈s [¬〈·〉] 〉 ≡ ¬〈·〉〈s [φ ∨ ψ] 〉 ≡ 〈s [φ] 〉 ∨ 〈s [ψ] 〉φ ≤ ¬〈s [¬〈s^ [φ] 〉] 〉〈s [¬φ] 〉 ∧ 〈s [φ] 〉 ≡ ¬〈·〉( for s distinct than ↑)〈s [φ] 〉 ∨ 〈s [〈s+ [φ] 〉] 〉 ≡ 〈s+ [φ] 〉¬〈s [φ] 〉 ∧ 〈s+ [φ] 〉 ≤ 〈s+ [¬φ ∧ 〈s [φ] 〉] 〉〈s [〈·〉] 〉 ≤ 〈s+ [¬〈s [〈·〉] 〉] 〉TransAx1 for ↓+ and→+

〈↓ [¬〈←〉 ∧ ¬〈→∗ [φ] 〉] 〉 ≤ ¬〈↓ [φ] 〉〈↓ [φ] 〉 ≤ 〈↓ [¬〈←〉] 〉 ∧ 〈↓ [¬〈→〉] 〉¬〈↑〉 ≤ ¬〈←〉 ∧ ¬〈→〉

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (53/59)

Page 163: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

A Nasty Trick

We can use this to providean axiomatization for path expressions . . .

. . . of a sort—a non-orthodox one!Add the separability rule:

(Sep) IF 〈A [p] 〉 ≡ 〈B [p] 〉 for p not occurring in A,B

THEN A ≡ B.

Except for spoiling the whole equational story,it does not sit too well with the labelling axiom . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (54/59)

Page 164: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

A Nasty Trick

We can use this to providean axiomatization for path expressions . . .

. . . of a sort—a non-orthodox one!Add the separability rule:

(Sep) IF 〈A [p] 〉 ≡ 〈B [p] 〉 for p not occurring in A,B

THEN A ≡ B.

Except for spoiling the whole equational story,it does not sit too well with the labelling axiom . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (54/59)

Page 165: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

A Nasty Trick

We can use this to providean axiomatization for path expressions . . .

. . . of a sort—a non-orthodox one!

Add the separability rule:

(Sep) IF 〈A [p] 〉 ≡ 〈B [p] 〉 for p not occurring in A,B

THEN A ≡ B.

Except for spoiling the whole equational story,it does not sit too well with the labelling axiom . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (54/59)

Page 166: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

A Nasty Trick

We can use this to providean axiomatization for path expressions . . .

. . . of a sort—a non-orthodox one!Add the separability rule:

(Sep) IF 〈A [p] 〉 ≡ 〈B [p] 〉 for p not occurring in A,B

THEN A ≡ B.

Except for spoiling the whole equational story,it does not sit too well with the labelling axiom . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (54/59)

Page 167: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Basic AxiomsAxioms for Axes which are Linear and/or TransitiveFull Core XPath—Node ExpressionsFull Core XPath—Path Expressions

A Nasty Trick

We can use this to providean axiomatization for path expressions . . .

. . . of a sort—a non-orthodox one!Add the separability rule:

(Sep) IF 〈A [p] 〉 ≡ 〈B [p] 〉 for p not occurring in A,B

THEN A ≡ B.

Except for spoiling the whole equational story,it does not sit too well with the labelling axiom . . .

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (54/59)

Page 168: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

The Nasty Trick Does Its Job

. . . but it’s perfect for obtaining complexity resultsfor query equivalence problem

by using reductions to corresponding modal logics

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (55/59)

Page 169: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Complexity Theorem

Theorem

Query equivalence of Core XPath(→+,←+), Core XPath(↑+),Core XPath(s) (for s ∈ {↑,←,→}) is coNP-complete.

Query equivalence of Core XPath(←+,←,→+,→, ↑+, ↑) isPSPACE-complete.Thus, the PSPACE upper bound applies to all its sublanguages.

Query equivalence of Core XPath(↓) and Core XPath(↓+) isPSPACE-complete.Thus, all extensions of this fragment are PSPACE-hard.

Query equivalence of Core XPath(↓, ↓+) is EXPTIME-complete.Thus, all extensions of this fragment are EXPTIME-hard.

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (56/59)

Page 170: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Proofs

. . . by reductions to complexity results for modal logics like K,K4, Alt.1 and fragments of tense/temporal logic on linear and

branching orders.The most interesting one is for the second clause—somewhat

tricky embedding into a logic of Sistla and Clarke.

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (57/59)

Page 171: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Conclusions

We have seen:equational axiomatizations for path equivalences of alleight single axis fragments of Core XPath

equational axiomatizations for node equivalences of fullCore XPath 1.0non-orthodox axiomatization for path equivalences of fullCore XPath 1.0computational complexity results for path equivalences inmost meaningful sublanguages of Core XPath 1.0

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (58/59)

Page 172: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Conclusions

We have seen:equational axiomatizations for path equivalences of alleight single axis fragments of Core XPathequational axiomatizations for node equivalences of fullCore XPath 1.0

non-orthodox axiomatization for path equivalences of fullCore XPath 1.0computational complexity results for path equivalences inmost meaningful sublanguages of Core XPath 1.0

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (58/59)

Page 173: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Conclusions

We have seen:equational axiomatizations for path equivalences of alleight single axis fragments of Core XPathequational axiomatizations for node equivalences of fullCore XPath 1.0non-orthodox axiomatization for path equivalences of fullCore XPath 1.0

computational complexity results for path equivalences inmost meaningful sublanguages of Core XPath 1.0

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (58/59)

Page 174: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

Conclusions

We have seen:equational axiomatizations for path equivalences of alleight single axis fragments of Core XPathequational axiomatizations for node equivalences of fullCore XPath 1.0non-orthodox axiomatization for path equivalences of fullCore XPath 1.0computational complexity results for path equivalences inmost meaningful sublanguages of Core XPath 1.0

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (58/59)

Page 175: Queries, Modalities, Relations, Trees, XPath Lecture VI ... · Introduction Axioms, Logic and Algebra Axioms For Single Axes and Full Core XPath Complexity Queries, Modalities, Relations,

IntroductionAxioms, Logic and Algebra

Axioms For Single Axes and Full Core XPathComplexity

What we have not seen so far . . .

Definability and expressivity results (for finitesibling-ordered trees . . . )Results for fragments of XPath stronger than CoreXPath1.0

Both are discussed in Balder’s M4M slides

Tadeusz Litak Lecture VI: Harvest: CXPath 1.0 (59/59)