Overview of Non-Monotonic Reasoning
Download
Report
Transcript Overview of Non-Monotonic Reasoning
Default Reasoning and
Negation As Failure
in General Logic Programming
Jacques Robin
Ontologies
Reasoning
Components
Agents
Simulations
Outline
Default Logic
Syntax
Semantics
Examples
Limitations
Negation As Failure (NAF) in General Logic Programming (GLP)
GLP Syntax
GLP Example
GLP Declarative Logical Semantics: Clark’s Completion
Limitation of Clark’s Completion
GLP Operational Semantics: SLDNF Resolution
Default Reasoning (DR)
Extends deduction with certain knowledge and inference rules
with derivation of uncertain but plausible default assumption
knowledge and inference rules
for environment properties not known with certainty but needed for
decision making
Example DR inference rules:
Closed-World Assumption (CWA)
Inheritance with overriding
Classical DR knowledge example:
KB:
X (bird(X) > flies(X)
// default knowledge
penguin(X) flies(X)
pigeon(X) bird(X)
penguin(X) bird(X))
pigeon(valiant)
penguin(tux)
KB |= flies(valiant) flies(tux)
Default Logic: Syntax
Normal
Default
Theory
drb
1..*
ndrb
{subset drb}
prerequisite
justification
Default
Rule
Base Logic
Formula
conclusion
1..*
Default rule: (P:J/C) where,
P: prerequisite formula
J: justification formula
/extension
C: conclusion formula
e.g.,
And
quaker(X)
/groundExtension
Base
: (pacifist(X) political(X))
{subset extension}
Logic
/ pacifist(X)
Formula
Default
Theory
Normal
Default
Rule
Classical Full
First-Order
Logic Formula
inv: connective.name = “and”
Classical Full
Propositional
Logic Formula
Classical Horn
First-Order
Logic Formula
inv: justification = conclusion
Classical INF
Propositional
Logic Formula
Classical INF
First-Order
Logic Formula
Classical Horn
Propositional
Logic Formula
Normal default rule: P ~> C
alias for P:C/C
e.g., bird(X) ~> flies(X)
alias for
bird(X) : flies(X) / flies(X)
Default Logic: Semantics
drb
1..*
Default
Rule
Default theory K = (L,D) where
Default
Theory
/extension
*
prerequisite
justification
conclusion
Base Logic
Formula
And
Base
Logic
Formula
/groundExtension
{subset extension}
L = l1 ... ln
is an and base logic formula,
Ls = {l1, ..., ln}, and
D is the default rule base
Extension E(K) = e1 ... em |
ei 1i m, (Ls {c | (p:j/c D) p{e1, ..., em} j{e1, ..., em}) |= ei
(Ls) = {d1, ..., dn} defined as
minimal superset of Ls, i.e., (Ls (Ls)) (S, Ls S (Ls) S)
closed under entailment, i.e., f, d1 ... dn | f f{d1, ..., dn}
such that: p:j/c D p(Ls) jLs c(Ls)
Ground Extension Eg(K) = g1 ... gm | Eg(K) = (Eg(K))
Default Logic: Examples
If K1 = (L1,D1), where
L1 = (X penguin(X) flies(X)) (X pigeon(X) bird(X)) (X penguin(X) bird(X))
pigeon(valiant) penguin(tux)
D1 = (X bird(X) ~> flies(X))
Then E(K1) = Eg(K1) L1 flies(valiant) flies(tux) is the sole extension of K1
If K2 = (L2,D2), where
L2 = quaker(nixon) republican(nixon)
D2 = (X quaker(X) ~> pacifist(X)) (X republican(X) ~> pacifist(X))
Then {E1(K2) = L2 pacifist(nixon), E2(K2) = L2 pacifist(nixon)} are the two extensions of K2
A skeptical default reasoner will derive the intersection of all extensions: Es(K2) = L2
A credulous default reasoner will derive one of the extensions, e.g., Ec(K2) = L2 pacifist(nixon)}
Both approaches equally problematic in such cases:
Skeptical derivation equivalent to not leveraging default knowledge
Credulous derivation lacks criteria to choose among alternative extensions
If K3 = (L3,D3), where
L3 = quaker(nixon) republican(nixon) (X republican(X) political(X)) republican(carter)
quaker(carter)
D3 = (X (quaker(X) : (pacifist(X)) political(X)) / pacifist(X)) (X republican(X) ~> pacifist(X))
Then E1(K3) = L3 pacifist(nixon) pacifist(carter) is the sole extension of K3
General Logic Programs (GLP):
Abstract Syntax
GLP
gc 2..*
body *
GLP
Clause
head
predicate
GLP
Literal
arg
arg 1..*
1..* {disjoint,
{disjoint, complete}
complete}
FOL
{disjoint, complete}
Fact
DLP
2..*
{subset gc}
DLP
Clause
GLP
Rule
dBody
{subset body}
GLP
Query
FOL
Atom
FOL
Ground
Atom
a
ga
FOL
Atom
Term
GLP NAF
Literal
GLP
Ground
NAF
Literal
Ground
Term
Non
Ground
Term
Non
Functional
Term
Variable
{subset a}
context Fact inv: body->IsEmpty()
context GLPQuery inv: head->IsEmpty() and body->forall(oclIsKindOf(FOLAtom) or oclIsKindOf(GLPGroundNAFLiteral))
context GLPRule inv: head->NotEmpty() and body->NotEmpty()
context GroundTerm inv: oclIsKindOf(Symbol) or arg->forall(oclIsKindOf(GroundTerm))
context GroundFOLAtom inv: arg->forall(oclIsKindOf(GroundTerm))
Functional
Term
functor
Symbol
GLP Declarative Logical Semantics:
Clark’s Completion
Partitions program in clause sets, each one defining one predicate
(i.e., group together clauses with same predicate c(t1, ..., tn) as
conclusion)
Replaces each such set by a logical equivalence
One side of this equivalence contains c(X1, ..., Xn) where X1, ..., Xn are
fresh universally quantified variables
The other side contains a disjunction of conjunctions, one for each
original clause
Each conjunction is either of the form:
Xi = ci ... Xj = cj, if the original clause is a ground fact
Yi ... Yj Xi = Yi ... Xj = Yj p1(...) ... pk(...) l1(...) ... ll(...)
if the original clause is a rule with body l1(...),...,ln(...),naf l1(...),...,naf ll(...)
containing variables Yi ... Yj
Joins all resulting equivalences in a conjunction
Adds conjunction of the form (ci = cj) for all possible pairs (ci,cj) of
constant symbols in pure Prolog program
GLP Clark’s Completion Semantics:
Example
P: founding(X) :- on(Y,X), onGround(X).
onGround(X) :- naf offGround(X).
offGround(X) :- on(X,Y)
on(c,b).
on(b,a).
comp(P): (A (founding(A) (X,Y (A = X on(Y,X) onGround(X)))
(A (onGround(A) (X (A = X offGround(X))
(A (offGround(A) (X,Y (A = X on(X,Y)))
(U,V (on(U,V) ((U = c V = b) (U = b V = a))))
C
B
A
GLP Operational Semantics:
SLDNF Resolution Principle
1. Consume the query literals Q1, ..., Qn from left to right
2. For each positive literal atom Qi = a
a. Call SLD resolution of a
b. If it finitely succeeds, then go to next literal, propagating to it the
unification substitutions executed during the successful SLD resolution
c. Else, if it finitely fails, then return fail
3. For each negative literal atom Qi = naf b
a. Call SLD resolution on b
b. If it finitely succeeds, then return fail
c. Else, if it finitely fails, then go to next literal, propagating to it the
unification substitutions executed during the successful SLD resolution
GLP Operational Semantics:
SLDNF Resolution Example
P: founding(X) :- on(Y,X), onGround(X).
onGround(X) :- naf offGround(X).
offGround(X) :- on(X,Y)
on(c,b).
on(b,a).
C
B
A
GLP Clark’s Completion Semantics:
Limitations
Only valid for stratified GLP
i.e., GLP with no (direct or indirect)
recursion through naf
In a GLP P,
an atom A directly depends on an atom B
iff P contains one clause with A as head and
B in its body
The dependencies of a GLP can be drawn as
a directed graph
The GLP is stratified iff its dependency
graph contains no loop with a naf node
Example of non-stratified GLP
man(X) :- human(X), naf woman(X).
woman(X) :- human(X), naf man(X).
female(X) :- woman(X).
human(roberta).
? – man(roberta)
...
man(X)
naf
human(X)
female(X)
naf
founding(X)
woman(X)
onGround(X)
Strata 1
Strata 0
on(Y,X)
naf
offGround(X)
GLP Clark’s Completion Semantics:
Limitations
P:
edge(a,b). edge(c,d). edge(d,c).
reachable(a).
reachable(X) :- edge(Y,X), reachable(Y).
sink(X) :- not edge(X,Y).
?- reachable(c)
...............
?- sink(b).
yes
?- sink(X).
no
comp(P):
edge(a,b) edge(c,d) edge(d,c)
(Vx reachable(Vx) (Vx = a Vx = X
Y (edge(Y,X) reachable(Y))))
((Vu sink(Vu) (Vu = U V edge(V,U)))
a
c
b
d
Limitation 1:
comp(P) | reachable(c).
comp(P) | reachable(d).
reachable(c)
(c=a Y(edge(Y,c) reachable(Y))
Y edge(Y,c) reachable(Y)
reachable(d)
Limitation 2 (Floundering):
comp(P) | sink(b)
sink(b) (b=U V edge(V,U))
V edge(V,U) b=U