ontologies reasoning components agents simulations first-order classical deduction jacques robin
Post on 19-Dec-2015
220 Views
Preview:
TRANSCRIPT
OntologiesReasoningComponentsAgentsSimulations
First-Order Classical DeductionFirst-Order Classical Deduction
Jacques Robin
OutlineOutline
Classical First-Order Logic (CFOL) Syntax
Full CFOL Implicative Normal Form CFOL (INFCFOL) Horn CFOL (HCFOL)
Semantics First-order interpretations and models
Reasoning Lifting propositional reasoning to first-order reasoning INFCFOL reasoning:
First-order resolution
An ontology of logics and engines Properties of logics
Commitments, complexity Properties of inference engines
Soundness, completeness, complexity
Full Classical First-Order Logic Full Classical First-Order Logic (FCFOL): syntax(FCFOL): syntax
Syntax
FCLUnaryConnective
Connective: enum{}
FCLBinaryConnective
Connective: enum{, , , }
FCLConnective FCFOLFormulaFunctor
QuantifierExpression
Quantifier: enum{,}
*
Arg1..2
FCFOLAtomicFormula
PredicateSymbol
FCFOLTerm
Arg1..*
FCFOLFunctionalTermFCFOLNonFunctionalTerm
Arg1..*
FunctionSymbolConstantSymbolFOLVariable
Arg1..*
X,Y (p(f(X),Y) q(g(a,b))) (U,V Z ((X = a) r(Z)) (U = h(V,Z))))
Functor
Functor
FCFOL Normal FormsFCFOL Normal Forms
FCFOLAtomicFormula
PredicateSymbol
FCFOLTerm
Arg1..*
FCFOLFunctionalTerm
FCFOLNonFunctionalTerm
Arg1..*
FunctionSymbolConstantSymbolFOLVariable
Functor
Functor
Conjunctive Normal Form (CNF)
CNFCFOLFormula
Functor =
CNFCFOLClause
Functor =
NegativeLiteral
Functor =
Literal* *
INFCFOLFormula
Functor =
INFCFOLClause
Functor =
INFCLPLHS
Functor =
INFCLPRHS
Functor =
Premisse
Conclusion
**
*
Implicative Normal Form (INF)
*
Horn CFOL (HCFOL)Horn CFOL (HCFOL)
INFCFOLFormula
Functor =
INFCFOLClause
Functor =
INFCFOLLHS
Functor = Premisse
Conclusion
Implicative Normal Form (INF)
Conjunctive Normal Form (CNF)
CNFCFOLFormula
Functor =
CNFCFOLClause
Functor =
NegativeLiteral
Functor =
Literal
*
*
* *
DefiniteClause
IntegrityConstraint
Fact
DefiniteClause
IntegrityConstraint
Fact
context IntegrityConstraint inv IC: Conclusion.ConstantSymbol = false
context DefiniteClause inv DC: Conclusion.ConstantSymbol false
context Fact inv Fact: Premisse -> size() = 1 and Premisse -> ConstantSymbol = true
context IntegrityConstraint inv IC: Literal->forAll(oclIsKindOf(NegativeLiteral))
context DefiniteClause inv DC: Literal.oclIsKindOf(ConstantSymbol)->size() = 1
context Fact inv Fact: Literal->forAll(oclIsKindOf(ConstantSymbol))
FCFOLAtomicFormula
FCFOLNonGroundTerm
FCFOL semantics: FCFOL semantics: cognitive interpretationscognitive interpretations
Syntax
FCFOLFormulaArg1..2
FCFOLAtomicFormula
PredicateSymbol
FCFOLTerm
Arg1..*
FCFOLFunctionalTermFCFOLNonFunctionalTerm
Arg1..*
FunctionSymbolConstantSymbolFOLVariable FCFOLGroundTerm
SimpleEntityProperty
SimpleRelation
*
EntitySet *
ComplexEntityProperty
ComplexRelation *
*
EntityName
ConstantMapping FunctionMapping
EntityPropertyName
RelationName
PredicateMapping
Entity
*
Semantics
TruthValue
Value: enum{true,false}
EntitySet
FCFOLNonGroundTerm
FCFOL semantics: FCFOL semantics: cognitive interpretationscognitive interpretations
Syntax
FCFOLFormulaArg1..2
FCFOLAtomicFormula
PredicateSymbol
FCFOLTerm
Arg1..*
FCFOLFunctionalTermFCFOLNonFunctionalTerm
Arg1..*
FunctionSymbolConstantSymbolFOLVariable
EntityPropertyName
RelationName EntityName
SimpleEntityProperty
SimpleRelation
Entity
FCFOLGroundTerm
ComplexEntityProperty
ComplexRelation
*
*
*
*
TruthValue
Value: enum{true,false}
NounGroundTermMapping GroundTermMappingAtomMapping
*
Semantics
FormulaMapping
TruthMapping
FCFOL semantics: FCFOL semantics: cognitive interpretationscognitive interpretations
FCFOLFormula
NounGroundTermMapping
AtomMapping
GroundTermMapping
FormulaMapping
TruthMapping
ConstantMapping
PredicateMapping
FunctionMapping
FCFOLCognitiveInterpretation
semantics
FCFOL semantics: FCFOL semantics: Herbrand interpretationsHerbrand interpretations
Herbrand universe Uh of FCFOL formula k: Set of all terms built from constant and function symbols appearing
in k Uh(k) = {t = f(t1,...,tn) | f functions(k), ti constants(k) Uh(k)}
ex: k = {parent(joe,broOf(dan)) parent(broOf(dan),pat) (A,D anc(A,D) (parent(A,D) (P anc(A,P) parent(P,D))))} Uh(k) = {joe,dan,pat,broOf(joe),broOf(dan),broOf(pat), broOf(broOf(joe), broOf(broOf(dan), broOf(broOf(pat), ...}
Herbrand base Bh of FCFOL formula k: Set of all atomic formulas built from predicate symbols appearing in
k and Herbrand universe elements as arguments Bh = {a = p(t1,...,tn) | p predicates(k), ti Uh(k)}
ex: Bh = {parent(joe,joe), parent(joe,dan),..., parent(broOf(pat),broOf(pat)),..., anc(joe,joe), anc(joe,dan),..., anc(broOf(pat),broOf(pat)},...}
FCFOL semantics: FCFOL semantics: Herbrand interpretationsHerbrand interpretations
Herbrand interpretation Ih of FCFOL formula k: Truth valuation of Herbrand base Ih(k): Bh(k) {true,false} ex: {parent(joe,joe) = false, ...parent(joe,dan) = true, ...
parent(broOf(pat),broOf(pat))= false, ... anc(joe,joe) = true, ..., anc(joe,dan) = true}
Herbrand modelmodel Mh of FCFOL formula k: Interpretation Ih(k) in which k is true
ex, Mh(k) = {parent(joe,broOf(dan)) = true, parent(broOf(dan),pat) = true, anc(joe,brofOf(dan)) = true, anc(joe,pat) = true, all others members of Bh(k) = false }
FCFOLNonGroundTerm
FCFOL semantics: FCFOL semantics: Herbrand interpretationsHerbrand interpretations
Syntax
FCFOLFormulaArg1..2
FCFOLAtomicFormula
PredicateSymbol
FCFOLTerm
Arg1..*
FCFOLFunctionalTermFCFOLNonFunctionalTerm
Arg1..*
FunctionSymbolConstantSymbolFOLVariable FCFOLGroundTerm
Semantics
HerbrandUniverse
HerbrandModel
TruthValue
Value: enum{true,false}
AtomValuationHerbrandInterpretation
Herbrandsemantics
HerbrandBase
1..*
Reasoning in CFOLReasoning in CFOL
Key difference between CFOL and CPL? Quantified variables which extend expressive power of CPL Ground terms do not extend expressive power of CPL
Alone, they are merely syntactic sugar i.e, clearer for the knowledge engineer but equivalent to constant
symbols for an inference engine ex, anc(joe,broOf(dan)) ancJoeBroOfDan,
loc(agent,step(3),coord(2,2)) locAgent3_2_2
How to reason in CFOL? Reuse CPL reasoning approaches, principles and engines!
Fully (formulas propositionalization) transforms CFOL formulas into CPL formulas as preprocessing step
Partially (inference method generalization) lift CPL reasoning engines with new, variable handling component
(unification) all CPL approaches free of exhaustive truth value enumeration can be
lifted to CFOL
PropositionalizationPropositionalization
Variable substitution function Subst(,k): Given a set of pairs variable/constant, Subst(,k) = formula obtained from k by substituting its variables
with their associated constants in Subst({X/a,Y/b}, X,Y,Z p(X,Y) q(Y,Z)) (Z p(a,b) q(b,Z))
Substitutes CFOL formula k by conjunction of ground formulas ground(k) generated as follows: For each universally quantified variable X in k and each v Uh(k)
Add Subst({X/v},k) to the conjunction For each existentially quantified variable Y in k
Add Subst({Y/s},k) to the conjunction where s is a new Skolem ground term, i.e. s Uh(k)
Skolem term to eliminate existentially quantified variable Y in scope of outer universal quantifier Q must be function of the variables quantified by Q
ex, Y X,Z p(X,Y,Z) becomes X,Z p(X,a,Z))but X,Z Y p(X,Y,Z) becomes X,Z p(X,f(X,Z),Z)
PropositionalizationPropositionalization
Get prop(k) from ground(k) by turning each ground atomic formula into an equivalent constant symbol through concatenation of its predicate, function and constant symbol
Example: k = parent(joe,broOf(dan)) parent(broOf(dan),pat)
(A,D anc(A,D) (parent(A,D) (P anc(A,P) parent(P,D)))) ground(k) = parent(joe,broOf(dan)) parent(broOf(dan),pat)
(anc(joe,joe) (parent(joe,joe) (anc(joe,s1(joe,joe) parent(s1(joe,joe),joe)))
(anc(joe,broOf(dan)) (parent(joe,broOf(dan)) (anc(joe,s2(joe,broOf(dan))) parent(s2(joe,broOf(dan)),joe))) ... ... (anc(pat,pat) (parent(pat,pat) (anc(pat,sn(pat,pat)) parent(sn(pat,pat),pat))))
prop(k) = parentJoeBroOfDan parentBroOfDanPat (ancJoeJoe (parentJoeJoe (ancJoeS1JoeJoe parentS1JoeJoeJoe))) (ancJoeBroOfDan (parentJoeBroOfDan (ancJoeS2JoeBroOfDan parentS2JoeBroOfDanJoe ... ... (ancPatPat (parentPatPat (ancPatSnPatPat parentSnPatPatPat)))
PropositionalizationPropositionalization
k |=CFOL k’ iff prop(k) |=CPL prop(k’)
Fixed-depth Herbrand base: Uh(k,d) = {f Uh(k) | depth(f) = d}
Fixed-depth propositionalization: prop(k,d) = {c1 ... cn | ci built only from elements in Uh(k,d)}
Thm de Herbrand: prop(k) |=CPL prop(k’) d, prop(k,d) |=CPL prop(k’,d)
For infinite prop(k) prove prop(k) |=CPL prop(k’) iteratively: try proving prop(k,0) |=CPL prop(k’,0),
then prop(k,1) |=CPL prop(k’,1),
... until prop(k,d) |=CPL prop(k’,d)
First-Order Term UnificationFirst-Order Term Unification
p
a X
p
Y b
p
a X
p
Y f
c Z
X/f(c,Z)
Y/a
p
a f
c Z
p
a b
X/b
Y/a
p
a X
p
X b
fail
X/b
X/a
p
a X
p
Y f
c Z
p
a f
c d
X/f(c,d)
Y/a
Z/d
p
a X
Xfail
X/p(a,X)
Failure by Occur-Check
p
a X
X X/p(a,X) p
a p
c pGuarantees termination
Lifted inference rulesLifted inference rules
Bi-direction CPL rules trivially lifted as valid CFOL rules by substituting CPL formulas inside them by CFOL formulas
Lifted modus ponens: Subst(,p1), ..., Subst(,pn), (p1 ... pn c) |= Subst(,c)
Lifted resolution: l1 ... li ... lk, m1 ... mj ... mk, Subst(,li) = Subst(,mj)
|= Subst(, l1 ... li-1 li-1... lk m1 ... mj-1 mj-1... mk) CFFOL inference methods (theorem provers):
Multiple lifted inference rule application Repeated application of lifted resolution and factoring
CHFOL inference methods (logic programming): First-order forward chaining through lifted modus ponens First-order backward chaining through lifted linear unit resolution
guided by negated query as set of support Common edge over propositionalization: focus on relevant
substitutions
FCFOL theorem proving by repeated FCFOL theorem proving by repeated lifted resolution and factoring: lifted resolution and factoring:
exampleexample
Deduction with equalityDeduction with equality
Axiomatization: Include domain independent sub-formulas defining equality in the KB (X X = X) (X,Y X = Y Y = X) (X,Y,Z (X = Y Y = Z) X = Z)
(X,Y X = Y (f1(X) = f1(Y) ... fn(X) = fn(Y)) (X,Y,U,V (X= Y U = V) f1(X,U) = f1(Y,V) ... fn(X,U) = fn(Y,V)) ...
(X,Y X = Y (p1(X) p1(Y) ... pm(X) pm(Y))
(X,Y,U,V (X= Y U = V) p1(X,U) p1(Y,V) ... pm(X,U) pm(Y,V)) ...
New inference rule (parademodulation): l1 ... lk t = u, m1 ... mn(...,v,...)
|= Subst(unif(t,v), l1 ... lk m1 ... mn(...,y,...))
ex, Extend unification to check for equality
ex, if a = b + c, then p(X,f(a)) unifies with p(b,f(X+c)) with {X/b}
Characteristics of logics and Characteristics of logics and knowledge representation languagesknowledge representation languages
Commitments: ontological: meta-conceptual elements to model agent’s environment epistemological: meta-conceptual elements to model agent’s beliefs
Hypothesis and assumptions: Unique name or equality theory open-world or closed-world
Monotonicity: if KB |= f, then KB g |= f Semantic compositionality:
semantics(a1 c1 a2 c2 ... cn-1 an) = f(semantics(a1), ... ,semantics(an) ex, propositional logic truth tables define functions to compute
semantics of a formula from semantics of its parts Modularity
semantics(ai) independent from its context in larger formulas
ex, semantics(a1) independent of semantics(a2), ... , semantics(an) in contrast to natural language
Characteristics of logics and Characteristics of logics and knowledge representation languagesknowledge representation languages
Expressive power: theoretical (in terms of language and grammar theory) practical: concisely, directly, intuitively, flexibly, etc.
Inference efficiency: theoretical limits practical limits due to availability of implemented inference
engines Acquisition efficiency:
easy to formulate and maintain by human experts possible to learn automatically from data (are machine learning
engines available?)
Characteristics of logics and Characteristics of logics and knowledge representation languagesknowledge representation languages
Logic / Knowledge Representation Language
Ontological commitment Epistemic commitment
NameHypothesis
World Hypothesis
Decidable Modular
Classical Propositional Logic facts true, false unique name open yes yes
Classical First-Order Logic entities, relations and functions among entities
true, false entity name = open semi yes
Classical High-Order Logic entities, relations and functions among entities, relations and functions
true, false entity, relation, function name =
open no yes
Propositional Temporal Logic properties, time points, time intervals
true, false unique name open ? yes
Propositional Modal Logic facts true, false, possible,
necessary
unique name open yes yes
Bayesian Networks facts [0,1] unique name closed yes no
Definite Logic Programs entities, relations and functions among entities
true, false unique name closed semi yes
Event Calculus entities, relations and functions among entities, time points, time intervals,
events
true, false, unknown
unique name closed semi +/-
Characteristics of logics and Characteristics of logics and knowledge representation languagesknowledge representation languages
Logic / Knowledge Representation Language
Ontological commitment Epistemic commitment
NameHypothesis
World Hypothesis
Decidable Modular
UML classes, objects, attributes, methods, associations, generalizations, compositions, aggregations
? ? ? ? yes
OCL classes, objects, ..., invariant constraints, pre and post condition constraints
? ? ? ? yes
Bayesian Logic Programs entities, functions and relations of entities
[0,1] unique closed semi no
CHRD entities, functions and relations of entities
true, false unique closed semi yes
Transaction Frame Logic classes, objects, attributes, methods, generalizations, entities, functions and relations among entities, functions, relations, classes, objects, attributes, methods, generalizations
true, false, unknown
object = closed semi yes
Characteristics of inference enginesCharacteristics of inference engines
Engine inference: f |-E g, if engine E infers g from f
Engine E sound for logic L: f |-E g only if f |=L g
Engine E fully complete for logic L: if f |=L g, then f |-E g
if f |L g, then (f g) |-E false
Engine E refutation-complete for logic L: if f |=L g, then f |-E g
but if f |L g, then either (f g) |-E false or inference never terminates (equivalent to halting problem)
Engine inference complexity: exponential, polynomial, linear, logarithmic in KB size
Some theoretical results about logics Some theoretical results about logics and inference methodsand inference methods
Results about logic: Satisfiability of full classical propositional logic formula is decidable
but exponential Entailment between two full classical first-order logic formulas is
semi-decidable Entailment between two full classical high-order logic formulas is
undecidable Results about inference methods:
Truth-table model checking, multiple inference rule application resolution-factoring application and DPLL are sound and fully complete for full classical propositional logic
WalkSAT sound but fully incomplete for full classical propositional logic
Forward-chaining and backward chaining sound, fully complete and worst-case linear for Horn classical propositional logic
Lifted resolution-factoring sound, refutation complete and worst case exponential for full classical first-order logic
top related