Since the development of Notation3 Logic, several years have
passed in which the theory has been refined and used in practice by different
reasoning engines such as cwm, FuXi or EYE. Nevertheless, a clear
model-theoretic definition of its semantics is still missing. This leaves
room for individual interpretations and renders it difficult to make clear
statements about its relation to other logics such as DL or FOL or even
about such basic concepts as correctness. In this paper we address one
of the main open challenges: the formalization of implicit quantification.
We point out how the interpretation of implicit quantifiers differs in
two of the above mentioned reasoning engines and how the specification,
proposed in the W3C team submission, could be formalized. Our formalization
is then put into context by integrating it into a model-theoretic
definition of the whole language. We finish our contribution by arguing
why universal quantification should be handled differently than currently
prescribed.
RuleML2015: Semantics of Notation3 Logic: A Solution for Implicit Quantification
1. 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
4. ELIS – Multimedia Lab
What is Notation3 Logic?
A rule logic for Semantic Web
4 / 26
5. ELIS – Multimedia Lab
What is Notation3 Logic?
A rule logic for Semantic Web
Invented by Tim Berners-Lee and Dan Connolly (∼2005)
4 / 26
6. ELIS – Multimedia Lab
What is Notation3 Logic?
A rule logic for Semantic Web
Invented by Tim Berners-Lee and Dan Connolly (∼2005)
Superset of RDF/Turtle
4 / 26
13. ELIS – Multimedia Lab
Syntax
Statements about formulas:
:Plato :says {:Socrates a Mortal.}.
6 / 26
14. ELIS – Multimedia Lab
Syntax
Statements about formulas:
:Plato :says {:Socrates a Mortal.}.
Use of (quantified) variables:
6 / 26
15. ELIS – Multimedia Lab
Syntax
Statements about formulas:
:Plato :says {:Socrates a Mortal.}.
Use of (quantified) variables:
:Plato :knows _:x. _:x a :Man.
6 / 26
16. ELIS – Multimedia Lab
Syntax
Statements about formulas:
:Plato :says {:Socrates a Mortal.}.
Use of (quantified) variables:
:Plato :knows _:x. _:x a :Man.
{?x a :Man.}=>{?x a :Mortal.}.
6 / 26
17. ELIS – Multimedia Lab
What about Semantics?
The formal semantics of N3 is not formally defined
7 / 26
18. ELIS – Multimedia Lab
What about Semantics?
The formal semantics of N3 is not formally defined(yet)
7 / 26
19. ELIS – Multimedia Lab
What about Semantics?
The formal semantics of N3 is not formally defined(yet)
Some implementations even differ!
7 / 26
20. ELIS – Multimedia Lab
What about Semantics?
The formal semantics of N3 is not formally defined(yet)
Some implementations even differ!
But:
7 / 26
21. ELIS – Multimedia Lab
What about Semantics?
The formal semantics of N3 is not formally defined(yet)
Some implementations even differ!
But:
Documents like the W3C Team Submission describe the desired
semantics
7 / 26
22. ELIS – Multimedia Lab
What about Semantics?
The formal semantics of N3 is not formally defined(yet)
Some implementations even differ!
But:
Documents like the W3C Team Submission describe the desired
semantics
Implementations such as reasoners can also be helpful.
In particular:
7 / 26
23. ELIS – Multimedia Lab
What about Semantics?
The formal semantics of N3 is not formally defined(yet)
Some implementations even differ!
But:
Documents like the W3C Team Submission describe the desired
semantics
Implementations such as reasoners can also be helpful.
In particular:
Cwm
7 / 26
24. ELIS – Multimedia Lab
What about Semantics?
The formal semantics of N3 is not formally defined(yet)
Some implementations even differ!
But:
Documents like the W3C Team Submission describe the desired
semantics
Implementations such as reasoners can also be helpful.
In particular:
Cwm
EYE
7 / 26
25. ELIS – Multimedia Lab
What about Semantics?
The formal semantics of N3 is not formally defined(yet)
Some implementations even differ!
But:
Documents like the W3C Team Submission describe the desired
semantics
Implementations such as reasoners can also be helpful.
In particular:
Cwm
EYE
We use all these as sources to define N3’s formal semantics
7 / 26
27. ELIS – Multimedia Lab
What is implicit quantification?
In N3 quantified variables can be expressed without explicitly stating
the quantifier
9 / 26
28. ELIS – Multimedia Lab
What is implicit quantification?
In N3 quantified variables can be expressed without explicitly stating
the quantifier
Blank nodes _:x are existentially quantified variables
9 / 26
29. ELIS – Multimedia Lab
What is implicit quantification?
In N3 quantified variables can be expressed without explicitly stating
the quantifier
Blank nodes _:x are existentially quantified variables
Variables beginning with a question mark ?x are universally
quantified
9 / 26
30. ELIS – Multimedia Lab
What is implicit quantification?
In N3 quantified variables can be expressed without explicitly stating
the quantifier
Blank nodes _:x are existentially quantified variables
Variables beginning with a question mark ?x are universally
quantified
But: What is the scope?
9 / 26
37. ELIS – Multimedia Lab
Both types of variables
?x :loves _:y.
∀x∃y : loves(x, y)
"Everybody loves
someone."
or
∃y∀x : loves(x, y)
"There is someone who
is loved by everyone."
11 / 26
38. ELIS – Multimedia Lab
Both types of variables
?x :loves _:y.
∀x∃y : loves(x, y)
"Everybody loves
someone."
or
∃y∀x : loves(x, y)
"There is someone who
is loved by everyone."
11 / 26
39. ELIS – Multimedia Lab
Both types of variables
“If both universal and existential quantification are specified for
the 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
41. ELIS – Multimedia Lab
Existentials
_:x :says {_:x a :Mortal}.
∃x : says(x, Mortal(x))
There is someone who
says about himself that he
is mortal.
13 / 26
42. ELIS – Multimedia Lab
Existentials
_:x :says {_:x a :Mortal}.
∃x : says(x, Mortal(x))
There is someone who
says about himself that he
is mortal.
or ∃x1 : says(x, (∃x2 : Mortal(x2)))
There is someone who
says that someone is
mortal.
13 / 26
43. ELIS – Multimedia Lab
Existentials
_:x :says {_:x a :Mortal}.
∃x : says(x, Mortal(x))
There is someone who
says about himself that he
is mortal.
or ∃x1 : says(x, (∃x2 : Mortal(x2)))
There is someone who
says that someone is
mortal.
13 / 26
44. ELIS – Multimedia Lab
Existentials
“When formulae are nested, _: blank nodes syntax [is] used to only
identify blank node in the formula it occurs directly in. It is
an arbitrary temporary name for a symbol which is existentially
quantified within the current formula (not the whole file). They can
only be used within a single formula, and not within nested
formulae.”
Source: W3C Team submission; cwm and EYE give the same result.
14 / 26
50. ELIS – Multimedia Lab
Universals
The team submission states:
“Apart from the set of statements, a formula also has a set of URIs
of symbols which are universally quantified, and a set of URIs of
symbols which are existentially quantified. Variables are then in
general symbols which have been quantified. There is a also a
shorthand syntax ?x which is the same as :x except that it implies
that x is universally quantified not in the formula but in its
parent formula.”
17 / 26
52. ELIS – Multimedia Lab
Universals
Which is the parent?
:Plato :says { :Socrates a Mortal.
Formula
}.
Parent formula
18 / 26
53. 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
54. ELIS – Multimedia Lab
Universals
But: Universal quantification also counts for descendants
19 / 26
55. ELIS – Multimedia Lab
Universals
But: Universal quantification also counts for descendants
{?x :p :a.}={ :s :q { ?x :r :b.
Formula
}.
Parent formula
}.
Grandparent formula
19 / 26
56. ELIS – Multimedia Lab
Universals
But: 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))
19 / 26
57. ELIS – Multimedia Lab
Universals
But: 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)))
19 / 26
58. ELIS – Multimedia Lab
Universals
But: 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
60. ELIS – Multimedia Lab
Handling variables
The scope of an existential variable is always only the
formula it occurs in, not its descendant
21 / 26
61. ELIS – Multimedia Lab
Handling variables
The scope of an existential variable is always only the
formula it occurs in, not its descendant
The scope of a universal variable depends on its context,
scoping is also valid on the descendants of a quantified
formula
21 / 26
62. ELIS – Multimedia Lab
Handling variables
The scope of an existential variable is always only the
formula it occurs in, not its descendant
The scope of a universal variable depends on its context,
scoping is also valid on the descendants of a quantified
formula
21 / 26
63. ELIS – Multimedia Lab
Handling variables
We define two ways to apply a substitution σ:
22 / 26
64. ELIS – Multimedia Lab
Handling variables
We define two ways to apply a substitution σ:
1. Component wise application σc: replace only direct
components of a formula
22 / 26
65. ELIS – Multimedia Lab
Handling variables
We define two ways to apply a substitution σ:
1. Component wise application σc: replace only direct
components of a formula
2. Total application σt: replace all direct components and
nested components
22 / 26
66. ELIS – Multimedia Lab
Handling variables
To cope with the behavior of universal quantification we define the
nesting level nf(?x) of a variable ?x in a formula f as the lowest
level, counted from above, where ?x can be found:
23 / 26
67. ELIS – Multimedia Lab
Handling variables
To cope with the behavior of universal quantification we define the
nesting level nf(?x) of a variable ?x in a formula f as the lowest
level, counted from above, where ?x can be found:
f = ?x :p :o.
23 / 26
68. ELIS – Multimedia Lab
Handling variables
To cope with the behavior of universal quantification we define the
nesting level nf(?x) of a variable ?x in a formula f as the lowest
level, counted from above, where ?x can be found:
f = ?x :p :o. → nf (?x) = 1
23 / 26
69. ELIS – Multimedia Lab
Handling variables
To cope with the behavior of universal quantification we define the
nesting level nf(?x) of a variable ?x in a formula f as the lowest
level, counted from above, where ?x can be found:
f = ?x :p :o. → nf (?x) = 1
f = ?x :p1 {?x :p2 :o2}.
23 / 26
70. ELIS – Multimedia Lab
Handling variables
To cope with the behavior of universal quantification we define the
nesting level nf(?x) of a variable ?x in a formula f as the lowest
level, counted from above, where ?x can be found:
f = ?x :p :o. → nf (?x) = 1
f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1
23 / 26
71. ELIS – Multimedia Lab
Handling variables
To cope with the behavior of universal quantification we define the
nesting level nf(?x) of a variable ?x in a formula f as the lowest
level, counted from above, where ?x can be found:
f = ?x :p :o. → nf (?x) = 1
f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1
f = ?y :p1 {?x :p2 :o2}.
23 / 26
72. ELIS – Multimedia Lab
Handling variables
To cope with the behavior of universal quantification we define the
nesting level nf(?x) of a variable ?x in a formula f as the lowest
level, counted from above, where ?x can be found:
f = ?x :p :o. → nf (?x) = 1
f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1
f = ?y :p1 {?x :p2 :o2}. → nf (?x) = 2
23 / 26
73. ELIS – Multimedia Lab
Handling variables
To cope with the behavior of universal quantification we define the
nesting level nf(?x) of a variable ?x in a formula f as the lowest
level, counted from above, where ?x can be found:
f = ?x :p :o. → nf (?x) = 1
f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1
f = ?y :p1 {?x :p2 :o2}. → nf (?x) = 2
f = ?y :p1 {?y :p2 {?x :p3 :o3}}.
23 / 26
74. ELIS – Multimedia Lab
Handling variables
To cope with the behavior of universal quantification we define the
nesting level nf(?x) of a variable ?x in a formula f as the lowest
level, counted from above, where ?x can be found:
f = ?x :p :o. → nf (?x) = 1
f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1
f = ?y :p1 {?x :p2 :o2}. → nf (?x) = 2
f = ?y :p1 {?y :p2 {?x :p3 :o3}}. → nf (?x) = 3
23 / 26
75. ELIS – Multimedia Lab
Handling variables
To cope with the behavior of universal quantification we define the
nesting level nf(?x) of a variable ?x in a formula f as the lowest
level, counted from above, where ?x can be found:
f = ?x :p :o. → nf (?x) = 1
f = ?x :p1 {?x :p2 :o2}. → nf (?x) = 1
f = ?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
76. ELIS – Multimedia Lab
N3 context
Our model definition is oriented on the RDF semantics with the
following additions:
24 / 26
77. ELIS – Multimedia Lab
N3 context
Our model definition is oriented on the RDF semantics with the
following additions:
Ground implications have the usual first order meaning
24 / 26
78. ELIS – Multimedia Lab
N3 context
Our model definition is oriented on the RDF semantics with the
following additions:
Ground implications have the usual first order meaning
Except if they occur in implications, graphs are handled as
simple URIs
24 / 26
79. ELIS – Multimedia Lab
N3 context
Our model definition is oriented on the RDF semantics with the
following additions:
Ground implications have the usual first order meaning
Except if they occur in implications, graphs are handled as
simple URIs
We add grounding steps for any formula f in the following
order:
24 / 26
80. ELIS – Multimedia Lab
N3 context
Our model definition is oriented on the RDF semantics with the
following additions:
Ground implications have the usual first order meaning
Except if they occur in implications, graphs are handled as
simple URIs
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.
24 / 26
81. ELIS – Multimedia Lab
N3 context
Our model definition is oriented on the RDF semantics with the
following additions:
Ground implications have the usual first order meaning
Except if they occur in implications, graphs are handled as
simple URIs
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
83. ELIS – Multimedia Lab
Conclusion
It is possible to define the semantics as in the team submission
26 / 26
84. ELIS – Multimedia Lab
Conclusion
It is possible to define the semantics as in the team submission
It is difficult and rather unusual to define the scope of
universals as it is proposed in the team submission
26 / 26
85. ELIS – Multimedia Lab
Conclusion
It is possible to define the semantics as in the team submission
It is difficult and rather unusual to define the scope of
universals as it is proposed in the team submission
Implicit universal quantification could be handled easier, for
example on formula level
26 / 26
86. ELIS – Multimedia Lab
Conclusion
It is possible to define the semantics as in the team submission
It is difficult and rather unusual to define the scope of
universals as it is proposed in the team submission
Implicit universal quantification could be handled easier, for
example on formula level
Let’s simplify this!
26 / 26