ruleml2015: semantics of notation3 logic: a solution for implicit quantification

90
ELIS – Multimedia Lab Semantics of Notation3 Logic: A solution for implicit quantification Dörthe Arndt , Ruben Verborgh, Jos De Roo, Hong Sun, Erik Mannens, and Rik Van De Walle Multimedia Lab, Ghent University - iMinds, Belgium Agfa Healthcare - Ghent, Belgium RuleML 2015, Berlin, August 05, 2015 1 / 26

Upload: ruleml

Post on 18-Aug-2015

230 views

Category:

Science


2 download

TRANSCRIPT

Page 1: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Semantics of Notation3 Logic:A solution for implicit quantification

Dörthe Arndt, Ruben Verborgh, Jos De Roo, Hong Sun,Erik Mannens, and Rik Van De Walle

Multimedia Lab, Ghent University - iMinds, BelgiumAgfa Healthcare - Ghent, Belgium

RuleML 2015, Berlin, August 05, 2015

1 / 26

Page 2: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Outline

Notation3 Logic

Implicit Quantification

Formal Semantics

2 / 26

Page 3: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Notation3 Logic

Notation3 LogicWhat is Notation3 Logic?SyntaxSemantics

Implicit Quantification

Formal Semantics

3 / 26

Page 4: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What is Notation3 Logic?

I A rule logic for Semantic Web

I Invented by Tim Berners-Lee and Dan Connolly (∼2005)

I Superset of RDF/Turtle

4 / 26

Page 5: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What is Notation3 Logic?

I A rule logic for Semantic Web

I Invented by Tim Berners-Lee and Dan Connolly (∼2005)

I Superset of RDF/Turtle

4 / 26

Page 6: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What is Notation3 Logic?

I A rule logic for Semantic Web

I Invented by Tim Berners-Lee and Dan Connolly (∼2005)

I Superset of RDF/Turtle

4 / 26

Page 7: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Syntax

I Simple Turtle triples:

:Socrates a :Man.

I Rules:

{:Socrates a :Man.}

=> {:Socrates a :Mortal.}.

5 / 26

Page 8: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Syntax

I Simple Turtle triples:

:Socrates a :Man.

I Rules:

{:Socrates a :Man.}

=> {:Socrates a :Mortal.}.

5 / 26

Page 9: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Syntax

I Simple Turtle triples:

:Socrates a :Man.

I Rules:

{:Socrates a :Man.}

=> {:Socrates a :Mortal.}.

5 / 26

Page 10: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Syntax

I Simple Turtle triples:

:Socrates a :Man.

I Rules:

{:Socrates a :Man.}

=> {:Socrates a :Mortal.}.

5 / 26

Page 11: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Syntax

I Simple Turtle triples:

:Socrates a :Man.

I Rules:

{:Socrates a :Man.}

=> {:Socrates a :Mortal.}.

5 / 26

Page 12: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Syntax

I Statements about formulas:

:Plato :says {:Socrates a Mortal.}.

I Use of (quantified) variables:

:Plato :knows _:x. _:x a :Man.

{?x a :Man.}=>{?x a :Mortal.}.

6 / 26

Page 13: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Syntax

I Statements about formulas:

:Plato :says {:Socrates a Mortal.}.

I Use of (quantified) variables:

:Plato :knows _:x. _:x a :Man.

{?x a :Man.}=>{?x a :Mortal.}.

6 / 26

Page 14: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Syntax

I Statements about formulas:

:Plato :says {:Socrates a Mortal.}.

I Use of (quantified) variables:

:Plato :knows _:x. _:x a :Man.

{?x a :Man.}=>{?x a :Mortal.}.

6 / 26

Page 15: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Syntax

I Statements about formulas:

:Plato :says {:Socrates a Mortal.}.

I Use of (quantified) variables:

:Plato :knows _:x. _:x a :Man.

{?x a :Man.}=>{?x a :Mortal.}.

6 / 26

Page 16: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Syntax

I Statements about formulas:

:Plato :says {:Socrates a Mortal.}.

I Use of (quantified) variables:

:Plato :knows _:x. _:x a :Man.

{?x a :Man.}=>{?x a :Mortal.}.

6 / 26

