# First-Order Classical Deduction

Document Sample

```					Deduction

Jacques Robin

Ontologies
Reasoning
Components
Agents
Simulations
Outline

 Classical Propositional Logic (CPL)            Classical First-Order Logic (CFOL)
Syntax                                             Syntax
 Full CPL                                          Full CFOL
 Implicative Normal Form CPL (INFCPL)              Implicative Normal Form CFOL
 Horn CPL (HCPL)                                    (INFCFOL)
 CPL Semantics                                         Horn CFOL (HCFOL)
 Cognitive and Herbrand interpretations,        Semantics
models                                            First-order interpretations and models
 CPL Reasoning                                      Reasoning
 FCPL Reasoning                                    Lifting propositional reasoning to first-
 Truth-tabel based model checking               order reasoning
 Multiple inference rules                      INFCFOL reasoning:
 INFCPL Reasoning                                        First-order resolution

 Resolution and factoring              An ontology of logics and engines
 DPLL
 Properties of logics
 WalkSat
 Commitments, complexity
 HCPL Reasoning
 Forward chaining                           Properties of inference engines
 Backward chaining                             Soundness, completeness, complexity
Full Classical Propositional Logic (FCPL):
syntax
Syntax

FCPLBinaryConnective            FCPLUnaryConnective
Connective: enum{, , , }       Connective: enum{}
(a  (b  ((c  d)  a)  b))

Functor                      Arg
FCPLConnective                FCPLFormula      1..2     ConstantSymbol
CPL Normal Forms
Implicative Normal Form (INF)

INFCPLFormula            INFCPLClause                   INFCLPLHS
Semantic equivalence:
Functor = 
*
Functor = 
Premise
Functor = 
*
abcd
INFCLPRHS          *     ConstantSymbol
 (a  b)  c  d
Conclusion
Functor =                                 a  b  c  d

Conjunctive Normal Form (CNF)

*
CNFCPLFormula            CNFCPLClause                           Literal
*
Functor =              Functor = 

NegativeLiteral             ConstantSymbol
Functor = 
Horn CPL
Implicative Normal Form (INF)                                                                      INFCLPLHS
Premise                           *
Functor = 
INFCPLFormula                INFCPLClause                                      Conclusion
*
Functor =                 Functor =                                                                           ConstantSymbol

IntegrityConstraint       context IntegrityConstraint inv IC: Conclusion.ConstantSymbol = false                       a  b  c  false

DefiniteClause          context DefiniteClause inv DC: Conclusion.ConstantSymbol <> false                            abcd

Fact               context Fact inv Fact: Premise -> size() = 1 and Premise -> ConstantSymbol = true                   true  d

Conjunctive Normal Form (CNF)

*                           *
CNFCPLFormula                  CNFCPLClause            Literal       NegativeLiteral            ConstantSymbol
Functor =                    Functor =                            Functor = 

IntegrityConstraint          context IntegrityConstraint inv IC: Literal->forAll(oclIsKindOf(NegativeLiteral))            a  b  c

DefiniteClause            context DefiniteClause inv DC: Literal.oclIsKindOf(ConstantSymbol)->size() = 1             a  b  c  d

Fact                 context Fact inv Fact: Literal->forAll(oclIsKindOf(ConstantSymbol))                                       d
FCPL semantics:
Cognitive and Herbrand Interpretations
FCPLBinaryConnective            FCPLUnaryConnective             • fm1(pitIn12   pitIn11) = there is a pit in (1,2) and no pit in (1,1)
• fm1(pitIn12   pitIn11) = John is King of England and is not King of France
Connective: enum{, , , }        Connective: enum{}
• csm1(pitIn12) = there is a pit in (1,2)

Syntax
Entered as input to
• csm2(pitIn12) = John is King of England
inference engine by
Arg                                                                        knowledge engineer
Functor
FCPLConnective                FCPLFormula       1..2     ConstantSymbol
FormulaValuation   ConstantValuation
FormulaMapping

FCLPHerbrandInterpretation                FCLPHerbrandModel
FCLPCognitiveInterpretation          ConstantMapping
Defined from
CompoundDomainProperty                                                    Arg.AtomicDomainProperty.TruthValue
Convention
AtomicDomainProperty                              and FCPL truth table

Semantics
defined by
knowledge
engineer

Known by knowledge
engineer
TruthValue
Value: enum{true,false}

Derived by the knowledge engineer:
CompoundDomainProperty.TruthValue = FCPLFormula.TruthValue
Entailment and models

Valid
 Ic(f): cognitive interpretation of formula f                 formulas
Satisfiable
formulas
 Ih(f): Herbrand interpretation of formula f
 Herbrand model:                                                 Unsatisfiable
formulas
 A Herbrand interpretation Ih(f) of formula f
is a Herbrand model Mh(f) iff f is true in Ih(f)
 Entailment |=:
 f |= f’ iff: Ih (f true in Ih(f)  f´true in Ih(f’))
 Logical equivalence  :
 f  f’ iff f |= f’ and f’ |= f
   f valid (or tautology) iff true in all Ih(f), ex, a  a
   f satisfiable iff true in at least one Ih(f)
   f unsatisfiable (or contradiction) iff false in all Ih(f), ex, a  a
   Theorems:
 f |= f’ iff: Mh(f)  Mh(f´)
 f |= f’ iff: ff´is satisfiable
 f |= f’ iff: ff´is unsatisfiable (since ff´  (ff´)  (ff´)
Cognitive x Herbrand Semantics

 Cognitive semantics:
 Knowledge engineer and application domain dependent symbolic
convention
 Truth values associated to constant symbols and formulas indirectly via
knowledge engineer beliefs about atomic and compound properties of the
real world domain being represented
 Allows deductively deriving new properties n1, … , ni about entities of
this domain from other, given properties g1, …, gj
 Herbrand semantics:
 Knowledge engineer and application domain independent syntactical
convention
 Truth values associated directly to constant symbols and formulas
 Relies on connective truth-table to deduct truth value of formula f from
those of its constant symbols
 Allows testing inference engine reasoning soundness and completeness
independently of any specific knowledge base or real world referential
Logic-Based Agent

Given B as axiom, formula f is a theorem of L?
i.e., B |=L f ?

Sensors
Inference
Environment

Engine:                       Knowledge
Tell              Base B:
Theorem
Prover                        Domain Model
for Logic L      Retract          in Logic L

Actuators

Relies on:
• Mh(B)  Mh(f) ? (model checking)
• Bf is satisfiable ? (boolean CSP search)
• Bf is unsatisfiable ? (refutation proof)

 Strenghts:
 Reuse results and insights about correct reasoning that matured over 23
centuries
 Semantics (meaning) of a knowledge base can be represented formally as syntax,
a key step towards automating reasoning
Model Checking: Truth-Table Enumeration
 kb = persistentKb  volatileKb = pf1  pf2  pf3  vf1  vf2
= p11  (b11  p12  p21)  (b21  p22  p31  p11)  b11  b21
 q1 = p12, q2 = p22, q3 = p31
 kb |= q1, kb |≠ q2, kb |≠ q3,

P?         P?              b11   b21   p11   p12   p21   p22   p31   pf1   pf2   pf3   vf1   vf2   kb   q1   q2   q3
12        22
f     f     f     f     f     f     f     t     t     t     t     f    f    t    t    t
V         A, B        P?
11        21          31         f     f     f     f     f     f     t     t     t     f     t     f    f    t    t    f
.     .     .     .     .     .     .     .     .     .     .     .    .    .    .    .
.     .     .     .     .     .     .     .     .     .     .     .    .    .    .    .
.     .     .     .     .     .     .     .     .     .     .     .    .    .    .    .
f     t     t     f     f     f     f     f     t     f     t     t    f    t    t    t
f     t     f     f     f     f     t     t     t     t     t     t    t    t    t    f
f     t     f     f     f     t     f     t     t     t     t     t    t    t    f    t
f     t     f     f     f     t     t     t     t     t     t     t    t    t    f    f
f     t     f     f     t     f     f     t     f     f     t     t    f    t    t    t
.     .     .     .     .     .     .     .     .     .     .     .    .    .    .    .
.     .     .     .     .     .     .     .     .     .     .     .    .    .    .    .
.     .     .     .     .     .     .     .     .     .     .     .    .    .    .    .
t     t     t     t     t     t     t     f     t     t     f     t    f    f    f    f
FCLP inference rules

 Bi-directional (logical equivalences)    Directed (logical entailments)
R1: f  g  g  f                         R14: f  g, f |= g            %modus ponens
R2: f  g  g  f                         R15: f  g, g |= f %modus tollens
R3: (f  g)  h  f  (g  h)             R16: f  g |= f               %and-elimination
R4: (f  g)  h  f  (g  h)             R17: l1  ...  li  ... lk,
R5: f  f                                       m1  ...  mj-1  li  mj+1... mk
R6: f  g  g  f                            |= l1  ...  li-1  li+1... lk 
m1  ...  mj-1  mj+1... mk
R7: f  g  f  g
%resolution
R8: f  g  (f  g)  (g  f)
R9: (f  g)  f  g
R10: (f  g)  f  g
R11: f  (g  h)  (f  g)  (f  h)
R12: f  (g  h)  (f  g)  (f  h)
R13: f  f  f %factoring
Multiple inference rule application

Idea:                                  Example proof:
 KB |= f ?                             KB0 = P1,1  (B1,1  P1,2  P2,1) 
 KB0 = KB                                     (B2,1  P1,1  P2,2  P3,1) 
 Apply inference rule: KBi |= g               B1,1  B2,1
 Update KBi+1 = KBi  g                Query: (P1,2  P2,1)
 Iterate until f  KBk                 Cognitive interpretation:
or until f  KBn and KBn+1 = KBn         BX,Y: agent felt breeze in
coordinate (X,Y)
 Transforms proving KB |= f into           PX,Y: agent knows there is a pit in
search problem                           coordinate (X,Y)
 At each step:                         Apply R8 to B1,1  P1,2  P2,1
 Which inference rule to apply?     KB1 = KB0  (B1,1  (P1,2  P2,1)) 
 To which sub-formula of f?               ((P1,2  P2,1)  B1,1)
 Apply R6 to last sub-formula
KB2 = KB1  (B1,1  (P1,2  P2,1))
 Apply R14 to B1,1 and last
sub-formula
KB3 = KB2  (P1,2  P2,1)
Resolution and factoring

 Repeated application of only two inference rules:
 resolution and factoring
 More efficient than using multiple inference rules
 search space with far smaller branching factor
 Refutation proof:
 Derive false from KB  Query
 Requires both in normal form (conjunctive or implicative)
 Example proof in conjunctive normal form:
Resolution strategies

 Search heuristics for resolution-based theorem proving
 Two heuristic classes:
 Choice of clause pair to resolve inside current KB
 Choice of literals to resolve inside chosen clause pair
 Unit preference:
 Prefer pairs with one unit clause (i.e., literals)
 Rationale: generates smaller clauses, eliminates much literal choice in pair
 Unit resolution: turn preference into requirement
 Set of support:
 Define small subset of initial clauses as initial “set of support”
 At each step:
 Only consider clause pairs with one member from current set of support
 Add step result to set of support
 Efficiency depend on cleverness of initial set of support
 Common domain-independent initial set of support: negated query
 Beyond efficiency, results in easier to understand, goal-directed proofs
 Linear resolution:
 At each step only consider pairs (f,g) where f is either:
 (a) in KB0, or
 (b) an ancestor of g in the proof tree
 Input resolution:
 Specialization of linear resolution excluding (b) case
 Generates spine-looking proofs trees
FCPL theorem proving as boolean CSP
exhaustive global backtracking search
   Put f = KB  Query in conjunctive normal form
   Try to prove it unsatisfiable
   Consider each literal in f as a boolean variable
   Consider each clause in f as a constraint on these variables
   Solve the underlying boolean CSP problem by using:
 Exhaustive global backtracking search
 of all complete variable assignments
 showing none satisfies all constraint in f
 Initial state: empty assignment of pre-ordered variables
 Search operator:
 Tentative assignment of next yet unassigned variable Li (ith literal in f)
 Apply truth table definitions to propagate constraints in which Li appears
(clauses of f involving L)
 If propagation violates one constraint, backtrack on Li
 If propagation satisfies all constraints:
 iterate on Li+1
 if Li was last literal in f, fail, KB  Query satisfiable, and thus KB | Query
FCPL theorem proving as boolean CSP
backtracking search: example
 Variables = {B1,1 , P1,2, P2,1}
 Constraints: {B1,1 , P1,2  B1,1 , P2,1  B1,1, B1,1  P1,2  P2,1 , P1,2}

V = [?,?,?]
C = [?,?,?,?,?]

V = [0,?,?]                                           V = [1,?,?]
C = [1,?,?,1,?]                                       C = [0,1,1,?,?]

false

V = [0,0,?]                         V = [0,1,?]
C = [1,1,?,1,0]                     C = [1,0,?,1,1]

false                               false
DPLL algorithm

 General purpose CSP backtracking search very inefficient for proving large
CFPL theorems
 Davis, Putnam, Logemann & Loveland algorithm (DPPL):
 Specialization of CSP backtracking search
 Exploits specificity of CFPL theorem proving recast as CSP search
 To apply search completeness preserving heuristics
 Concepts:
 Pure symbol S: yet unassigned variable positive in all clauses or negated in all
clauses
 Unit clause C: clause with all but one literal already assigned to false
 Heuristics:
 Pure symbol heuristic: assign pure symbols first
 Unit propagation:
 Assign unit clause literals first
 Recursively generate new ones
 Early termination heuristic:
 After assigning Li = true, propagate Cj = true Cj | Li  Cj (avoiding truth-table look-ups)
 Prune sub-tree below any node where Cj | Cj = false
 Clause caching
Satisfiability of formula as boolean CSP
heuristic local stochastic search
 DPLL is not restricted to proving entailment by proving unsatisfiability
 It can also prove satisfiability of a FCPL formula
 Many problems in computer science and AI can be recast as a satisfiability
problem
 Heuristic local stochastic boolean CSP search more space-scalable than
DPLL for satisfiability
 However since it is not exhaustive search, it cannot prove unsatisfiability
(and thus entailment), only strongly suspect it
 WalkSAT
 Initial state: random assignment of pre-ordered variables
 Search operator:
 Pick a yet unsatisfied clause and one literal in it
 Flip the literal assignment
 At each step, randomly chose between to picking strategies:
 Pick literal which flip results in steepest decrease in number of yet unsatisfied clauses
 Random pick
Direct x indirect
use of search for agent reasoning
Domain Specific
Agent Decision Problem
Search Model:
• State data structure
• Successor function
• Goal function
• Heuristic function
Domain
Agent                                               Reasoning     Independent
Decision                                             Component       Search
Problem                                              Developer      Algorithm
Agent
Application
Developer                    Domain Independent
Inference Engine
Domain Specific                Search Model
Knowledge Base Model:          • State data structure
• Logic formulas               • Successor function
• Goal function
• Heuristic function
true  d
f  g  h  c
...
Horn CPL reasoning

 Practical limitations of FCPL reasoning:
 For experts in most application domain (medicine, law, business, design,
troubleshooting):
 Non-intuitiveness of FCPL formulas for knowledge acquisition
 Non-intuitiveness of proofs generated by FCPL algorithms for knowledge validation
 Theoretical limitation of FCPL reasoning:
 exponential in the size of the KB
 Syntactic limitation to Horn clauses overcome both limitations:
 KB becomes base of simple rules
If p1 and ... and pn then c, with logical semantics p1  ...  pn  c
 Two algorithms are available, rule forward chaining and rule backward chaining,
that are:
 Intuitive
 Sound and complete for HCPL
 Linear in the size of the KB
 For most application domains, loss of expressiveness can be overcome by
addition of new symbols and clauses:
 ex, FCPL KB1 = p  q  c  d has no logical equivalent in HCPL
in terms of alphabet {p,q,c,d}
 However KB2 = (p  q  notd  c)  (p  q  notc  d)  (c  notc  false) 
(d  notd  false) is an HCPL formula logically equivalent to KB1
Propositional forward chaining

 Repeated application of modus ponens until reaching a fixed point
 At each step i:
 Fire all rules (i.e., Horn clauses with at least one positive and one
negative literal) with all premises already in KBi
 Add their respective conclusions to KBi+1
   Fixed point k reached when KBk = KBk-1
   KBk = {f | KB0 |= f}, i.e., all logical conclusions of KB0
   If f  KBk, then KB0 |= f, otherwise, KB0 | f
   Naturally data-driven reasoning:
 Guided by fact (axioms) in KB0
 Allows intuitive, direct implementation of reactive agents
 Generally inefficient for:
 Inefficient for specific entailment query
 Cumbersome for deliberative agent implementations
 Builds and-or proof graph bottom-up
Propositional forward chaining: example
Propositional forward chaining: example
Propositional forward chaining: example
Propositional forward chaining: example
Propositional forward chaining: example
Propositional forward chaining: example
Propositional forward chaining: example
Propositional backward chaining

 Repeated application of resolution using:
 Unit input resolution strategy with negated query as initial set of support
 At each step i:
 Search KB0 for clause of the form p1 ... pn  g to resolve with clause g popped
from the goal stack
 If there are several ones, pick one, push p1 ... pn to goal stack, and push other
ones to alternative stack for consideration upon backtracking
 If there are none, backtrack (i.e., pop alternative stack)
 Terminates:
 Successfully when goal stack is empty
 As failure when goal stack is non empty but alternative stack is
 Naturally goal-driven reasoning:
 Guided by goal (theorem to prove)
 Allows intuitive, direct implementation of deliberative agents
 Generally:
 Inefficient for deriving all logical conclusions from KB
 Cumbersome implementation of reactive agents
 Builds and-or proof graph top-down
Propositional backward chaining:
example

Goal    Alternative
Stack      Stack

Q           
Propositional backward chaining:
example

Goal    Alternative
Stack      Stack

*             P           
Propositional backward chaining:
example

Goal    Alternative
Stack      Stack

*             L           
M
Propositional backward chaining:
example

Goal    Alternative
Stack      Stack

*             A           A
*             P           B
M
Propositional backward chaining:
example

Goal    Alternative
Stack      Stack

*             P           A
*             M           B

*

*
Propositional backward chaining:
example

Goal    Alternative
Stack      Stack

*             A           

*             B
M
*

*
Propositional backward chaining:
example

Goal    Alternative
Stack      Stack

*             M           

*
*
*
*
*
Propositional backward chaining:
example

Goal    Alternative
Stack      Stack

*             B           

*             L

*
*
*
*
Propositional backward chaining:
example

Goal    Alternative
Stack      Stack

*                        

*
*
*
*
*
*
Propositional backward chaining:
example

Goal    Alternative
Stack      Stack

*                        

*
*
*
*
*
*
Propositional backward chaining:
example

Goal    Alternative
Stack      Stack

*                        

*
*
*
*
*
*
Limitations of propositional logic

 Ontological:
 Cannot represent knowledge intentionally
 No concise representation of generic relations (generic in terms of categories,
space, time, etc.)
 ex, no way to concisely formalize the Wumpus world rule:
“at any step during the exploration, the agent perceiving a stench makes him
knows that there is a Wumpus in a location adjacent to his”
 Propositional logic:
 Requires conjunction of 100,000 equivalences to represent this rule for an exploration of
at most 1000 steps of a cavern size 10x10
 (stench1_1_1  wumpus1_1_2  wumpus1_2_1)  ...
...
 (stench1000_1_1  wumpus1000_1_2  wumpus1000_2_1)  ...
...
 (stench1_10_10  wumpus1_9_10  wumpus1_10_9)  ...
...
 (stench1000_10_10  wumpus1000_9_10  wumpus1000_9_10)
 Epistemological:
   Agent always completely confident of its positive or negative beliefs
   No explicit representation of ignorance (missing knowledge)
   Only way to represent uncertainty is disjunction
   Once held, agent belief cannot be questioned by new evidence (ex, from sensors)
Full Classical First-Order Logic
(FCFOL): syntax
Syntax                                                                 Arg                               Arg
Functor
1..2                              1..*
FCLUnaryConnective            FCLConnective              FCFOLFormula             FCFOLAtomicFormula                  FCFOLTerm
Connective: enum{}                                                                                                            Arg 1..*
Functor
*
FCLBinaryConnective                 QuantifierExpression                  PredicateSymbol      FCFOLNonFunctionalTerm             FCFOLFunctionalTerm
Connective: enum{, , , }           Quantifier: enum{,}
Functor
1..*
FOLVariable          ConstantSymbol     FunctionSymbol

X,Y (p(f(X),Y)  q(g(a,b)))  (U,V Z ((X = a)  r(Z))  (U = h(V,Z))))
FCFOL Normal Forms
Implicative Normal Form (INF)

INFCFOLFormula         *       INFCFOLClause                        INFCLPLHS
Premisse
*
Functor =                    Functor =                         Functor = 

INFCLPRHS
Conclusion                                    *
Functor = 

Arg
1..*
FCFOLAtomicFormula                    FCFOLTerm
Arg 1..*
Functor
NegativeLiteral
PredicateSymbol      FCFOLNonFunctionalTerm             FCFOLFunctionalTerm
Functor = 

Functor
CNFCFOLFormula        *    CNFCFOLClause              *   Literal
FOLVariable          ConstantSymbol     FunctionSymbol
Functor =                   Functor = 

Conjunctive Normal Form (CNF)
Horn CFOL (HCFOL)
Implicative Normal Form (INF)                                                                 INFCFOLLHS
Premisse                                                            *
Functor = 
INFCFOLFormula             * INFCFOLClause          *
Conclusion
Functor =                   Functor = 

IntegrityConstraint      context IntegrityConstraint inv IC: Conclusion.ConstantSymbol = false

DefiniteClause          context DefiniteClause inv DC: Conclusion.ConstantSymbol  false

Fact              context Fact inv Fact: Premisse -> size() = 1 and Premisse -> ConstantSymbol = true

FCFOLAtomicFormula
Conjunctive Normal Form (CNF)

*
CNFCFOLFormula          *      CNFCFOLClause                                    Literal       NegativeLiteral
Functor =                   Functor =                                                     Functor = 

IntegrityConstraint    context IntegrityConstraint inv IC: Literal->forAll(oclIsKindOf(NegativeLiteral))

DefiniteClause        context DefiniteClause inv DC: Literal.oclIsKindOf(ConstantSymbol)->size() = 1

Fact            context Fact inv Fact: Literal->forAll(oclIsKindOf(ConstantSymbol))
FCFOL semantics:
cognitive interpretations
Syntax

Arg
1..*
FCFOLFormula                    FCFOLAtomicFormula                   FCFOLTerm
Arg                                                              Arg
1..2                                                             1..*

FCFOLNonFunctionalTerm                       FCFOLFunctionalTerm    FCFOLNonGroundTerm

PredicateSymbol      FOLVariable      ConstantSymbol         FunctionSymbol       FCFOLGroundTerm

EntitySet   * Entity

ComplexRelation            *    SimpleRelation                        RelationName          EntityName
*
*

ComplexEntityProperty             *   SimpleEntityProperty               EntityPropertyName

TruthValue                PredicateMapping     ConstantMapping        FunctionMapping
Value: enum{true,false}
Semantics
FCFOL semantics:
cognitive interpretations
Syntax

Arg
1..*
FCFOLFormula                    FCFOLAtomicFormula                   FCFOLTerm
Arg                                                             Arg
1..2                                                            1..*

FormulaMapping                                  FCFOLNonFunctionalTerm                      FCFOLFunctionalTerm   FCFOLNonGroundTerm

PredicateSymbol

FOLVariable      ConstantSymbol         FunctionSymbol      FCFOLGroundTerm

EntitySet     * Entity

ComplexRelation            *    SimpleRelation                       RelationName          EntityName
*
*

ComplexEntityProperty             *   SimpleEntityProperty              EntityPropertyName

TruthValue                AtomMapping                     NounGroundTermMapping          GroundTermMapping
TruthMapping            Value: enum{true,false}
Semantics
FCFOL semantics:
cognitive interpretations
FCFOLFormula

semantics

FCFOLCognitiveInterpretation

TruthMapping

FormulaMapping

AtomMapping

NounGroundTermMapping

GroundTermMapping

PredicateMapping

FunctionMapping

ConstantMapping
FCFOL semantics:
Herbrand 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:
Herbrand 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 model 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 }
FCFOL semantics:
Herbrand interpretations
Syntax

Arg
1..*
FCFOLFormula              FCFOLAtomicFormula                  FCFOLTerm
Arg                                                           Arg
1..2                                                          1..*

FCFOLNonFunctionalTerm                         FCFOLFunctionalTerm   FCFOLNonGroundTerm

PredicateSymbol     FOLVariable       ConstantSymbol         FunctionSymbol       FCFOLGroundTerm
Herbrand
semantics

1..*
HerbrandBase                                             HerbrandUniverse

HerbrandInterpretation                  AtomValuation

TruthValue
HerbrandModel                                           Value: enum{true,false}
Semantics
Reasoning 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
Propositionalization

 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)
Propositionalization

 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)))
Propositionalization

 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 Unification

p           p            X/b           p                     p               p          X/b
fail
a       X   Y       b        Y/a       a       b             a       X       X       b      X/a

p           p           X/f(c,Z)       p                 p               p           X/f(c,d)           p

a       X   Y       f         Y/a      a       f         a       X       Y       f         Y/a          a       f
Z/d
c       Z                  c       Z                         c       Z                      c          d

p           X           X/p(a,X)                         p           X           X/p(a,X)           p
fail
a       X                                                a       X                                  a       p
Failure by Occur-Check                                  Guarantees termination
a          p
Lifted 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
lifted resolution and factoring: example
Deduction 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)) 
...
 l1  ...  lk  t1 = t2, m1  ...  mn(...,t3,...)
|= Subst(unif(t1, t2), l1  ...  lk  m1  ...  mn(..., t2,...))
 ex, p(f(X),a)  f(X) = f(b)  q(d,h(f(X)) |= p((f(b),a)  q(d,h(f(b)))
 Extend unification to check for equality (equational unification):
 ex, if a = b + c, then p(X,f(a)) unifies with p(b,f(X+c)) with {X/b}
Characteristics of logics and knowledge
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 knowledge
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 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
and inference methods
 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
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

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 3 posted: 2/12/2012 language: pages: 62