An Introduction to Knowledge Representation and Nonmonotonic

An Introduction to
Knowledge Representation
and Nonmonotonic Reasoning
Pedro Cabalar
Depto. Computación
University of Corunna, SPAIN
June 29, 2010
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
1 / 123
Outline
1
Motivation and goals
2
Survey of NMR formalisms
Circumscription
Default Logic
Autoepistemic Logic
3
Answer Set Programming
Answer Set Programming
Diagnosis
Equilibrium Logic
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
2 / 123
Motivation and goals
A bit of history
P. Cabalar
What is Artificial Intelligence?
“It is the science and engineering of making intelligent
machines, especially intelligent computer programs”
[John McCarthy]
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
3 / 123
Motivation and goals
A bit of history
P. Cabalar
What is Artificial Intelligence?
“It is the science and engineering of making intelligent
machines, especially intelligent computer programs”
[John McCarthy]
Programs with Commonsense [McCarthy59] introduces the first AI
system: the Advice Taker.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
3 / 123
Motivation and goals
A bit of history
P. Cabalar
What is Artificial Intelligence?
“It is the science and engineering of making intelligent
machines, especially intelligent computer programs”
[John McCarthy]
Programs with Commonsense [McCarthy59] introduces the first AI
system: the Advice Taker.
Keypoint: make an explicit representation of the domain using
logical formulae.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
3 / 123
Motivation and goals
A bit of history
P. Cabalar
What is Artificial Intelligence?
“It is the science and engineering of making intelligent
machines, especially intelligent computer programs”
[John McCarthy]
Programs with Commonsense [McCarthy59] introduces the first AI
system: the Advice Taker.
Keypoint: make an explicit representation of the domain using
logical formulae. In McCarthy’s words:
“In order for a program to be capable of learning
something it must first be capable of being told it”
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
3 / 123
Motivation and goals
Reasoning about Actions and Change (RAC)
Thus, under this focusing, Knowledge Representation (KR) plays
a central role.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
4 / 123
Motivation and goals
Reasoning about Actions and Change (RAC)
Thus, under this focusing, Knowledge Representation (KR) plays
a central role.
Historically, one of the first challenging areas for KR has been
Reasoning about Actions and Change.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
4 / 123
Motivation and goals
Reasoning about Actions and Change (RAC)
Thus, under this focusing, Knowledge Representation (KR) plays
a central role.
Historically, one of the first challenging areas for KR has been
Reasoning about Actions and Change.
Some philosophical problems from the standpoint of Artificial
Intelligence [McCarthy & Hayes 69]
They introduce Situation Calculus = First Order Logic + 3 sorts:
1
P. Cabalar
Fluents: system properties whose values may vary along time.
These values configure the system state.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
4 / 123
Motivation and goals
Reasoning about Actions and Change (RAC)
Thus, under this focusing, Knowledge Representation (KR) plays
a central role.
Historically, one of the first challenging areas for KR has been
Reasoning about Actions and Change.
Some philosophical problems from the standpoint of Artificial
Intelligence [McCarthy & Hayes 69]
They introduce Situation Calculus = First Order Logic + 3 sorts:
P. Cabalar
1
Fluents: system properties whose values may vary along time.
These values configure the system state.
2
Actions: possible operations that allow a state transition.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
4 / 123
Motivation and goals
Reasoning about Actions and Change (RAC)
Thus, under this focusing, Knowledge Representation (KR) plays
a central role.
Historically, one of the first challenging areas for KR has been
Reasoning about Actions and Change.
Some philosophical problems from the standpoint of Artificial
Intelligence [McCarthy & Hayes 69]
They introduce Situation Calculus = First Order Logic + 3 sorts:
1
Fluents: system properties whose values may vary along time.
These values configure the system state.
2
Actions: possible operations that allow a state transition.
3
Situations: terms that identify a given instant. They have the form:
S0 - initial situation
Result(a, s) - situation after perfoming action a at situation s.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
4 / 123
Motivation and goals
RAC scenarios
Typically, (discrete) dynamic systems: state transitions.
A simple scenario: a lamp in a corridor with 3 switches.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
5 / 123
Motivation and goals
RAC scenarios
P. Cabalar
Typically, (discrete) dynamic systems: state transitions.
A simple scenario: a lamp in a corridor with 3 switches.
Fluents: up1, up2, up3, light (Boolean).
Actions: toggle1, toggle2, toggle3.
State: a possible configuration of fluent values. Example:
{up1, up2, up3, light}.
Situation: a moment in time. We can just use 0, 1, 2, . . .
light
light
light
toggle1
up1
up2
up3
toggle3
up1
up2
up3
up1
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
up2
up3
June 29, 2010
5 / 123
Motivation and goals
RAC goals
We want to solve some typical reasoning problems.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
6 / 123
Motivation and goals
RAC goals
We want to solve some typical reasoning problems.
Here is a (non-exhaustive) list of the most usual ones:
1
2
3
4
5
P. Cabalar
Prediction, simulation or temporal projection
Postdiction or temporal explanation
Planning
Diagnosis
Checking properties: system properties; representation properties
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
6 / 123
Motivation and goals
RAC goals
We want to solve some typical reasoning problems.
Here is a (non-exhaustive) list of the most usual ones:
1
2
3
4
5
Prediction, simulation or temporal projection
Postdiction or temporal explanation
Planning
Diagnosis
Checking properties: system properties; representation properties
For instance, in our example . . .
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
6 / 123
Motivation and goals
Prediction (simulation, or temporal explanation)
Knowing: initial state + sequence of actions
Find out: final state (alternatively sequence of intermediate
states)
light
toggle1
up1
P. Cabalar
up2
?
toggle3
?
up3
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
7 / 123
Motivation and goals
Postdiction (or temporal explanation)
Knowing: partial observations of states and performed actions
Find out: complete information on states and performed actions
light
light
light
?
?
?
?
up3
P. Cabalar
toggle3
up1
up3
up1
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
up2
up3
June 29, 2010
8 / 123
Motivation and goals
Planning
Knowing: initial state + goal (partial description of final state)
Find out: plan (sequence of actions) that guarantees reaching the
goal
light
light
?
up1
P. Cabalar
up2
up3
?
?
?
?
?
up1
up2
up3
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
9 / 123
Motivation and goals
Planning vs Postdiction
Note that planning seems a type of postdiction. For deterministic
systems, this is true, but . . .
Nondeterministic transition system: fixing current state +
performed action −→ several possible successor states.
For instance, switch 1 when moved up may fail to turn the light
on...
light
toggle1
up1
up2
up3
toggle1
Switch 1 "failed"
light
up1
P. Cabalar
up2
light
up3
up1
up2
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
up3
June 29, 2010
10 / 123
Motivation and goals
Planning vs Postdiction
light
light
?
?
up1
up2
?
?
up3
For postdiction, one valid explanation is: we performed toggle1,
and it succeeded to turn the light on.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
11 / 123
Motivation and goals
Planning vs Postdiction
light
light
?
?
up1
up2
?
?
up3
For postdiction, one valid explanation is: we performed toggle1,
and it succeeded to turn the light on.
For planning, toggle1 is not a valid plan: it does not guarantee
reaching the goal light.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
11 / 123
Motivation and goals
Planning vs Postdiction
light
light
?
?
up1
up2
?
?
up3
For postdiction, one valid explanation is: we performed toggle1,
and it succeeded to turn the light on.
For planning, toggle1 is not a valid plan: it does not guarantee
reaching the goal light. Possible plans are toggle2 or toggle3.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
11 / 123
Motivation and goals
Planning vs Postdiction
P. Cabalar
light
light
?
?
up1
up2
?
?
up3
For postdiction, one valid explanation is: we performed toggle1,
and it succeeded to turn the light on.
For planning, toggle1 is not a valid plan: it does not guarantee
reaching the goal light. Possible plans are toggle2 or toggle3.
Planning in nondeterministic systems is more related to abduction.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
11 / 123
Motivation and goals
Diagnosis
Knowing: a model distinguishing between normal and abnormal
transitions + a partial set of observations (usually implying
abnormal behavior).
Find out: the minimal set of abnormal transitions that explains the
observations.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
12 / 123
Motivation and goals
Diagnosis
Knowing: a model distinguishing between normal and abnormal
transitions + a partial set of observations (usually implying
abnormal behavior).
Find out: the minimal set of abnormal transitions that explains the
observations.
Similar to postdiction, but we are additionally interested in
minimality of explanations.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
12 / 123
Motivation and goals
Checking properties
P. Cabalar
Some elaborated problems are related to checking properties
(less common in RAC).
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
13 / 123
Motivation and goals
Checking properties
P. Cabalar
Some elaborated problems are related to checking properties
(less common in RAC).
One may be interested in system properties, as in model
checking:
1
Safety: a given (unsafe) state or condition is never reached.
“Something bad never happens”
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
13 / 123
Motivation and goals
Checking properties
P. Cabalar
Some elaborated problems are related to checking properties
(less common in RAC).
One may be interested in system properties, as in model
checking:
1
Safety: a given (unsafe) state or condition is never reached.
“Something bad never happens”
2
Liveness: after some condition, something will be eventually
reached. “Something good will eventually happen”.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
13 / 123
Motivation and goals
Checking properties
P. Cabalar
Some elaborated problems are related to checking properties
(less common in RAC).
One may be interested in system properties, as in model
checking:
1
Safety: a given (unsafe) state or condition is never reached.
“Something bad never happens”
2
Liveness: after some condition, something will be eventually
reached. “Something good will eventually happen”.
Example: any request is eventually attended
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
13 / 123
Motivation and goals
Checking properties
P. Cabalar
Some elaborated problems are related to checking properties
(less common in RAC).
One may be interested in system properties, as in model
checking:
1
Safety: a given (unsafe) state or condition is never reached.
“Something bad never happens”
2
Liveness: after some condition, something will be eventually
reached. “Something good will eventually happen”.
Example: any request is eventually attended
Liveness can only be violated with infinite traces.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
13 / 123
Motivation and goals
Checking properties
P. Cabalar
Some elaborated problems are related to checking properties
(less common in RAC).
One may be interested in system properties, as in model
checking:
1
Safety: a given (unsafe) state or condition is never reached.
“Something bad never happens”
2
Liveness: after some condition, something will be eventually
reached. “Something good will eventually happen”.
Example: any request is eventually attended
Liveness can only be violated with infinite traces.
3
Fairness: fair resolution of nondeterminism.
Example: avoid starvation. A process turn cannot be infinitely
denied.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
13 / 123
Motivation and goals
Checking properties
Or we may be interested in representation properties.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
14 / 123
Motivation and goals
Checking properties
Or we may be interested in representation properties.
Are two different representations equivalent? That is, do they
generate the same state transition system?
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
14 / 123
Motivation and goals
Checking properties
Or we may be interested in representation properties.
Are two different representations equivalent? That is, do they
generate the same state transition system?
We will see one stronger concept: are two different
representations strongly equivalent?
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
14 / 123
Motivation and goals
Checking properties
P. Cabalar
Or we may be interested in representation properties.
Are two different representations equivalent? That is, do they
generate the same state transition system?
We will see one stronger concept: are two different
representations strongly equivalent? That is, do they generate the
same system even when included in a common larger description
(or context)?
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
14 / 123
Motivation and goals
Example-based methodology
Paraphrasing McCarthy’s comment in a workshop:
AI researchers start from examples and then try to generalize.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
15 / 123
Motivation and goals
Example-based methodology
Paraphrasing McCarthy’s comment in a workshop:
AI researchers start from examples and then try to generalize.
Philosophers start from the most general case, and never use
examples unless they are forced to.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
15 / 123
Motivation and goals
Example-based methodology
Paraphrasing McCarthy’s comment in a workshop:
AI researchers start from examples and then try to generalize.
Philosophers start from the most general case, and never use
examples unless they are forced to.
Advantage: focus on features under study using a synthetic,
limited scenario (games, puzzles, etc)
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
15 / 123
Motivation and goals
Example-based methodology
Paraphrasing McCarthy’s comment in a workshop:
AI researchers start from examples and then try to generalize.
Philosophers start from the most general case, and never use
examples unless they are forced to.
Advantage: focus on features under study using a synthetic,
limited scenario (games, puzzles, etc)
Real problems usually contain complex factors that happen to be
irrelevant for the property under study.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
15 / 123
Motivation and goals
Example-based methodology
A classical (planning) example: the N-puzzle.
4 1 3
7 2 5
8
6
P. Cabalar
?
?
?
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
1 2 3
4 5 6
7 6
June 29, 2010
16 / 123
Motivation and goals
Example-based methodology
A classical (planning) example: the N-puzzle.
4 1 3
7 2 5
8
6
?
?
?
1 2 3
4 5 6
7 6
Well known: the 8-puzzle has 181440 sates, the 15-puzzle more
than 1013 .
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
16 / 123
Motivation and goals
Example-based methodology
P. Cabalar
A classical (planning) example: the N-puzzle.
4 1 3
7 2 5
8
6
?
?
?
1 2 3
4 5 6
7 6
Well known: the 8-puzzle has 181440 sates, the 15-puzzle more
than 1013 .
Complexity: NP-complete.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
16 / 123
Motivation and goals
Example-based methodology
P. Cabalar
An interesting analogy: “Chess is the Drosophila of AI” [A.
Kronrod 65]. That is, games for AI can play the same role as fruit
flies for Genetics.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
17 / 123
Motivation and goals
Example-based methodology
P. Cabalar
An interesting analogy: “Chess is the Drosophila of AI” [A.
Kronrod 65]. That is, games for AI can play the same role as fruit
flies for Genetics.
Warning: avoid too much focus on the toy problem. Remember we
must be capable of generalizing the obtained results.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
17 / 123
Motivation and goals
Example-based methodology
An interesting analogy: “Chess is the Drosophila of AI” [A.
Kronrod 65]. That is, games for AI can play the same role as fruit
flies for Genetics.
Warning: avoid too much focus on the toy problem. Remember we
must be capable of generalizing the obtained results.
Back to the chess example:
“Unfortunately, the competitive and commercial aspects
of making computers play chess have taken precedence
over using chess as a scientific domain. It is as if the
geneticists after 1910 had organized fruit fly races and
concentrated their efforts on breeding fruit flies that could
win these races.” [McCarthy]
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
17 / 123
Motivation and goals
Example-based methodology
Take the 8-puzzle example. Which is our main goal?
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
18 / 123
Motivation and goals
Example-based methodology
Take the 8-puzzle example. Which is our main goal? Making a
very fast solver for 8-puzzle?
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
18 / 123
Motivation and goals
Example-based methodology
P. Cabalar
Take the 8-puzzle example. Which is our main goal? Making a
very fast solver for 8-puzzle?
But what can we learn from that? Which is the application to other
scenarios?
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
18 / 123
Motivation and goals
Example-based methodology
P. Cabalar
Take the 8-puzzle example. Which is our main goal? Making a
very fast solver for 8-puzzle?
But what can we learn from that? Which is the application to other
scenarios?
We should perhaps wonder which other scenarios. Originally, AI
goal was any scenario (General Problem Solver) but was too
ambitious.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
18 / 123
Motivation and goals
Example-based methodology
P. Cabalar
Take the 8-puzzle example. Which is our main goal? Making a
very fast solver for 8-puzzle?
But what can we learn from that? Which is the application to other
scenarios?
We should perhaps wonder which other scenarios. Originally, AI
goal was any scenario (General Problem Solver) but was too
ambitious.
It could perhaps suffice with similar scenarios. Small variations or
elaborations.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
18 / 123
Motivation and goals
Elaboration
Example: assume we may allow now two holes.
1
2
5 7 3
4 6
P. Cabalar
?
?
?
1 2
5 7
4 6 3
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
19 / 123
Motivation and goals
Elaboration
Example: assume we may allow now two holes.
1
2
5 7 3
4 6
?
?
?
1 2
5 7
4 6 3
Less steps to solve. We can even allow simultaneous movements.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
19 / 123
Motivation and goals
Elaboration
Example: assume we may allow now two holes.
1
2
5 7 3
4 6
?
?
?
1 2
5 7
4 6 3
Less steps to solve. We can even allow simultaneous movements.
Can we easily adapt our solver to this elaboration?
Think about an optimized heuristic search algorithm programmed
in C, for instance.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
19 / 123
Motivation and goals
Keypoint: representation
A much more flexible solution:
add a description of the scenario as an input to our solver.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
20 / 123
Motivation and goals
Keypoint: representation
P. Cabalar
A much more flexible solution:
add a description of the scenario as an input to our solver.
In this way, variations of the scenario would mean changing the
problem description . . .
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
20 / 123
Motivation and goals
Keypoint: representation
P. Cabalar
A much more flexible solution:
add a description of the scenario as an input to our solver.
In this way, variations of the scenario would mean changing the
problem description . . . Knowledge Representation (KR) is crucial!
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
20 / 123
Motivation and goals
Keypoint: representation
P. Cabalar
Which are the desirable properties of a good KR?
1
Simplicity
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
21 / 123
Motivation and goals
Keypoint: representation
P. Cabalar
Which are the desirable properties of a good KR?
1
Simplicity
2
Natural understanding: clear semantics
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
21 / 123
Motivation and goals
Keypoint: representation
P. Cabalar
Which are the desirable properties of a good KR?
1
Simplicity
2
Natural understanding: clear semantics
3
Allows automated reasoning methods that:
are efficient
or at least, their complexity can be assessed
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
21 / 123
Motivation and goals
Keypoint: representation
P. Cabalar
Which are the desirable properties of a good KR?
1
Simplicity
2
Natural understanding: clear semantics
3
Allows automated reasoning methods that:
are efficient
or at least, their complexity can be assessed
4
Elaboration tolerance [McCarthy98]
“A formalism is elaboration tolerant to the extent that it is
convenient to modify a set of facts expressed in the
formalism to take into account new phenomena or
changed circumstances.” [McCarthy98]
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
21 / 123
Motivation and goals
Keypoint: representation
Example of representation: an automaton is simple, and has a
clear semantics . . .
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
22 / 123
Motivation and goals
Keypoint: representation
Example of representation: an automaton is simple, and has a
clear semantics . . .
But fails in elaboration tolerance! A small change (say, adding new
switches or lamps) means a complete rebuilding
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
22 / 123
Motivation and goals
Keypoint: representation
A practical alternative: use rules to describe the local effects of
each performed action.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
23 / 123
Motivation and goals
Keypoint: representation
A practical alternative: use rules to describe the local effects of
each performed action.
For each switch X ∈ {1, 2, 3}
Action precondition ⇒ effect(s)
P. Cabalar
toggle(X ) :
up(X )
⇒ up(X )
toggle(X ) :
up(X )
⇒ up(X )
toggle(X ) :
light
⇒ light
toggle(X ) :
light
⇒ light
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
23 / 123
Motivation and goals
Keypoint: representation
A practical alternative: use rules to describe the local effects of
each performed action.
For each switch X ∈ {1, 2, 3}
Action precondition ⇒ effect(s)
toggle(X ) :
up(X )
⇒ up(X )
toggle(X ) :
up(X )
⇒ up(X )
toggle(X ) :
light
⇒ light
toggle(X ) :
light
⇒ light
This language is similar to STRIPS [Fikes & Nilsson 71] still used
in planning systems.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
23 / 123
Motivation and goals
Logical Knowledge Representation
Can we just use classical logic instead?
toggle(X ) : up(X ) ⇒ up(X )
toggle(X , I) ∧ up(X , true, I) → up(X , false, I + 1)
where we include as new arguments, the temporal indices I, I + 1
plus the fluent values true, false.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
24 / 123
Motivation and goals
Logical Knowledge Representation
Can we just use classical logic instead?
toggle(X ) : up(X ) ⇒ up(X )
toggle(X , I) ∧ up(X , true, I) → up(X , false, I + 1)
where we include as new arguments, the temporal indices I, I + 1
plus the fluent values true, false.
Problem: when toggle(1), what can we conclude about up(2) and
up(3)?
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
24 / 123
Motivation and goals
Logical Knowledge Representation
Can we just use classical logic instead?
toggle(X ) : up(X ) ⇒ up(X )
toggle(X , I) ∧ up(X , true, I) → up(X , false, I + 1)
where we include as new arguments, the temporal indices I, I + 1
plus the fluent values true, false.
Problem: when toggle(1), what can we conclude about up(2) and
up(3)?
They should remain unchanged! However, our logical theory
provides no information (we also have models where their value
change).
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
24 / 123
Motivation and goals
Logical Knowledge Representation
We would need much more formulae
toggle(1, I) ∧ up(2, true, I) → up(2, true, I + 1)
toggle(1, I) ∧ up(2, false, I) → up(2, false, I + 1)
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
25 / 123
Motivation and goals
Logical Knowledge Representation
We would need much more formulae
toggle(1, I) ∧ up(2, true, I) → up(2, true, I + 1)
toggle(1, I) ∧ up(2, false, I) → up(2, false, I + 1)
toggle(1, I) ∧ up(3, true, I) → up(3, true, I + 1)
toggle(1, I) ∧ up(3, false, I) → up(3, false, I + 1)
..
.
and so on, for any fluent and value that are unrelated to toggle(1).
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
25 / 123
Motivation and goals
Default reasoning
Frame problem: adding a simple fluent or action means
reformulating all these formulae! [McCarthy & Hayes 69]
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
26 / 123
Motivation and goals
Default reasoning
Frame problem: adding a simple fluent or action means
reformulating all these formulae! [McCarthy & Hayes 69]
We need a kind of default reasoning.
Inertia rule: fluents remain unchanged by default
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
26 / 123
Motivation and goals
Default reasoning
Frame problem: adding a simple fluent or action means
reformulating all these formulae! [McCarthy & Hayes 69]
We need a kind of default reasoning.
Inertia rule: fluents remain unchanged by default
“By default” = when no evidence on the contrary is available. We
must extract conclusions from absence of information.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
26 / 123
Motivation and goals
Default reasoning
Frame problem: adding a simple fluent or action means
reformulating all these formulae! [McCarthy & Hayes 69]
We need a kind of default reasoning.
Inertia rule: fluents remain unchanged by default
“By default” = when no evidence on the contrary is available. We
must extract conclusions from absence of information.
Unfortunately, Classical Logic is not well suited for this purpose
because
Γ ` α implies Γ ∪ ∆ ` α
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
26 / 123
Motivation and goals
Default reasoning
Frame problem: adding a simple fluent or action means
reformulating all these formulae! [McCarthy & Hayes 69]
We need a kind of default reasoning.
Inertia rule: fluents remain unchanged by default
“By default” = when no evidence on the contrary is available. We
must extract conclusions from absence of information.
Unfortunately, Classical Logic is not well suited for this purpose
because
Γ ` α implies Γ ∪ ∆ ` α
This is called monotonic consequence relation.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
26 / 123
Motivation and goals
Default reasoning
P. Cabalar
Frame problem: adding a simple fluent or action means
reformulating all these formulae! [McCarthy & Hayes 69]
We need a kind of default reasoning.
Inertia rule: fluents remain unchanged by default
“By default” = when no evidence on the contrary is available. We
must extract conclusions from absence of information.
Unfortunately, Classical Logic is not well suited for this purpose
because
Γ ` α implies Γ ∪ ∆ ` α
This is called monotonic consequence relation.
But Γ ` α by default could mean that adding ∆, Γ ∪ ∆ 6` α.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
26 / 123
Motivation and goals
Default reasoning
P. Cabalar
Frame problem: adding a simple fluent or action means
reformulating all these formulae! [McCarthy & Hayes 69]
We need a kind of default reasoning.
Inertia rule: fluents remain unchanged by default
“By default” = when no evidence on the contrary is available. We
must extract conclusions from absence of information.
Unfortunately, Classical Logic is not well suited for this purpose
because
Γ ` α implies Γ ∪ ∆ ` α
This is called monotonic consequence relation.
But Γ ` α by default could mean that adding ∆, Γ ∪ ∆ 6` α.
We need Nonmonotonic Reasoning (NMR).
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
26 / 123
Motivation and goals
Default reasoning
An example: suppose up(2, true, 0) and we perform toggle(1, 0).
Inertia should allow us to conclude that switch 2 is unaffected:
Γ ` up(2, true, 1)
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
27 / 123
Motivation and goals
Default reasoning
An example: suppose up(2, true, 0) and we perform toggle(1, 0).
Inertia should allow us to conclude that switch 2 is unaffected:
Γ ` up(2, true, 1)
Elaboration: we are said now that toggle(1) affects up(2) in the
following way:
toggle(1, I) ∧ up(2, true, I) → up(2, false, I + 1)
(1)
We will need retract our previous conclusion
Γ ∪ (1) 6` up(2, true, 1)
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
27 / 123
Motivation and goals
Other typical representational problems
Qualification problem: preconditions are affected by conditions
that qualify an action.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
28 / 123
Motivation and goals
Other typical representational problems
Qualification problem: preconditions are affected by conditions
that qualify an action.
Example: when can we toggle the switch?
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
28 / 123
Motivation and goals
Other typical representational problems
Qualification problem: preconditions are affected by conditions
that qualify an action.
Example: when can we toggle the switch? Elaborations: switch is
not broken, switch has not been stuck, we must be close enough,
etc.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
28 / 123
Motivation and goals
Other typical representational problems
Qualification problem: preconditions are affected by conditions
that qualify an action.
Example: when can we toggle the switch? Elaborations: switch is
not broken, switch has not been stuck, we must be close enough,
etc.
The explicit addition of any imaginable “disqualification” is
unfeasible.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
28 / 123
Motivation and goals
Other typical representational problems
Qualification problem: preconditions are affected by conditions
that qualify an action.
Example: when can we toggle the switch? Elaborations: switch is
not broken, switch has not been stuck, we must be close enough,
etc.
The explicit addition of any imaginable “disqualification” is
unfeasible. Again: by default, toggle works when nothing prevents
it.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
28 / 123
Motivation and goals
Other typical representational problems
Elaboration: there is a light sensor that activates an alarm, if the
latter is connected.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
29 / 123
Motivation and goals
Other typical representational problems
Elaboration: there is a light sensor that activates an alarm, if the
latter is connected. The alarm causes locking the door.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
29 / 123
Motivation and goals
Other typical representational problems
Elaboration: there is a light sensor that activates an alarm, if the
latter is connected. The alarm causes locking the door.
In STRIPS, this means relating indirect effects alarm to each
possible action toggle(X ).
Action
precondition
⇒ effect(s)
toggle(X ) : light, connected
⇒ alarm
toggle(X ) : light, connected
⇒ lock
Problem: there may be other new ways to turn on a light, or to
activate the alarm. We will be forced to relate lock to the
performed actions!
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
29 / 123
Motivation and goals
Other typical representational problems
P. Cabalar
This is called ramification problem: postconditions are affected by
interactions due to indirect effects.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
30 / 123
Motivation and goals
Other typical representational problems
P. Cabalar
This is called ramification problem: postconditions are affected by
interactions due to indirect effects.
lock is an indirect effect of toggling a switch
(toggle 7→ light 7→ alarm 7→ lock ).
We would need something like:
light(true, I) ∧ connected(true, I) → alarm(true, I)
alarm(true, I) → lock (true, I)
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
30 / 123
Survey of NMR formalisms
NMR formalisms
P. Cabalar
Starting from a monotonic framework (Classical Logic, for
instance) nonmonotonicity can be obtained in different ways.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
31 / 123
Survey of NMR formalisms
NMR formalisms
P. Cabalar
Starting from a monotonic framework (Classical Logic, for
instance) nonmonotonicity can be obtained in different ways.
Semantic way: establishing a models selection criterion.
Sel(M) ⊆ M.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
31 / 123
Survey of NMR formalisms
NMR formalisms
P. Cabalar
Starting from a monotonic framework (Classical Logic, for
instance) nonmonotonicity can be obtained in different ways.
Semantic way: establishing a models selection criterion.
Sel(M) ⊆ M.
Γ |= α means Models(Γ) ⊆ Models(α).
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
31 / 123
Survey of NMR formalisms
NMR formalisms
P. Cabalar
Starting from a monotonic framework (Classical Logic, for
instance) nonmonotonicity can be obtained in different ways.
Semantic way: establishing a models selection criterion.
Sel(M) ⊆ M.
Γ |= α means Models(Γ) ⊆ Models(α).
Adding ∆, we must have Γ ∪ ∆ |= α. Proof:
Models(Γ∪∆) = Models(Γ)∩Models(∆) ⊆ Models(Γ) ⊆ Models(α).
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
31 / 123
Survey of NMR formalisms
NMR formalisms
P. Cabalar
Starting from a monotonic framework (Classical Logic, for
instance) nonmonotonicity can be obtained in different ways.
Semantic way: establishing a models selection criterion.
Sel(M) ⊆ M.
Γ |= α means Models(Γ) ⊆ Models(α).
Adding ∆, we must have Γ ∪ ∆ |= α. Proof:
Models(Γ∪∆) = Models(Γ)∩Models(∆) ⊆ Models(Γ) ⊆ Models(α).
#
!U#
"
!
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
31 / 123
Survey of NMR formalisms
NMR formalisms
When selecting models Γ |∼ α means
Sel(Models(Γ)) ⊆ Models(α).
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
32 / 123
Survey of NMR formalisms
NMR formalisms
When selecting models Γ |∼ α means
Sel(Models(Γ)) ⊆ Models(α).
Now, it may be the case that:
Sel(Models(Γ)) ⊆ Models(α), that is, Γ |∼ α
Sel(Models(Γ ∪ ∆)) 6⊆ Models(α), that is, Γ ∪ ∆ |∼
/ α.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
32 / 123
Survey of NMR formalisms
NMR formalisms
When selecting models Γ |∼ α means
Sel(Models(Γ)) ⊆ Models(α).
Now, it may be the case that:
Sel(Models(Γ)) ⊆ Models(α), that is, Γ |∼ α
Sel(Models(Γ ∪ ∆)) 6⊆ Models(α), that is, Γ ∪ ∆ |∼
/ α.
#
!U#
Sel(!U#)
"
Sel(!)
!
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
32 / 123
Survey of NMR formalisms
NMR formalisms
Syntactic way: we have Γ and want to complete its consequences
in an extended theory E.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
33 / 123
Survey of NMR formalisms
NMR formalisms
P. Cabalar
Syntactic way: we have Γ and want to complete its consequences
in an extended theory E.
We typically use a fixpoint condition of the form
Γ ∪ Assmp(E) ` E
where Assmp(E) is a set of assumptions (formulae) we fix using
E itself.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
33 / 123
Survey of NMR formalisms
NMR formalisms
To show its nonmonotonicity, suppose our theory is Γ = {p → q}
and we can always assume p, that is:
def
Assmp(E) = {p} if p ∈ E; ∅ otherwise.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
34 / 123
Survey of NMR formalisms
NMR formalisms
To show its nonmonotonicity, suppose our theory is Γ = {p → q}
and we can always assume p, that is:
def
Assmp(E) = {p} if p ∈ E; ∅ otherwise.
E = Cn({p, q}) is an extension because Γ ∪ {p} ` {p, q}.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
34 / 123
Survey of NMR formalisms
NMR formalisms
To show its nonmonotonicity, suppose our theory is Γ = {p → q}
and we can always assume p, that is:
def
Assmp(E) = {p} if p ∈ E; ∅ otherwise.
E = Cn({p, q}) is an extension because Γ ∪ {p} ` {p, q}.
If we add the information ∆ = {¬q}
Cn({p, q}) is not an extension because
Γ ∪ ∆ ∪ {p} ` ⊥ 6= Cn({p, q}).
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
34 / 123
Survey of NMR formalisms
NMR formalisms
To show its nonmonotonicity, suppose our theory is Γ = {p → q}
and we can always assume p, that is:
def
Assmp(E) = {p} if p ∈ E; ∅ otherwise.
E = Cn({p, q}) is an extension because Γ ∪ {p} ` {p, q}.
If we add the information ∆ = {¬q}
Cn({p, q}) is not an extension because
Γ ∪ ∆ ∪ {p} ` ⊥ 6= Cn({p, q}).
Cn({¬p, ¬q}) is an extension because Γ ∪ ∆ ∪ ∅ ` {¬p, ¬q}.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
34 / 123
Survey of NMR formalisms
Circumscription
Outline
1
Motivation and goals
2
Survey of NMR formalisms
Circumscription
Default Logic
Autoepistemic Logic
3
Answer Set Programming
Answer Set Programming
Diagnosis
Equilibrium Logic
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
35 / 123
Survey of NMR formalisms
Circumscription
Circumscription
Circumscription [McCarthy 80] is one of the most popular NMR
formalisms. Many variants exist.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
36 / 123
Survey of NMR formalisms
Circumscription
Circumscription
Circumscription [McCarthy 80] is one of the most popular NMR
formalisms. Many variants exist.
Keypoint: try to minimize the extent of some predicate P.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
36 / 123
Survey of NMR formalisms
Circumscription
Circumscription
Circumscription [McCarthy 80] is one of the most popular NMR
formalisms. Many variants exist.
Keypoint: try to minimize the extent of some predicate P.
Let M1 and M2 be two first order models. We define M1 ≤P M2
when:
1
2
P. Cabalar
M1 and M2 coincide in their universes and valuations for everything
excepting P and
M1 [P] ⊆ M2 [P].
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
36 / 123
Survey of NMR formalisms
Circumscription
Circumscription
Circumscription [McCarthy 80] is one of the most popular NMR
formalisms. Many variants exist.
Keypoint: try to minimize the extent of some predicate P.
Let M1 and M2 be two first order models. We define M1 ≤P M2
when:
1
2
M1 and M2 coincide in their universes and valuations for everything
excepting P and
M1 [P] ⊆ M2 [P].
We want our selected models to be the ≤P minimal models.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
36 / 123
Survey of NMR formalisms
Circumscription
Circumscription
This semantic characterisation is equivalent to a Second Order
Logic definition.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
37 / 123
Survey of NMR formalisms
Circumscription
Circumscription
This semantic characterisation is equivalent to a Second Order
Logic definition.
Let us introduce the notation:
p≤P
p=P
p<P
P. Cabalar
def
=
∀x (p(x) → P(x))
def
=
∀x (p(x) ↔ P(x))
def
(p ≤ P) ∧ ¬(p = P)
=
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
37 / 123
Survey of NMR formalisms
Circumscription
Circumscription
This semantic characterisation is equivalent to a Second Order
Logic definition.
Let us introduce the notation:
p≤P
p=P
p<P
def
=
∀x (p(x) → P(x))
def
=
∀x (p(x) ↔ P(x))
def
(p ≤ P) ∧ ¬(p = P)
=
Then, we define:
def
CIRC[Γ; P] = Γ(P) ∧ ¬∃p (Γ(p) ∧ p < P)
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
37 / 123
Survey of NMR formalisms
Circumscription
Circumscription
This semantic characterisation is equivalent to a Second Order
Logic definition.
Let us introduce the notation:
p≤P
p=P
p<P
def
=
∀x (p(x) → P(x))
def
=
∀x (p(x) ↔ P(x))
def
(p ≤ P) ∧ ¬(p = P)
=
Then, we define:
def
CIRC[Γ; P] = Γ(P) ∧ ¬∃p (Γ(p) ∧ p < P)
Theorem: models of CIRC[Γ; P] are the ≤P -minimal models of Γ
[Lifschitz93]
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
37 / 123
Survey of NMR formalisms
Circumscription
Circumscription
P. Cabalar
How does it work? Freely decide all constants and then minimize
the extent of P.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
38 / 123
Survey of NMR formalisms
Circumscription
Circumscription
P. Cabalar
How does it work? Freely decide all constants and then minimize
the extent of P.
For default reasoning: the purpose is minimizing some
abnormality predicate Ab.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
38 / 123
Survey of NMR formalisms
Circumscription
Circumscription
P. Cabalar
How does it work? Freely decide all constants and then minimize
the extent of P.
For default reasoning: the purpose is minimizing some
abnormality predicate Ab. But fixed circumscription has some
problems . . .
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
38 / 123
Survey of NMR formalisms
Circumscription
Circumscription
P. Cabalar
How does it work? Freely decide all constants and then minimize
the extent of P.
For default reasoning: the purpose is minimizing some
abnormality predicate Ab. But fixed circumscription has some
problems . . .
Example of default: Germans normally drink beer
∀x (German(x) ∧ ¬Ab(x) → Drinks(x, Beer ))
German(Peter )
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
38 / 123
Survey of NMR formalisms
Circumscription
Circumscription
P. Cabalar
How does it work? Freely decide all constants and then minimize
the extent of P.
For default reasoning: the purpose is minimizing some
abnormality predicate Ab. But fixed circumscription has some
problems . . .
Example of default: Germans normally drink beer
∀x (German(x) ∧ ¬Ab(x) → Drinks(x, Beer ))
German(Peter )
We get two ≤Ab minimal models:
{¬Ab(Peter ), Drinks(Peter , Beer )} but also
{¬Drinks(Peter , Beer ), Ab(Peter )}.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
38 / 123
Survey of NMR formalisms
Circumscription
Variable Circumscription
Variable circumscription: allow some tuple of predicates Z to vary
def
CIRC[Γ; P; Z ] = Γ(P, Z ) ∧ ¬∃p, z (Γ(p, z) ∧ p < P)
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
39 / 123
Survey of NMR formalisms
Circumscription
Variable Circumscription
Variable circumscription: allow some tuple of predicates Z to vary
def
CIRC[Γ; P; Z ] = Γ(P, Z ) ∧ ¬∃p, z (Γ(p, z) ∧ p < P)
The models minimization is now M1 ≤P,Z M2 when
1
2
P. Cabalar
M1 [Q] = M2 [Q] for any predicate Q excepting P, Z ;
M1 [P] ⊆ M2 [P].
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
39 / 123
Survey of NMR formalisms
Circumscription
Variable Circumscription
Variable circumscription: allow some tuple of predicates Z to vary
def
CIRC[Γ; P; Z ] = Γ(P, Z ) ∧ ¬∃p, z (Γ(p, z) ∧ p < P)
The models minimization is now M1 ≤P,Z M2 when
1
2
M1 [Q] = M2 [Q] for any predicate Q excepting P, Z ;
M1 [P] ⊆ M2 [P].
In the example CIRC[Γ; Ab; Drinks]:
1
2
3
Freely decide the extent of German
Minimize the extent of Ab
Get the consequences for Drinks from those Ab-minimal models
We only get one selected model
{¬Ab(Peter ), Drinks(Peter , Beer )}.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
39 / 123
Survey of NMR formalisms
Default Logic
Outline
1
Motivation and goals
2
Survey of NMR formalisms
Circumscription
Default Logic
Autoepistemic Logic
3
Answer Set Programming
Answer Set Programming
Diagnosis
Equilibrium Logic
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
40 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Default Logic (DL) [Reiter80] has been widely and successfully
used:
1
P. Cabalar
Original definition is expressive enough: no need for variations.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
41 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Default Logic (DL) [Reiter80] has been widely and successfully
used:
P. Cabalar
1
Original definition is expressive enough: no need for variations.
2
Based on inference rules: directional reasoning solves frame,
ramification, qualification problems.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
41 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Default Logic (DL) [Reiter80] has been widely and successfully
used:
P. Cabalar
1
Original definition is expressive enough: no need for variations.
2
Based on inference rules: directional reasoning solves frame,
ramification, qualification problems.
3
Answer Set Programming can be seen as a subset of DL.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
41 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Default Logic (DL) [Reiter80] has been widely and successfully
used:
1
Original definition is expressive enough: no need for variations.
2
Based on inference rules: directional reasoning solves frame,
ramification, qualification problems.
3
Answer Set Programming can be seen as a subset of DL.
Main idea: logics have inference rules
α
γ
meaning “when α has been already proved, the inference rule
allows proving β”
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
41 / 123
Survey of NMR formalisms
Default Logic
Recall: inference methods
Inference or formal proof: we make syntactic manipulation of
formulae. To do so, we use:
An initial set of formulae: axioms (usually axiom schemata).
Syntactic manipulation rules: inference rules.
As a result of applying these rules, we go obtaining new formulae:
theorems
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
42 / 123
Survey of NMR formalisms
Default Logic
Recall: inference methods
Inference or formal proof: we make syntactic manipulation of
formulae. To do so, we use:
An initial set of formulae: axioms (usually axiom schemata).
Syntactic manipulation rules: inference rules.
As a result of applying these rules, we go obtaining new formulae:
theorems
Best known proof methods:
Axiomatic Method (Hilbert)
Resolution
Natural Deduction / Sequent Calculus (Gentzen)
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
42 / 123
Survey of NMR formalisms
Default Logic
Recall: inference methods
Notation: Γ ` α means that formula α can be derived or inferred
from theory Γ.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
43 / 123
Survey of NMR formalisms
Default Logic
Recall: inference methods
Notation: Γ ` α means that formula α can be derived or inferred
from theory Γ.
A logic L can be defined in terms of logical axioms and logical
inference rules. “Logical” means that they induce the logic L.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
43 / 123
Survey of NMR formalisms
Default Logic
Recall: inference methods
Notation: Γ ` α means that formula α can be derived or inferred
from theory Γ.
A logic L can be defined in terms of logical axioms and logical
inference rules. “Logical” means that they induce the logic L.
Usually, logical axioms are not represented inside Γ. Thus, ` α
means that α is a theorem (from logic L).
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
43 / 123
Survey of NMR formalisms
Default Logic
Recall: inference methods
Notation: Γ ` α means that formula α can be derived or inferred
from theory Γ.
A logic L can be defined in terms of logical axioms and logical
inference rules. “Logical” means that they induce the logic L.
Usually, logical axioms are not represented inside Γ. Thus, ` α
means that α is a theorem (from logic L).
Given a language L, a logic L is a subset of L. It can be defined:
Semantically: L = {α ∈ L | |= α}.
Syntactically: L = {α ∈ L | ` α}.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
43 / 123
Survey of NMR formalisms
Default Logic
Recall: inference methods
These are some well-known logical inference rules:
Modus Ponens:
α, α → β
β
Modus tollens
¬β, α → β
¬α
Hypothetical Syllogism
α → β, β → γ
α→γ
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
44 / 123
Survey of NMR formalisms
Default Logic
Recall: inference methods
When we are interested in a particular theory, we usually include
non-logical axioms. Example: PA = set axioms for Peano
Arithmetics.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
45 / 123
Survey of NMR formalisms
Default Logic
Recall: inference methods
When we are interested in a particular theory, we usually include
non-logical axioms. Example: PA = set axioms for Peano
Arithmetics.
If a logic satisfies the deduction (meta)theorem, we can transform
inference with non-logical axioms into implications:
Theorem (Deduction)
Γ ∪ {α} ` β iff Γ ` α → β.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
45 / 123
Survey of NMR formalisms
Default Logic
Recall: inference methods
When we are interested in a particular theory, we usually include
non-logical axioms. Example: PA = set axioms for Peano
Arithmetics.
If a logic satisfies the deduction (meta)theorem, we can transform
inference with non-logical axioms into implications:
Theorem (Deduction)
Γ ∪ {α} ` β iff Γ ` α → β.
P. Cabalar
Classical Logic satisfies the deduction theorem. Example: we can
transform PA ` β into ` PA → β.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
45 / 123
Survey of NMR formalisms
Default Logic
Back to Default Logic
P. Cabalar
Default logic considers using non-logical inference rules.
light ∧ connected
alarm
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
46 / 123
Survey of NMR formalisms
Default Logic
Back to Default Logic
P. Cabalar
Default logic considers using non-logical inference rules.
light ∧ connected
alarm
Directionality of inference rules. Quite different to an implication
light ∧ connected → alarm
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
(2)
June 29, 2010
46 / 123
Survey of NMR formalisms
Default Logic
Back to Default Logic
Default logic considers using non-logical inference rules.
light ∧ connected
alarm
Directionality of inference rules. Quite different to an implication
light ∧ connected → alarm
(2)
For instance: {¬alarm, (2)} allows concluding
¬(light ∧ connected) by Modus Tollens
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
46 / 123
Survey of NMR formalisms
Default Logic
Back to Default Logic
Default logic considers using non-logical inference rules.
light ∧ connected
alarm
Directionality of inference rules. Quite different to an implication
light ∧ connected → alarm
(2)
For instance: {¬alarm, (2)} allows concluding
¬(light ∧ connected) by Modus Tollens
Replacing (2) by the inference rule does not yield that
consequence.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
46 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Some definitions:
A theory (set of formulas) E is closed wrt a set of inference rules
D iff:
for any α ∈ E and
P. Cabalar
α
∈ D we also have β ∈ E
β
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
47 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Some definitions:
A theory (set of formulas) E is closed wrt a set of inference rules
D iff:
for any α ∈ E and
α
∈ D we also have β ∈ E
β
E is logically closed if E is closed wrt the set of classical logical
rules (Modus Ponens, etc).
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
47 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Some definitions:
P. Cabalar
A theory (set of formulas) E is closed wrt a set of inference rules
D iff:
for any α ∈ E and
α
∈ D we also have β ∈ E
β
E is logically closed if E is closed wrt the set of classical logical
rules (Modus Ponens, etc). This means that E is infinite. For
instance, from an atom p we derive . . .
E = {p, p ∨ p, p ∨ ¬p, p ∨ q, q → p, . . . }
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
47 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Some definitions:
If W is a theory and D a set of rules, Cn(W , D) stands for the
consequences of W and D:
the least set of formulas that are both logically closed
and closed wrt D
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
48 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Some definitions:
If W is a theory and D a set of rules, Cn(W , D) stands for the
consequences of W and D:
the least set of formulas that are both logically closed
and closed wrt D
We can simplify Cn(W , D) as Cn(∅, D 0 ) or just Cn(D 0 ) where
> 0 def
D = D∪
α∈W .
α P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
48 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Cn(D) can be incrementally obtained using the direct
consequences operator:
α
TD (E) = Cn
γ ∈ D and α ∈ E
γ
Start with E0 = Cn(∅)
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
49 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Cn(D) can be incrementally obtained using the direct
consequences operator:
α
TD (E) = Cn
γ ∈ D and α ∈ E
γ
Start with E0 = Cn(∅)
Define Ei+1 = TD (Ei )
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
49 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Cn(D) can be incrementally obtained using the direct
consequences operator:
α
TD (E) = Cn
γ ∈ D and α ∈ E
γ
Start with E0 = Cn(∅)
Define Ei+1 = TD (Ei )
A fixpoint TD (Ei ) = Ei must be reached; this fixpoint is Ei = Cn(D).
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
49 / 123
Survey of NMR formalisms
Default Logic
Default Logic
P. Cabalar
But how can we represent defaults?
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
50 / 123
Survey of NMR formalisms
Default Logic
Default Logic
P. Cabalar
But how can we represent defaults?
α : β1 , . . . , βn
γ
Informal meaning:
When α is proved and β1 , . . . , βn are currently consistent, then we
can infer γ.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
50 / 123
Survey of NMR formalisms
Default Logic
Default Logic
P. Cabalar
But how can we represent defaults?
α : β1 , . . . , βn
γ
Informal meaning:
When α is proved and β1 , . . . , βn are currently consistent, then we
can infer γ.
α is called the prerequisite, βi are justifications and γ the
consequent.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
50 / 123
Survey of NMR formalisms
Default Logic
Default Logic
P. Cabalar
But how can we represent defaults?
α : β1 , . . . , βn
γ
Informal meaning:
When α is proved and β1 , . . . , βn are currently consistent, then we
can infer γ.
α is called the prerequisite, βi are justifications and γ the
consequent.
When α = > we omit it.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
50 / 123
Survey of NMR formalisms
Default Logic
Default Logic
P. Cabalar
But how can we represent defaults?
α : β1 , . . . , βn
γ
Informal meaning:
When α is proved and β1 , . . . , βn are currently consistent, then we
can infer γ.
α is called the prerequisite, βi are justifications and γ the
consequent.
When α = > we omit it. A normal default has the form:
:γ
γ
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
50 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Given D and E logically closed, we define the modulo D E as
α α : β1 , . . . , βm
def
DE =
∈
D,
and
there
is
no
¬β
∈
E
j
γ γ
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
51 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Given D and E logically closed, we define the modulo D E as
α α : β1 , . . . , βm
def
DE =
∈
D,
and
there
is
no
¬β
∈
E
j
γ γ
Definition (Extension)
A logically closed theory E is an extension of D iff E = Cn(D E ).
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
51 / 123
Survey of NMR formalisms
Default Logic
Default Logic
We can use variables, but they are understood as patterns
(abbreviations for their ground instances).
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
52 / 123
Survey of NMR formalisms
Default Logic
Default Logic
We can use variables, but they are understood as patterns
(abbreviations for their ground instances).
Example. Let D be the set of rules:
German(x) ∧ ¬Ab(x)
Drinks(x, Beer )
P. Cabalar
>
German(Peter )
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
: ¬Ab(x)
¬Ab(x)
June 29, 2010
52 / 123
Survey of NMR formalisms
Default Logic
Default Logic
We can use variables, but they are understood as patterns
(abbreviations for their ground instances).
Example. Let D be the set of rules:
German(x) ∧ ¬Ab(x)
Drinks(x, Beer )
>
German(Peter )
: ¬Ab(x)
¬Ab(x)
Check that
Cn( {German(Peter ), ¬Ab(Peter ), Drinks(Peter , Beer )} ) is an
extension.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
52 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Example 2: assume we include now in D
German(x) ∧ Mormon(x)
Ab(x)
P. Cabalar
>
Mormon(Peter )
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
53 / 123
Survey of NMR formalisms
Default Logic
Default Logic
Example 2: assume we include now in D
German(x) ∧ Mormon(x)
Ab(x)
>
Mormon(Peter )
Check that Cn( {German(Peter ), Ab(Peter )} ) is an extension.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
53 / 123
Survey of NMR formalisms
Default Logic
Default Logic
A default theory may have several extensions:
: ¬p
: ¬q
q
p
has two Cn({p}) and Cn({q}).
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
54 / 123
Survey of NMR formalisms
Default Logic
Default Logic
P. Cabalar
A default theory may have several extensions:
: ¬p
: ¬q
q
p
has two Cn({p}) and Cn({q}).
It may also have no extension at all:
: ¬p
p
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
54 / 123
Survey of NMR formalisms
Default Logic
Default Logic
P. Cabalar
A default theory may have several extensions:
: ¬p
: ¬q
q
p
has two Cn({p}) and Cn({q}).
It may also have no extension at all:
: ¬p
p
This is different from having inconsistent extensions:
>
p ∧ ¬p
has one extension Cn({⊥}).
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
54 / 123
Survey of NMR formalisms
Default Logic
Default Logic
P. Cabalar
A default theory may have several extensions:
: ¬p
: ¬q
q
p
has two Cn({p}) and Cn({q}).
It may also have no extension at all:
: ¬p
p
This is different from having inconsistent extensions:
>
p ∧ ¬p
has one extension Cn({⊥}).
D is consistent if it has at least one consistent extension.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
54 / 123
Survey of NMR formalisms
Autoepistemic Logic
Outline
1
Motivation and goals
2
Survey of NMR formalisms
Circumscription
Default Logic
Autoepistemic Logic
3
Answer Set Programming
Answer Set Programming
Diagnosis
Equilibrium Logic
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
55 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
Autoepistemic logic (AEL) [Moore 85] belongs to the family of
nonmonotonic modal logics.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
56 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
Autoepistemic logic (AEL) [Moore 85] belongs to the family of
nonmonotonic modal logics.
Brief overview on modal logic . . .
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
56 / 123
Survey of NMR formalisms
Autoepistemic Logic
Recall: modality
Capture some frequent aspect of knowledge in the studied
domain. Examples:
time instants
always P(x), sometimes P(x)
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
57 / 123
Survey of NMR formalisms
Autoepistemic Logic
Recall: modality
Capture some frequent aspect of knowledge in the studied
domain. Examples:
time instants
always P(x), sometimes P(x)
an agent’s knowledge states (epistemology)
A_knows_that ( B_knows_that P(X ) )
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
57 / 123
Survey of NMR formalisms
Autoepistemic Logic
Recall: modality
Capture some frequent aspect of knowledge in the studied
domain. Examples:
time instants
always P(x), sometimes P(x)
an agent’s knowledge states (epistemology)
A_knows_that ( B_knows_that P(X ) )
processes, program states, word or sentence interpretations
(natural language), . . .
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
57 / 123
Survey of NMR formalisms
Autoepistemic Logic
Modality: an example
Example extracted form Wikipedia rule of Neutral Point Of View
(NPOV) about Religion:
NPOV policy means that Wikipedia editors ought to try to
write sentences like this: "Certain adherents of this faith
(say which) believe X, and also believe that they have
always believed X; . . . "
http://en.wikipedia.org/wiki/Wikipedia:
Neutral_point_of_view
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
58 / 123
Survey of NMR formalisms
Autoepistemic Logic
Relation to First Order Logic
Can we use First Order Logic (FOL) instead?
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
59 / 123
Survey of NMR formalisms
Autoepistemic Logic
Relation to First Order Logic
Can we use First Order Logic (FOL) instead?
Yes, although with some notational “effort”. Example:
“Always P(x, y )” = ∀t(Instant(t) → P(x, y , (t))
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
59 / 123
Survey of NMR formalisms
Autoepistemic Logic
Relation to First Order Logic
Can we use First Order Logic (FOL) instead?
Yes, although with some notational “effort”. Example:
“Always P(x, y )” = ∀t(Instant(t) → P(x, y , (t))
Notice how we indexed all predicates wrt t (time has been reified)
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
59 / 123
Survey of NMR formalisms
Autoepistemic Logic
Relation to First Order Logic
Can we use First Order Logic (FOL) instead?
Yes, although with some notational “effort”. Example:
“Always P(x, y )” = ∀t(Instant(t) → P(x, y , (t))
Notice how we indexed all predicates wrt t (time has been reified)
. . . In fact, modal logics can be translated to FOL.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
59 / 123
Survey of NMR formalisms
Autoepistemic Logic
Relation to First Order Logic
Can we use First Order Logic (FOL) instead?
Yes, although with some notational “effort”. Example:
“Always P(x, y )” = ∀t(Instant(t) → P(x, y , (t))
Notice how we indexed all predicates wrt t (time has been reified)
. . . In fact, modal logics can be translated to FOL.
Then, which is their utility?
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
59 / 123
Survey of NMR formalisms
Autoepistemic Logic
Relation to First Order Logic
Can we use First Order Logic (FOL) instead?
Yes, although with some notational “effort”. Example:
“Always P(x, y )” = ∀t(Instant(t) → P(x, y , (t))
Notice how we indexed all predicates wrt t (time has been reified)
. . . In fact, modal logics can be translated to FOL.
Then, which is their utility?
Notation and deduction methods are more comfortable
We lose expressivity but we gain in restricting the reasoning
methods
Usually, propositional version is decidable
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
59 / 123
Survey of NMR formalisms
Autoepistemic Logic
Syntax
We introduce two new unary operators:
L α or α = “α is necessary”
M α or ♦α = “α is possible”
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
60 / 123
Survey of NMR formalisms
Autoepistemic Logic
Axiomatization: inference rules
Logical rules
Modus Ponens (MP)
` α, ` α → β
`β
Uniform Substitution (US)
`α
` α[β1 /p1 , . . . , βn /pn ]
Necessitation (N)
`α
` Lα
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
61 / 123
Survey of NMR formalisms
Autoepistemic Logic
Some basic axioms
More frequent axioms:
K
T
D
4
B
P. Cabalar
L(p → q) → (Lp → Lq)
Lp → p
Lp → Mp
Lp → LLp
p → LMp
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
62 / 123
Survey of NMR formalisms
Autoepistemic Logic
Example: system K
Its the most elementary one and included in all the rest.
Induced by axiom K.
K L(p → q) → (Lp → Lq)
These are a pair of theorems in K
K1 L(p ∧ q) → (Lp ∧ Lq)
K2
Lp ∧ Lq → L(p ∧ q)
Derived rule:
DR1
P. Cabalar
`α→β
`Lα→Lβ
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
63 / 123
Survey of NMR formalisms
Autoepistemic Logic
Kripke Semantics: possible worlds
In propositional logic we have
v : Atoms −→ {T , F }
that provide the truth value for each atom and for evaluation of
formulas. Ex: v (p → ¬q).
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
64 / 123
Survey of NMR formalisms
Autoepistemic Logic
Kripke Semantics: possible worlds
In propositional logic we have
v : Atoms −→ {T , F }
that provide the truth value for each atom and for evaluation of
formulas. Ex: v (p → ¬q).
Keypoint: handle several worlds, each one with its own
interpretation.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
64 / 123
Survey of NMR formalisms
Autoepistemic Logic
Kripke Semantics: possible worlds
P. Cabalar
In propositional logic we have
v : Atoms −→ {T , F }
that provide the truth value for each atom and for evaluation of
formulas. Ex: v (p → ¬q).
Keypoint: handle several worlds, each one with its own
interpretation.
We will have a current world as a reference + a relation stating
which worlds are visible from which ones.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
64 / 123
Survey of NMR formalisms
Autoepistemic Logic
Kripke frames
Definition (Kripke frame)
Is a pair hW , Ri where W = {w1 , w2 , . . . } is a set of worlds and
R ⊆ W × W a relation among them.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
65 / 123
Survey of NMR formalisms
Autoepistemic Logic
Kripke frames
Definition (Kripke frame)
Is a pair hW , Ri where W = {w1 , w2 , . . . } is a set of worlds and
R ⊆ W × W a relation among them.
Definition (Kripke Model)
Is a triple hW , R, v i where hW , Ri is a Kripke frame and
v : W × Atoms → {T , F } an atoms valuation for each world.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
65 / 123
Survey of NMR formalisms
Autoepistemic Logic
Satisfactibility
Let M = hW , R, v i a Kripke model. We write M, w |= α to point out
that M satisfies a formula α in world w ∈ W .
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
66 / 123
Survey of NMR formalisms
Autoepistemic Logic
Satisfactibility
Let M = hW , R, v i a Kripke model. We write M, w |= α to point out
that M satisfies a formula α in world w ∈ W .
Definition (M, w |= α)
M, w |= > (M, w 6|= ⊥)
M, w |= p of v (w, p) = T (with p ∈ Atoms)
M, w |= α ∧ β if M, w |= α and M, w |= β
M, w |= α ∨ β if M, w |= α or M, w |= β
M, w |= ¬α if M, w 6|= α
M, w |= L α if for all w 0 such that wRw 0 : M, w 0 |= α.
M, w |= M α if for some w 0 such that wRw 0 : M, w 0 |= α.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
66 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
Depending on the axioms we add, we obtain different visibility
relations.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
67 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
Depending on the axioms we add, we obtain different visibility
relations.
System K =axiom K, induces R as any arbitrary relation.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
67 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
Depending on the axioms we add, we obtain different visibility
relations.
System K =axiom K, induces R as any arbitrary relation.
System T . T = K + T, induces a reflexive relation R, that is wRw
for all w.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
67 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
Depending on the axioms we add, we obtain different visibility
relations.
System K =axiom K, induces R as any arbitrary relation.
System T . T = K + T, induces a reflexive relation R, that is wRw
for all w.
System D (Deontic). D = K + D, where
D Lp → Mp
induces (serial frames): for all w, there exists w 0 , wRw 0 .
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
67 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
System S4 (epistemic), S4 = T + 4 = K + T + 4, where
4 Lp → LLp
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
68 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
System S4 (epistemic), S4 = T + 4 = K + T + 4, where
4 Lp → LLp
Lp used to model “belief” (agent believes p).
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
68 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
System S4 (epistemic), S4 = T + 4 = K + T + 4, where
4 Lp → LLp
Lp used to model “belief” (agent believes p).
Kripke frames: R reflexive and transitive.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
68 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
System S4 (epistemic), S4 = T + 4 = K + T + 4, where
4 Lp → LLp
Lp used to model “belief” (agent believes p).
Kripke frames: R reflexive and transitive.
Very important relation to intuitionistic logic established by
[Gödel32].
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
68 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
System S5, S5 = T + 5 = K + T + 5, where
5 Lp → LMp
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
69 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
System S5, S5 = T + 5 = K + T + 5, where
5 Lp → LMp
Kripke frames: R is an equivalence: reflexive, symmetric and
transitive.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
69 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
System S5, S5 = T + 5 = K + T + 5, where
5 Lp → LMp
Kripke frames: R is an equivalence: reflexive, symmetric and
transitive.
S5 usually captures an agent’s knowledge:
Lp → p “if I know p then p is true”.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
69 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
System S5, S5 = T + 5 = K + T + 5, where
5 Lp → LMp
Kripke frames: R is an equivalence: reflexive, symmetric and
transitive.
S5 usually captures an agent’s knowledge:
Lp → p “if I know p then p is true”.
When Lp is a belief, it does not imply p.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
69 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
System S5, S5 = T + 5 = K + T + 5, where
5 Lp → LMp
Kripke frames: R is an equivalence: reflexive, symmetric and
transitive.
S5 usually captures an agent’s knowledge:
Lp → p “if I know p then p is true”.
When Lp is a belief, it does not imply p.
Logics for dealing with beliefs: stronger than S4 butnon-reflexive.
In particular . . .
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
69 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
System KD45. We change T by D + 4
KD45 = K + D
+ 4} +5
| {z
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
70 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
System KD45. We change T by D + 4
KD45 = K + D
+ 4} +5
| {z
Kripke frames: R transitive, serial and euclidean (if wRu and wRv
then uRv ).
w
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
70 / 123
Survey of NMR formalisms
Autoepistemic Logic
Systems and their accessibility relation
System KD45. We change T by D + 4
KD45 = K + D
+ 4} +5
| {z
Kripke frames: R transitive, serial and euclidean (if wRu and wRv
then uRv ).
w
It can be used as underlying framework for Autoepistemic Logic.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
70 / 123
Survey of NMR formalisms
Autoepistemic Logic
Back to Autoepistemic Logic
How do we transform a modal logic into a nonmonotonic
framework?
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
71 / 123
Survey of NMR formalisms
Autoepistemic Logic
Back to Autoepistemic Logic
How do we transform a modal logic into a nonmonotonic
framework?
We can use a syntactic fixpoint definition [McDermott 80]. For
AEL we have
Definition (Expansion)
A logically closed theory E is an expansion of a theory Γ iff:
E = Cn(Γ ∪ {Lα | α ∈ E} ∪ {¬Lα | α 6∈ E})
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
71 / 123
Survey of NMR formalisms
Autoepistemic Logic
Back to Autoepistemic Logic
How do we transform a modal logic into a nonmonotonic
framework?
We can use a syntactic fixpoint definition [McDermott 80]. For
AEL we have
Definition (Expansion)
A logically closed theory E is an expansion of a theory Γ iff:
E = Cn(Γ ∪ {Lα | α ∈ E} ∪ {¬Lα | α 6∈ E})
Cn means propositional consequences; logically closed means
using propositional logic and dealing with Lα as atoms.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
71 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
P. Cabalar
Or we can provide a semantic, models selection criterion.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
72 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
P. Cabalar
Or we can provide a semantic, models selection criterion.
Simplified semantics: we have interpretations like (S, I) where I is
a propositional interpretation, and S a set of them.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
72 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
P. Cabalar
Or we can provide a semantic, models selection criterion.
Simplified semantics: we have interpretations like (S, I) where I is
a propositional interpretation, and S a set of them.
Satisfaction:
1
(S, I) |= p iff p ∈ I.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
72 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
P. Cabalar
Or we can provide a semantic, models selection criterion.
Simplified semantics: we have interpretations like (S, I) where I is
a propositional interpretation, and S a set of them.
Satisfaction:
1
(S, I) |= p iff p ∈ I.
2
∧, ∨, →, ¬ as always.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
72 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
P. Cabalar
Or we can provide a semantic, models selection criterion.
Simplified semantics: we have interpretations like (S, I) where I is
a propositional interpretation, and S a set of them.
Satisfaction:
1
(S, I) |= p iff p ∈ I.
2
∧, ∨, →, ¬ as always.
3
(S, I) |= Lα iff for all J ∈ S, (S, J) |= α.
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
72 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
P. Cabalar
Or we can provide a semantic, models selection criterion.
Simplified semantics: we have interpretations like (S, I) where I is
a propositional interpretation, and S a set of them.
Satisfaction:
1
(S, I) |= p iff p ∈ I.
2
∧, ∨, →, ¬ as always.
3
(S, I) |= Lα iff for all J ∈ S, (S, J) |= α.
The semantic counterpart of expansion E is a set of
interpretations S such that:
S = {I | (S, I) |= Γ}
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
72 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
P. Cabalar
Or we can provide a semantic, models selection criterion.
Simplified semantics: we have interpretations like (S, I) where I is
a propositional interpretation, and S a set of them.
Satisfaction:
1
(S, I) |= p iff p ∈ I.
2
∧, ∨, →, ¬ as always.
3
(S, I) |= Lα iff for all J ∈ S, (S, J) |= α.
The semantic counterpart of expansion E is a set of
interpretations S such that:
S = {I | (S, I) |= Γ}
Relating E to S:
α ∈ E iff for all J in S, (S, J) |= α
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
72 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
An example. Take Γ:
german ∧ ¬L ab → drinks
german
Let’s check that S = {{german, drinks}, {german, ab, drinks}} is
an expansion.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
73 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
An example. Take Γ:
german ∧ ¬L ab → drinks
german
Let’s check that S = {{german, drinks}, {german, ab, drinks}} is
an expansion.
From S we get the beliefs L german, L drinks and ¬L ab.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
73 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
An example. Take Γ:
german ∧ ¬L ab → drinks
german
Let’s check that S = {{german, drinks}, {german, ab, drinks}} is
an expansion.
From S we get the beliefs L german, L drinks and ¬L ab.
This together with Γ allows concluding german, drinks. Atom ab is
left free: we have two possible models.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
73 / 123
Survey of NMR formalisms
Autoepistemic Logic
Autoepistemic Logic
An example. Take Γ:
german ∧ ¬L ab → drinks
german
Let’s check that S = {{german, drinks}, {german, ab, drinks}} is
an expansion.
From S we get the beliefs L german, L drinks and ¬L ab.
This together with Γ allows concluding german, drinks. Atom ab is
left free: we have two possible models.
Check that, for instance, that
S 0 = {{german, ab}, {german, ab, drinks}} is not an expansion.
P. Cabalar
( Depto. Computación
Intro to KR andUniversity
NMR
of Corunna, SPAIN )
June 29, 2010
73 / 123