ontologies reasoning components agents simulations default reasoning and negation as failure in...
Post on 15-Jan-2016
231 Views
Preview:
TRANSCRIPT
OntologiesReasoningComponentsAgentsSimulations
Default Reasoning andDefault Reasoning andNegation As FailureNegation As Failure
in General Logic Programmingin General Logic Programming
Jacques Robin
OutlineOutline
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)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: SyntaxDefault Logic: Syntax
Default rule: (P:J/C) where, P: prerequisite formula J: justification formula C: conclusion formula e.g., quaker(X) : (pacifist(X) political(X)) / pacifist(X)
Normal default rule: P ~> C alias for P:C/C
e.g., bird(X) ~> flies(X) alias for bird(X) : flies(X) / flies(X)
DefaultTheory
conclusion
prerequisite
justificationDefaultRule
1..*
drb
Classical FullFirst-Order
Logic Formula
Classical FullPropositionalLogic Formula
Classical HornPropositionalLogic Formula
Classical HornFirst-Order
Logic Formula
Classical INFFirst-Order
Logic Formula
Classical INFPropositionalLogic Formula
/extension
/groundExtension{subset extension}
NormalDefaultTheory
1..*
ndrb{subset drb}
NormalDefault
Rule
inv: justification = conclusion
inv: connective.name = “and”
Base LogicFormula
AndBaseLogic
Formula
Default Logic: SemanticsDefault Logic: Semantics
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 theory K = (L,D) where L = l1 ... ln
is an and base logic formula, Ls = {l1, ..., ln}, and
D is the default rule base
DefaultTheory
conclusion
prerequisite
justificationDefaultRule
1..*
drb/extension
/groundExtension{subset extension}
Base LogicFormula
AndBaseLogic
Formula
*
Default Logic: ExamplesDefault Logic: Examples
If K1 = (L1,D1), whereL1 = (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), whereL2 = 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), whereL3 = 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
{disjoint, complete}
General Logic Programs (GLP):General Logic Programs (GLP):Abstract SyntaxAbstract Syntax
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))
GLPGLP
ClauseGLP
Literal
FOLAtom
GLP NAFLiteral
DLPDLP
Clause
GLPQuery
FOLGroundAtom
gc 2..* body *
head
GLPGround
NAFLiteral
Fact GLPRule
2..*
{subset gc} dBody{subset body}
a
ga
FOLAtom
Symbol
predicate
arg 1..*
FOLTerm
NonFunctional
Term
Variable
FunctionalTerm
GroundTerm
NonGround
Term
{disjoint, complete}{disjoint, complete}
arg
1..*
functor
{subset a}
GLP Declarative Logical Semantics: GLP Declarative Logical Semantics: Clark’s CompletionClark’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: GLP Clark’s Completion Semantics: ExampleExample
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:GLP Operational Semantics:SLDNF Resolution PrincipleSLDNF 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 ab. 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 bb. If it finitely succeeds, then return failc. 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:GLP Operational Semantics:SLDNF Resolution ExampleSLDNF 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: GLP Clark’s Completion Semantics: LimitationsLimitations
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 Biff 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 GLPman(X) :- human(X), naf woman(X).
woman(X) :- human(X), naf man(X).
female(X) :- woman(X).
human(roberta).
? – man(roberta)
...
founding(X)
on(Y,X)
onGround(X)
offGround(X)
nafStrata 1
Strata 0
man(X)
human(X)
woman(X)
female(X)
nafnaf
GLP Clark’s Completion Semantics: GLP Clark’s Completion Semantics: LimitationsLimitations
P: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):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)))
Limitation 1: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):Limitation 2 (Floundering):comp(P) | sink(b)
sink(b) (b=U V edge(V,U))
V edge(V,U) b=U
a
b
c
d
top related