Inference of FOL

Outline:
Reducing first-order inference to propositional inference
Unification
Generalized Modus Ponens
Forward and backward chaining
Logic programming
Resolution

Unification:
To find a substitution θ that can substitute variables in FOL with
elements to get propositional logic.
Eq. for 'King(x) and Greedy(x) match King(John) and Greedy(y)',
θ = {x/John, y/John} works.
UNIFY(p, q) = θ where SUBST(θ, p) = SUBST(θ, q).

Modus Ponens ???

Forward chaining algorithm

Properties:
* Sound and complete for first-order definite clauses.
* Datalog KB = first-order definite clauses + no functions(recursive).
* Terminates for Datalog in poly iterations: at most p∙n^k literals.
* May not terminate in general if a is not entailed.
* Entailment with definite clauses is semidecidable.

Effeciency:
* Simple observation: no need to match a rule on iteration k if a
premise wasn't added on iteration k-1
⇒ match each rule whose premise contains a newly added literal
* Matching itself can be expensive
* Database indexing allows O(1) retrieval of known facts
e.g., query Missile(x) retrieves Missile(M)
* Matching conjunctive premises against known facts is NP-hard
* Forward chaining is widely used in deductive databases


Backward chaining algorithm

Properties:
* Depth-first recursive proof search: space is linear in size of proof
* Incomplete due to infinite loops
⇒ fix by checking current goal against every goal on stack
* Inefficient due to repeated sub-goals (both success and failure)
⇒ fix using caching of previous results (extra space!)
* Widely used for logic programming
* More effecient than forward chaining
* Prolog uses depth-first, left-to-right backward chaining algorithm


Resolution:
It is a rule of inference leading to a refutation theorem-proving
technique for sentences in propositional logic and first-order logic.

The resolution rule in propositional logic is a single valid inference
rule that produces a new clause implied by two clauses containing
complementary literals. A literal is a propositional variable or the
negation of a propositional variable. Two literals are said to be
complements if one is the negation of the other. The resulting clause
contains all the literals that do not have complements.

Conjunctive Normal Form(CNF) is a conjunction of clauses,
where a clause is a disjunction of literals;
otherwise put, it is an AND of ORs.

Conversion to CNF:
1. Eliminate biconditional and implications.
2. Move 'negation' inwards.
3. Standardize variables: each quantifier should use a difference one.
4. Skolemize.
5. Drop universal quantities.
6. Distrubute ⋀ over ⋁ .

你可能感兴趣的:( Inference of FOL)