Page 17: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What about Semantics?

I The formal semantics of N3 is not formally defined

(yet)I Some implementations even differ!I But:

I Documents like the W3C Team Submission describe the desiredsemantics

I Implementations such as reasoners can also be helpful.In particular:

I CwmI EYE

Ô We use all these as sources to define N3’s formal semantics

7 / 26

Page 18: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What about Semantics?

I The formal semantics of N3 is not formally defined(yet)

I Some implementations even differ!I But:

I Documents like the W3C Team Submission describe the desiredsemantics

I Implementations such as reasoners can also be helpful.In particular:

I CwmI EYE

Ô We use all these as sources to define N3’s formal semantics

7 / 26

Page 19: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What about Semantics?

I The formal semantics of N3 is not formally defined(yet)I Some implementations even differ!

I But:I Documents like the W3C Team Submission describe the desired

semanticsI Implementations such as reasoners can also be helpful.

In particular:I CwmI EYE

Ô We use all these as sources to define N3’s formal semantics

7 / 26

Page 20: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What about Semantics?

I The formal semantics of N3 is not formally defined(yet)I Some implementations even differ!I But:

I Documents like the W3C Team Submission describe the desiredsemantics

I Implementations such as reasoners can also be helpful.In particular:

I CwmI EYE

Ô We use all these as sources to define N3’s formal semantics

7 / 26

Page 21: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What about Semantics?

I The formal semantics of N3 is not formally defined(yet)I Some implementations even differ!I But:

I Documents like the W3C Team Submission describe the desiredsemantics

I Implementations such as reasoners can also be helpful.In particular:

I CwmI EYE

Ô We use all these as sources to define N3’s formal semantics

7 / 26

Page 22: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What about Semantics?

I The formal semantics of N3 is not formally defined(yet)I Some implementations even differ!I But:

I Documents like the W3C Team Submission describe the desiredsemantics

I Implementations such as reasoners can also be helpful.In particular:

I CwmI EYE

Ô We use all these as sources to define N3’s formal semantics

7 / 26

Page 23: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What about Semantics?

I The formal semantics of N3 is not formally defined(yet)I Some implementations even differ!I But:

I Documents like the W3C Team Submission describe the desiredsemantics

I Implementations such as reasoners can also be helpful.In particular:

I Cwm

I EYE

Ô We use all these as sources to define N3’s formal semantics

7 / 26

Page 24: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What about Semantics?

I The formal semantics of N3 is not formally defined(yet)I Some implementations even differ!I But:

I Documents like the W3C Team Submission describe the desiredsemantics

I Implementations such as reasoners can also be helpful.In particular:

I CwmI EYE

Ô We use all these as sources to define N3’s formal semantics

7 / 26

Page 25: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What about Semantics?

I The formal semantics of N3 is not formally defined(yet)I Some implementations even differ!I But:

I Documents like the W3C Team Submission describe the desiredsemantics

I Implementations such as reasoners can also be helpful.In particular:

I CwmI EYE

Ô We use all these as sources to define N3’s formal semantics

7 / 26

Page 26: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Implicit Quantification

Notation3 Logic

Implicit QuantificationExistentialsUniversals

Formal Semantics

8 / 26

Page 27: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What is implicit quantification?

In N3 quantified variables can be expressed without explicitly statingthe quantifier

I Blank nodes _:x are existentially quantified variablesI Variables beginning with a question mark ?x are universallyquantified

But: What is the scope?

9 / 26

Page 28: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What is implicit quantification?

In N3 quantified variables can be expressed without explicitly statingthe quantifier

I Blank nodes _:x are existentially quantified variables

I Variables beginning with a question mark ?x are universallyquantified

But: What is the scope?

9 / 26

Page 29: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What is implicit quantification?

In N3 quantified variables can be expressed without explicitly statingthe quantifier

I Blank nodes _:x are existentially quantified variablesI Variables beginning with a question mark ?x are universallyquantified

But: What is the scope?

9 / 26

Page 30: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

What is implicit quantification?

In N3 quantified variables can be expressed without explicitly statingthe quantifier

I Blank nodes _:x are existentially quantified variablesI Variables beginning with a question mark ?x are universallyquantified

