Title: Logics for Data and Knowledge Representation
1Logics for Data and KnowledgeRepresentation
Originally by Alessandro Agostini and Fausto
Giunchiglia Modified by Fausto Giunchiglia, Rui
Zhang and Vincenzo Maltese
2Outline
- Introduction contexts
- Syntax
- Semantics
- Local Models
- Contextual models
- Satisfiability, validity and contextual
entailment - Reasoning with beliefs and equivalence with modal
logic
2
3The notion of context
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- The notion of context is used in various areas
of AI, including data and knowledge
representation, NLP, and multimedia IR. However, - its meaning is frequently left to the user
- its use is implicit and intuitive
- its formalization is poor or missing
- No formal definition of context was given
3
4Example
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Today is nice
- What do we mean by nice?
- Which day is today?
- We cannot answer, as the proposition does not
have a precise meaning or context. - Therefore, we cannot say whether the proposition
is true or false.
4
5Example (McCarthy, 1987)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- The book is on the table
- Consider modeling the on preposition so as to
draw appropriate consequences from the
information expressed in the sentence - How many interpretations of it we can think?
- What is the right level of generality?
5
6Example (Tarski, 1931)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Snow is white
- Is this proposition true? What about the color of
the snow on top of Mount Etna in Sicily? - (Mount Etna is one of the most active volcanoes
in the world) - Tarski made explicit the context he used to
interpret it - I would only mention that ... I shall be
concerned exclusively with grasping the
intentions which are contained in the so-called
classical conception of truth. - (The first attempt to formalize a context)
6
7Summary
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- These examples show that
- even a very simple proposition requires the use
of some context to be interpreted - the notion of context is often unclear, undefined
or left implicit. - The first attempt to formalize a context as a way
to interpret (first-order) statements was
introduced by Tarski (1930-31).
7
8Definitions of context
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- From Webster dictionary
- A context surrounds, and gives meaning to,
something else - In linguistic
- It is the text surrounding a term in which the
term is used - In logic (Giunchiglia, 1993)
- that subset of the complete state of an
individual that is used for reasoning about a
given goal, e.g. to formulate a query.
8
9Subjective Perspective (I)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- The magic box (Giunchiglia Ghidini, 1998)
- Intuitively, a context is a theory of the world
which encodes (formally by using a logic called
contextual logic, CxL) an individuals subjective
perspective about the world. - In this example, two observer look at the same
phenomenon from two different perspectives.
9
10Subjective Perspective (II)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- The magic box (Giunchiglia Ghidini, 1998)
- The magic box represents a world with two
contexts, called the local models, that encode
Mr.1 and Mr. 2s subjective view of the
phenomenon.
10
11Syntax alphabet and languages
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Alphabet of symbols
- For every i?N, with N the set of contexts, we
define an alphabet Si for a contextual language
Li such that L Li i?N - Multi-Context Alphabet
- A multi-context alphabet is a set S ?i?I Si
with I ? N, where each Si is a first-order
alphabet enriched by some auxiliary symbols to
build contextual formulas - Family of languages
- From the multi-context alphabet S ?i?I Si we
define a family of languages L Li i?N - Each Li is the formal language used to state what
is true in the context I, and it is therefore
called a local language
11
12Syntax formation rules
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- First order formulas
- lttermgt ltvariablegt ltconstantgt ltfunction
symgt (lttermgt,lttermgt) - ltatomic formulagt ltpredicate symgt
(lttermgt,lttermgt) - lttermgt lttermgt
- ltwffgt ltatomic formulagt ltwffgt ltwffgt ?
ltwffgt ltwffgt ? ltwffgt - ltwffgt ? ltwffgt ? ltvariablegt ltwffgt ?
ltvariablegt ltwffgt - Contextual formulas
- ltcwffgt i ltwffgt for each i ? I (also called
i-formula or Li-formula) - Using contextual formulas we turn a
meta-theoretic object (the name i of a context)
into a theoretic object (an i-formula i ?) - A contextual formula is a kind of labeled formula
12
13Example
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Contextual Laws for ?, and ?
- i (A?B)? (A?B)
- i (A?B)?(A?B)
- Contextual Pierces law
- i ((A?B)?A)?A
- Contextual De Morgans laws i (A?B) ?
(A?B)i (A?B) ? (A?B)
13
14Contextual languages and theories
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Multi-context language
- The multi-context alphabet S and the formation
rules define a multi-context language L Li
i?I - Multi-context theory
- A set of closed wffs over L is a multi-context
theory - NOTE A first order theory T is a special case
of a contextual theory Ti where ? ? T iff i ? ?
Ti for any i ? I - A first-order theory Ti is called local theory
14
15Example
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- T1 1?x.apple(x)?Computer(x),1
apple(docPBG4pdf) -
- T2 2?x.apple(x)?Fruit(x),2?x.orange(x)?Frui
t(x),2 apple(docRdoc),2 apple(docGtxt) -
- Same terminology, different meaning.
1
2
15
16Example
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- T1 1?x.apple(x)?Computer(x),1 apple(doc1)
-
- T2 2?x.Mac(x)?Computer(x),2 Mac(doc1)
-
- Different terminology, same meaning.
1
2
16
17Local model semantics
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Local model semantics (LMS)
- Provide the meaning of the sentences and model
reasoning as logical consequence over a
multi-context language. LMS formalizes - Principle of Locality
- We never consider all we know, but rather a very
small subset of it - Modeling reasoning which uses only a subset of
what reasoners actually know about the world - The part being used while reasoning is what we
call a context, i.e., a local theory Ti - Principle of Compatibility
- There is compatibility among the kinds of
reasoning performed in different contexts
17
18Example viewpoints (I)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- The magic box (Giunchiglia Ghidini, 1998)
- Locality Mr. 1 and Mr. 2 do not have any
perception of the depth of the box
18
19Example viewpoints (II)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Compatibility there are some compatible
situations we can list
Compatible pairs can be described if Mr.1 sees
at least one ball then Mr.2 sees at least one
ball NOTE each of the configurations
depicted here is what we call a local model (see
next slides), i.e. one of the possible situations
in a context
19
20Example viewpoints (III)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Compatibility there are cases in which observers
cannot really distinguish among different
situations
In these cases we need a third view
20
21Viewpoints applications
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- An application where partial views matter is data
integration in federations of relational
databases - Each federated database can be represented as a
context - The federation of databases is a set of views of
an ideal (global) database which is impossible,
too complex or even not worth to reconstruct
completely
21
22Local models and compatibility sequences
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Given a family of languages L Li i?I
- Local model
- We denote with M(Li) the set of all models for Li
- An element m ? M(Li) is a local model
- Compatibility sequence
- A compatibility sequence for L is an infinite
sequence - c ltc0, c1, . . . , ci, . . . gt
- where ci is a subset of M(Li).
- NOTE For I 1,2, c is called a compatibility
pair
22
23Model and compatibility relation
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Intuitively, local models describe what is
locally true while compatibility sequences put
together local models which are mutually
compatible consistently with the situation we are
modeling
- A compatibility relation (for L) is a set C of
compatibility sequences. - A model (for L) is a non-empty compatibility
relation C such that the sequence ltØ, Ø, . . .gt
is not in C -
23
24Example viewpoints semantics (I)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Languages
- We need languages L1 and L2 describing the views
of Mr.1 and Mr.2. - With L1 we describe that a ball can be on the
left or on the right - With L2 we describe that a ball can be on the
left, in the center, or on the right. - No other constrains are specified
-
- L1 Bl ? Br
- L2 Bl ? Br ? Bc
24
25Example viewpoints semantics (II)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Local models
- We construct all the possible situations (models)
for L1 and L2 - This leads to the definition of four situations
(models) for L1 and eight situations (models)
for L2 - Compatibility pairs
- We construct all the compatibility pairs
- Compatibility relation
- The collection of all the compatibility pairs
25
26Formal definition of context
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Let model C ltc0, c1, . . . , ci, . . . gt be
given. - A context is any ci, i.e. the set of local models
m ? M(Li) allowed by C within any particular
compatibility sequence c in C - Given c, a context captures exactly locally true
facts given the constraints posed by the local
models of the other contexts in the same
compatibility sequence, as allowed by c
26
27Truth relation (satisfaction relation)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- The scope of the FO-logic truth relation is
extend - A model C satisfies an i-formula i ?
- C ? i ?
-
- if for all ltc0, c1, . . . , ci, . . .gt ? C and
for all m ? ci, m ? ? - C is a model of i ?
- i ? is true in C
27
28Satisfiability and validity
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- An Li-formula i ? is satisfied by a model C if
all the local models in each context ci satisfy
it - A model C satisfies a set of formulas G (C ? G )
if C satisfies every formula i ? in G - G is satisfiable if C ? i ? for some C and for
all i ? in G - i ? is valid (? i ? ) if C ? i ? for all C
28
29Contextual entailment
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- A set G of formulas entails a formula i ?
w.r.t. a model C - (i ? is a logical consequence of G w.r.t. C)
- G ?C i ?
- if for every compatibility sequence c ? C and
for all j?I with j?i, if cj ? Gj then for all m ?
ci, if m ? Gi then m ? ? - If G is empty then i ? is a tautology
- Intuitively, given a contextual model C, for any
c ? C - (1) distinguish between the local formulas Gi
and the others Gj - (2) throw away c if cj ? Gj, continue otherwise
- (3) throw away all the local models m ? ci that
m ? Gi - (4) the remaining models m ? ci locally satisfy ?
29
30Example the magic box
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- If Mr. 1 sees a ball on the left and Mr. 2 does
not see any ball on the right, then Mr. 2 sees a
ball on the left or in the center. - (1) In the premises, local conditions are in
blue, the others in red - (2) Throw away all the compatibility sequences
that do not satisfy the red condition - (3) Throw away all the local models that do not
satisfy the blue one - (4) Notice how the remaining local models for Mr.
2 satisfy the condition in green.
30
31Context logics reasoning with beliefs (I)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Consider two agents a and b. We can imagine that
each agent generates a different context
(different language, knowledge and reasoning
capabilities). What does a believe of b? (and
vice versa) - aa what a believes of a
- ab what a believes of b
- ba what b believes of a
-
-
i
i 1
31
32Context logics reasoning with beliefs (II)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- At each level we generate a different context
that we can link using some rules - Assume P ? Li and ? ? Li
- If P ? Li and Q ? Li then P ? Q ? Li
- If P ? Li then B(P) ? Li1 where B stands for
believes and is a modal operator - This generates a hierarchy of languages
- We can then generate for each path in the tree a
different compatibility sequence - When reasoning we add the following bridge
rules - i B(P) i1 P (Rdowni)
- i1 P i B(P) (Rupi)
32
33Equivalence Modal logics Context logics (I)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Bridge rules generate an accessibility relation
that has a direct translation in modal logic
where B(P) is translated as ?P. - RECALL In the canonical Kripke model K the
following schema is valid ?(P ? Q) ? (?P ? ?Q) - We need to prove that this property is true also
for context logic
33
34Equivalence Modal logics Context logics (II)
INTRODUCTION SYNTAX LOCAL MODELS
CONTEXTUAL MODELS SAT, VAL AND ENT BELIEFS
- Let us prove it for context logics with beliefs
B(P ? Q) ? (B(P) ? ?Q). - Let us assume both i B(P ? Q) and i B(P)
- i B(P) i B(P ? Q)
- ---------- (Rdowni) -------------- (Rdowni)
- i1 P i1 P ? Q
- -----------------------------------------------
----- (i1 P ?(?P ? Q) implies i1 Q) - i1 Q
- -----------------------------------------------
----- (Rupi) - i B(Q)
- -----------------------------------------------
----- (?i) - i B(P) ? B(Q)
- -----------------------------------------------
----- (?i) - i B(P ? Q) ? (B(P) ? B(Q))
34