But: What is the scope?

9 / 26

Page 31: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Simple Examples

_:x :knows :Socrates.

→ ∃x : knows(x , Socrates)?x :knows :Socrates. → ∀x : knows(x , Socrates)

10 / 26

Page 32: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Simple Examples

_:x :knows :Socrates. → ∃x : knows(x , Socrates)

?x :knows :Socrates. → ∀x : knows(x , Socrates)

10 / 26

Page 33: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Simple Examples

_:x :knows :Socrates. → ∃x : knows(x , Socrates)?x :knows :Socrates.

→ ∀x : knows(x , Socrates)

10 / 26

Page 34: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Simple Examples

_:x :knows :Socrates. → ∃x : knows(x , Socrates)?x :knows :Socrates. → ∀x : knows(x , Socrates)

10 / 26

Page 35: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Both types of variables

?x :loves _:y.

∀x∃y : loves(x , y)

"Everybody lovessomeone."

or ∃y∀x : loves(x , y)

"There is someone whois loved by everyone."3 7

11 / 26

Page 36: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Both types of variables

?x :loves _:y.

∀x∃y : loves(x , y)

"Everybody lovessomeone."

or ∃y∀x : loves(x , y)

"There is someone whois loved by everyone."3 7

11 / 26

Page 37: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Both types of variables

?x :loves _:y.

∀x∃y : loves(x , y)

"Everybody lovessomeone."

or ∃y∀x : loves(x , y)

"There is someone whois loved by everyone."

3 7

11 / 26

Page 38: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Both types of variables

?x :loves _:y.

∀x∃y : loves(x , y)

"Everybody lovessomeone."

or ∃y∀x : loves(x , y)

"There is someone whois loved by everyone."3 7

11 / 26

Page 39: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Both types of variables

“If both universal and existential quantification are specified forthe same formula, then the scope of the universal quantification

is outside the scope of the existentials”.

Source: W3C Team submission; cwm and EYE give the same result.

12 / 26

Page 40: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Existentials

_:x :says {_:x a :Mortal}.

∃x : says(x , Mortal(x))

"There is someone whosays about himself that he

is mortal."

or ∃x1 : says(x , (∃x2 : Mortal(x2)))

"There is someone whosays that someone is

mortal."7 3

13 / 26

Page 41: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Existentials

_:x :says {_:x a :Mortal}.

∃x : says(x , Mortal(x))

"There is someone whosays about himself that he

is mortal."

or ∃x1 : says(x , (∃x2 : Mortal(x2)))

"There is someone whosays that someone is

mortal."7 3

13 / 26

Page 42: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Existentials

_:x :says {_:x a :Mortal}.

∃x : says(x , Mortal(x))

"There is someone whosays about himself that he

is mortal."

or ∃x1 : says(x , (∃x2 : Mortal(x2)))

"There is someone whosays that someone is

mortal."

7 3

13 / 26

Page 43: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Existentials

_:x :says {_:x a :Mortal}.

∃x : says(x , Mortal(x))

"There is someone whosays about himself that he

is mortal."

or ∃x1 : says(x , (∃x2 : Mortal(x2)))

"There is someone whosays that someone is

mortal."7 313 / 26

Page 44: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Existentials

“When formulae are nested, _: blank nodes syntax [is] used to onlyidentify blank node in the formula it occurs directly in. It isan arbitrary temporary name for a symbol which is existentially

quantified within the current formula (not the whole file). They canonly be used within a single formula, and not within nested

formulae.”

Source: W3C Team submission; cwm and EYE give the same result.

14 / 26

Page 45: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Universals

{{?x :p :a.} => {?x :q :b.}.}

=>

{{?x :r :c.} => {?x :s :d.}.}.

(∀x1 : p(x1, a)→ q(x1, b))→(∀x2 : r(x2, c)→ s(x2, d)) or

∀x : ((p(x , a)→ q(x , b))→(r(x , c)→ s(x , d)))

Here the reasoning results differ!

EYECwm

15 / 26

Page 46: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Universals

{{?x :p :a.} => {?x :q :b.}.}

=>

{{?x :r :c.} => {?x :s :d.}.}.

(∀x1 : p(x1, a)→ q(x1, b))→(∀x2 : r(x2, c)→ s(x2, d))

or

∀x : ((p(x , a)→ q(x , b))→(r(x , c)→ s(x , d)))

Here the reasoning results differ!

EYECwm

15 / 26

Page 47: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Universals

{{?x :p :a.} => {?x :q :b.}.}

=>

{{?x :r :c.} => {?x :s :d.}.}.

(∀x1 : p(x1, a)→ q(x1, b))→(∀x2 : r(x2, c)→ s(x2, d)) or

∀x : ((p(x , a)→ q(x , b))→(r(x , c)→ s(x , d)))

Here the reasoning results differ!

EYECwm

15 / 26

Page 48: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Universals

{{?x :p :a.} => {?x :q :b.}.}

=>

{{?x :r :c.} => {?x :s :d.}.}.

(∀x1 : p(x1, a)→ q(x1, b))→(∀x2 : r(x2, c)→ s(x2, d)) or

∀x : ((p(x , a)→ q(x , b))→(r(x , c)→ s(x , d)))

Here the reasoning results differ!

EYECwm

15 / 26

Page 49: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Who is right?

16 / 26

Page 50: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

UniversalsThe team submission states:

“Apart from the set of statements, a formula also has a set of URIsof symbols which are universally quantified, and a set of URIs ofsymbols which are existentially quantified. Variables are then ingeneral symbols which have been quantified. There is a also a

shorthand syntax ?x which is the same as :x except that it impliesthat x is universally quantified not in the formula but in its

parent formula.”

17 / 26

Page 51: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Universals

Which is the parent?

:Plato :says { :Socrates a Mortal.︸ ︷︷ ︸Formula

}.

︸ ︷︷ ︸Parent formula

ÔThe parent formula p of a formula f is the formula containing {f }as a component.

18 / 26

Page 52: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Universals

Which is the parent?

:Plato :says { :Socrates a Mortal.︸ ︷︷ ︸Formula

}.

︸ ︷︷ ︸Parent formula

ÔThe parent formula p of a formula f is the formula containing {f }as a component.

18 / 26

Page 53: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Universals

Which is the parent?

:Plato :says { :Socrates a Mortal.︸ ︷︷ ︸Formula

}.

︸ ︷︷ ︸Parent formula

ÔThe parent formula p of a formula f is the formula containing {f }as a component.

18 / 26

Page 54: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

UniversalsBut: Universal quantification also counts for descendants

{?x :p :a.}=>{ :s :q { ?x :r :b.︸ ︷︷ ︸Formula

}.

︸ ︷︷ ︸Parent formula

}.

︸ ︷︷ ︸Grandparent formula

Is interpreted as:

∀x : p(x, a)→ q(s, r(x, b))

And not as

∀x1 : p(x1, a)→ (∀x2 : q(s, r(x2, b)))((((((((((((((((((hhhhhhhhhhhhhhhhhh

19 / 26

Page 55: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

UniversalsBut: Universal quantification also counts for descendants

{?x :p :a.}=>{ :s :q { ?x :r :b.︸ ︷︷ ︸Formula

}.

︸ ︷︷ ︸Parent formula

}.

︸ ︷︷ ︸Grandparent formula

Is interpreted as:

∀x : p(x, a)→ q(s, r(x, b))

And not as

∀x1 : p(x1, a)→ (∀x2 : q(s, r(x2, b)))((((((((((((((((((hhhhhhhhhhhhhhhhhh

19 / 26

Page 56: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

UniversalsBut: Universal quantification also counts for descendants

{?x :p :a.}=>{ :s :q { ?x :r :b.︸ ︷︷ ︸Formula

}.

︸ ︷︷ ︸Parent formula

}.

︸ ︷︷ ︸Grandparent formula

Is interpreted as:

∀x : p(x, a)→ q(s, r(x, b))

And not as

∀x1 : p(x1, a)→ (∀x2 : q(s, r(x2, b)))((((((((((((((((((hhhhhhhhhhhhhhhhhh

19 / 26

Page 57: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

UniversalsBut: Universal quantification also counts for descendants

{?x :p :a.}=>{ :s :q { ?x :r :b.︸ ︷︷ ︸Formula

}.

︸ ︷︷ ︸Parent formula

}.

︸ ︷︷ ︸Grandparent formula

Is interpreted as:

∀x : p(x, a)→ q(s, r(x, b))

And not as

∀x1 : p(x1, a)→ (∀x2 : q(s, r(x2, b)))

((((((((((((((((((hhhhhhhhhhhhhhhhhh

19 / 26

Page 58: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

UniversalsBut: Universal quantification also counts for descendants

{?x :p :a.}=>{ :s :q { ?x :r :b.︸ ︷︷ ︸Formula

}.

︸ ︷︷ ︸Parent formula

}.

︸ ︷︷ ︸Grandparent formula

Is interpreted as:

∀x : p(x, a)→ q(s, r(x, b))

And not as

∀x1 : p(x1, a)→ (∀x2 : q(s, r(x2, b)))((((((((((((((((((hhhhhhhhhhhhhhhhhh

19 / 26

Page 59: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Formal Semantics

Notation3 Logic

Implicit Quantification

Formal SemanticsHandling variablesN3 context

20 / 26

Page 60: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variables

I The scope of an existential variable is always only theformula it occurs in, not its descendant

I The scope of a universal variable depends on its context,scoping is also valid on the descendants of a quantifiedformula

21 / 26

Page 61: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variables

I The scope of an existential variable is always only theformula it occurs in, not its descendant

I The scope of a universal variable depends on its context,scoping is also valid on the descendants of a quantifiedformula

21 / 26

Page 62: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variables

I The scope of an existential variable is always only theformula it occurs in, not its descendant

I The scope of a universal variable depends on its context,scoping is also valid on the descendants of a quantifiedformula

21 / 26

Page 63: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variables

We define two ways to apply a substitution σ:

1. Component wise application σc : replace only directcomponents of a formula

2. Total application σt : replace all direct components andnested components

22 / 26

Page 64: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variables

We define two ways to apply a substitution σ:

1. Component wise application σc : replace only directcomponents of a formula

2. Total application σt : replace all direct components andnested components

22 / 26

Page 65: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variables

We define two ways to apply a substitution σ:

1. Component wise application σc : replace only directcomponents of a formula

2. Total application σt : replace all direct components andnested components

22 / 26

Page 66: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variablesTo cope with the behavior of universal quantification we define thenesting level nf(?x) of a variable ?x in a formula f as the lowestlevel, counted from above, where ?x can be found:

f = ?x :p :o. → nf (?x) = 1f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1f = ?y :p1 {?x :p2 :o2}. → nf (?x) = 2f = ?y :p1 {?y :p2 {?x :p3 :o3}}. → nf (?x) = 3

We call a universal variable accessible in a formula f iff

0 < nf(?x) ≤ 2

.

23 / 26

Page 67: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variablesTo cope with the behavior of universal quantification we define thenesting level nf(?x) of a variable ?x in a formula f as the lowestlevel, counted from above, where ?x can be found:

f = ?x :p :o.

→ nf (?x) = 1f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1f = ?y :p1 {?x :p2 :o2}. → nf (?x) = 2f = ?y :p1 {?y :p2 {?x :p3 :o3}}. → nf (?x) = 3

We call a universal variable accessible in a formula f iff

0 < nf(?x) ≤ 2

.

23 / 26

Page 68: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variablesTo cope with the behavior of universal quantification we define thenesting level nf(?x) of a variable ?x in a formula f as the lowestlevel, counted from above, where ?x can be found:

f = ?x :p :o. → nf (?x) = 1

f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1f = ?y :p1 {?x :p2 :o2}. → nf (?x) = 2f = ?y :p1 {?y :p2 {?x :p3 :o3}}. → nf (?x) = 3

We call a universal variable accessible in a formula f iff

0 < nf(?x) ≤ 2

.

23 / 26

Page 69: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variablesTo cope with the behavior of universal quantification we define thenesting level nf(?x) of a variable ?x in a formula f as the lowestlevel, counted from above, where ?x can be found:

f = ?x :p :o. → nf (?x) = 1f = ?x :p1 {?x :p2 :o2}.

→ nf (?x) = 1f = ?y :p1 {?x :p2 :o2}. → nf (?x) = 2f = ?y :p1 {?y :p2 {?x :p3 :o3}}. → nf (?x) = 3

We call a universal variable accessible in a formula f iff

0 < nf(?x) ≤ 2

.

23 / 26

Page 70: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variablesTo cope with the behavior of universal quantification we define thenesting level nf(?x) of a variable ?x in a formula f as the lowestlevel, counted from above, where ?x can be found:

f = ?x :p :o. → nf (?x) = 1f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1

f = ?y :p1 {?x :p2 :o2}. → nf (?x) = 2f = ?y :p1 {?y :p2 {?x :p3 :o3}}. → nf (?x) = 3

We call a universal variable accessible in a formula f iff

0 < nf(?x) ≤ 2

.

23 / 26

Page 71: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variablesTo cope with the behavior of universal quantification we define thenesting level nf(?x) of a variable ?x in a formula f as the lowestlevel, counted from above, where ?x can be found:

f = ?x :p :o. → nf (?x) = 1f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1f = ?y :p1 {?x :p2 :o2}.

→ nf (?x) = 2f = ?y :p1 {?y :p2 {?x :p3 :o3}}. → nf (?x) = 3

We call a universal variable accessible in a formula f iff

0 < nf(?x) ≤ 2

.

23 / 26

Page 72: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variablesTo cope with the behavior of universal quantification we define thenesting level nf(?x) of a variable ?x in a formula f as the lowestlevel, counted from above, where ?x can be found:

f = ?x :p :o. → nf (?x) = 1f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1f = ?y :p1 {?x :p2 :o2}. → nf (?x) = 2

f = ?y :p1 {?y :p2 {?x :p3 :o3}}. → nf (?x) = 3

We call a universal variable accessible in a formula f iff

0 < nf(?x) ≤ 2

.

23 / 26

Page 73: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variablesTo cope with the behavior of universal quantification we define thenesting level nf(?x) of a variable ?x in a formula f as the lowestlevel, counted from above, where ?x can be found:

f = ?x :p :o. → nf (?x) = 1f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1f = ?y :p1 {?x :p2 :o2}. → nf (?x) = 2f = ?y :p1 {?y :p2 {?x :p3 :o3}}.

→ nf (?x) = 3

We call a universal variable accessible in a formula f iff

0 < nf(?x) ≤ 2

.

23 / 26

Page 74: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variablesTo cope with the behavior of universal quantification we define thenesting level nf(?x) of a variable ?x in a formula f as the lowestlevel, counted from above, where ?x can be found:

f = ?x :p :o. → nf (?x) = 1f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1f = ?y :p1 {?x :p2 :o2}. → nf (?x) = 2f = ?y :p1 {?y :p2 {?x :p3 :o3}}. → nf (?x) = 3

We call a universal variable accessible in a formula f iff

0 < nf(?x) ≤ 2

.

23 / 26

Page 75: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Handling variablesTo cope with the behavior of universal quantification we define thenesting level nf(?x) of a variable ?x in a formula f as the lowestlevel, counted from above, where ?x can be found:

f = ?x :p :o. → nf (?x) = 1f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1f = ?y :p1 {?x :p2 :o2}. → nf (?x) = 2f = ?y :p1 {?y :p2 {?x :p3 :o3}}. → nf (?x) = 3

We call a universal variable accessible in a formula f iff

0 < nf(?x) ≤ 2

.23 / 26

Page 76: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

N3 context

Our model definition is oriented on the RDF semantics with thefollowing additions:

I Ground implications have the usual first order meaningI Except if they occur in implications, graphs are handled as

simple URIsI We add grounding steps for any formula f in the following

order:1. If f contains accessible universal variables, it is valid iff f σt is

valid for every ground substitution σ for those variables.2. If f contains existentials on top level it is valid iff there exists a

ground substitution σ for those variables such that f σc is valid.

24 / 26

Page 77: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

N3 context

Our model definition is oriented on the RDF semantics with thefollowing additions:

I Ground implications have the usual first order meaning

I Except if they occur in implications, graphs are handled assimple URIs

I We add grounding steps for any formula f in the followingorder:1. If f contains accessible universal variables, it is valid iff f σt is

valid for every ground substitution σ for those variables.2. If f contains existentials on top level it is valid iff there exists a

ground substitution σ for those variables such that f σc is valid.

24 / 26

Page 78: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

N3 context

Our model definition is oriented on the RDF semantics with thefollowing additions:

I Ground implications have the usual first order meaningI Except if they occur in implications, graphs are handled as

simple URIs

I We add grounding steps for any formula f in the followingorder:1. If f contains accessible universal variables, it is valid iff f σt is

valid for every ground substitution σ for those variables.2. If f contains existentials on top level it is valid iff there exists a

ground substitution σ for those variables such that f σc is valid.

24 / 26

Page 79: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

N3 context

Our model definition is oriented on the RDF semantics with thefollowing additions:

I Ground implications have the usual first order meaningI Except if they occur in implications, graphs are handled as

simple URIsI We add grounding steps for any formula f in the following

order:

1. If f contains accessible universal variables, it is valid iff f σt isvalid for every ground substitution σ for those variables.

2. If f contains existentials on top level it is valid iff there exists aground substitution σ for those variables such that f σc is valid.

24 / 26

Page 80: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

N3 context

Our model definition is oriented on the RDF semantics with thefollowing additions:

I Ground implications have the usual first order meaningI Except if they occur in implications, graphs are handled as

simple URIsI We add grounding steps for any formula f in the following

order:1. If f contains accessible universal variables, it is valid iff f σt is

valid for every ground substitution σ for those variables.

2. If f contains existentials on top level it is valid iff there exists aground substitution σ for those variables such that f σc is valid.

24 / 26

Page 81: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

N3 context

Our model definition is oriented on the RDF semantics with thefollowing additions:

I Ground implications have the usual first order meaningI Except if they occur in implications, graphs are handled as

simple URIsI We add grounding steps for any formula f in the following

order:1. If f contains accessible universal variables, it is valid iff f σt is

valid for every ground substitution σ for those variables.2. If f contains existentials on top level it is valid iff there exists a

ground substitution σ for those variables such that f σc is valid.

24 / 26

Page 82: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Notation3 Logic

Implicit Quantification

Formal Semantics

25 / 26

Page 83: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Conclusion

I It is possible to define the semantics as in the team submission

I It is difficult and rather unusual to define the scope ofuniversals as it is proposed in the team submission

I Implicit universal quantification could be handled easier, forexample on formula level

Let’s simplify this!

26 / 26

Page 84: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Conclusion

I It is possible to define the semantics as in the team submissionI It is difficult and rather unusual to define the scope of

universals as it is proposed in the team submission

I Implicit universal quantification could be handled easier, forexample on formula level

Let’s simplify this!

26 / 26

Page 85: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Conclusion

I It is possible to define the semantics as in the team submissionI It is difficult and rather unusual to define the scope of

universals as it is proposed in the team submissionI Implicit universal quantification could be handled easier, for

example on formula level

Let’s simplify this!

26 / 26

Page 86: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Conclusion

I It is possible to define the semantics as in the team submissionI It is difficult and rather unusual to define the scope of

universals as it is proposed in the team submissionI Implicit universal quantification could be handled easier, for

example on formula level

Let’s simplify this!

26 / 26

Page 87: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Example: Explicit quantification

@forAll <#x>. @forSome <#y>. <#x> <#loves> <#y> .

@forSome <#y>. @forAll <#x>. <#x> <#loves> <#y> .

Have the same meaning:

∀x∃y : loves(x , y).

27 / 26

Page 88: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Example: Explicit quantification

@forAll <#x>. @forSome <#y>. <#x> <#loves> <#y> .

@forSome <#y>. @forAll <#x>. <#x> <#loves> <#y> .

Have the same meaning:

∀x∃y : loves(x , y).

27 / 26

Page 89: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Example: Variable of not?

@forSome :y. :x :p :y. @forAll :x. :x:q :o.

Is the first :x quantified?

28 / 26

Page 90: RuleML2015:  Semantics of Notation3 Logic: A Solution for Implicit Quantification

ELIS – Multimedia Lab

Example: Variable of not?

@forSome :y. :x :p :y. @forAll :x. :x:q :o.

Is the first :x quantified?

28 / 26