Inference in Propositional Calculus

Non-SFS Reality Check

1. If you can't do this, study a bit.
2. If P implies Q and Q implies P then either P or Q is true.

Put this statement into propositional calculus notation and prove or disprove it by a truth table. If the statement is false, what values of P and Q make it false?

Inference

Inference is useful because:

• Model enumeration does not scale.
• Inference reduces semantic analysis to syntactic manipulations.
• Syntactic manipulation is eminently automatable.
• Perhaps is a mathematical formalism for human reasoning.

Technical Terms: Soundness and Completeness

Soundness: inference proves only true things.

Completeness: all true things can be proved.

More formally,
KB |=i α means that sentence α can be derived from KB by a procedure i.

Soundness: i is sound if:
whenever KB |=i α, it is also true that KB |= α.

Completeness: i is complete if:
whenever KB |= α, it is also true that KB |=i α.

Both propositional and first-order logics have sound, complete proof systems (inference rules and axioms). Thus a procedure can answer any question whose answer logically follows from the KB.

There are many known complete proof systems for PC: sets of simple rules for rewriting PC sentences into equivalent ones, that are complete. One has seven rules, ranging from the simple, like
(A ∧ A) ⇔ A and
(A ∨ B) ⇔ (B ∨ A) to the perhaps less obvious:
(B ⇒ C) ⇒ ((A ∨ B) ⇒ (A ∨ C)) .

We'll see some sample logical inference rules and identities below, but the only complete inference system we'll seriously consider is based on one inference rule: resolution.

Technical Terms: Validity and Satisfiability

• A sentence is valid if it is true in all models (of the domain, not of the sentence).
e.g. A ∨ ∼ A, (A ∧ (A ⇒ B)) ⇒ B .
• Validity connected to inference by the Deduction theorem: KB |= α if and only if KB ⇒ α.
• A sentence is satisfiable if it is true in some model. e.g. A ∨ B, C .
• A sentence is unsatisfiable if it is true in no models. e.g. A ∧ ∼ A .
• Satisfiability is connected to inference:
KB |= α if and only if KB ∧ ∼ α is unsatisfiable. This hints that α could be proved by contradiction (reductio ad absurdum.

Inference Process

For us, inference is rewriting sentences or generating new sentences by appying logical identities or rules of inference. For example, we may start with a KB of facts and rules and a sentence to prove, and inference combines the sentences of the KB to preserve truth and ultimately to produce the goal sentence.

Some basic logic identities for propositional calculus are:
∼ ∼ A ⇔ A (Double negative)
A ⇒ B ⇔ ∼ A ∨ B (⇔ elimination).
Proof: (A ⇒ B) ⇔ (∼ A ∨ B) F T F T F T F F T T T T T T T F F T F F F T T T T F T T

∼ (A ∧ B) ⇔ (∼ A ∨ ∼ B)
∼ (A ∨ B) ⇔ (∼ A ∧ ∼ B) (deMorgan's laws)
A ∨ (B ∧ C) ⇔ (A ∨ B) ∧ (A ∨ C)
A ∧ (B ∨ C) ⇔ (A ∧ B) ∨ (A ∧ C) (Distributive laws).

Normal Forms

A normal form is a canonical way to write a logical sentence. It turns out that any PC sentence can be written in either of the universal forms:

Conjunctive Normal Form (CNF): a conjunction of disjunctions of literals (proposition letters and their negations). Each disjunction of literals is a clause.
e.g. (A ∨ ∼ B) ∧ (B ∨ ∼ C ∨ ∼ D)

CNF is the needed representation for our two most important techniques for inference -- one for propositional logic (satisfiability solving) and one for both PL and FOL (resolution).

Disjunctive Normal Form (DNF): a disjunction of conjunctions of literals. Each conjunction of literals is a term.
Same e.g.
(A ∧ B) ∨ (A ∧ ∼ C) ∨ (A ∧ ∼ D) ∨
(∼ B ∧ ∼ C) ∨ (∼ B ∧ ∼ D)

Another normal form that does not allow every PC sentence to be represented but is practically important (e.g. Prolog, linear algorithms) is Horn Form: a conjunction of Horn Clauses (which have at most one positive literal): e.g.
(A ∨ ∼ B) ∧ (B ∨ ∼ C or ∼ D),
often written as a set of implications:
(B ⇒ A) and (C ∧ D) ⇒ B.
Which in turn can be interpreted top-down (to prove B, prove C and D) or bottom-up (if know C and D, can deduce B). The no-positive-literal form of a horn clause can be used in prolog: it seems to succeed or fail at consult- << prolog book, headless clauses and resolution proofs. resolution takes A->B and B->C to get A->C. or A->C and A to get C. How get null clause? headless clauses, like ->C to cancel C. >>

Horn clauses are closed under resolution, and inference can proceed through forward- or backward chaining in linear time.

More restricted than Horn clauses are Definite Clauses, which is a disjunction of literals of which exactly one is positive. In fact, these are the canonical Prolog rules. A Horn clause with no positive literals is not so useful in programming but is lurking in the idea of a proof by contradiction (which Prolog does behind the scenes: "at least one of these clauses must be false if this sentence is true"). Definite clauses look like "normal" prolog rules and can be interpreted as facts
(A, ∼ C) or implications
(A,B, C ⇒ D or in prolog
D :- A, B, C.

PC Inference Rules

• Modus Ponens (MP) ("old"). Perfect (and complete) for Horn KBs:
α1,..., αn , α1 ∧ ... ∧ αn ⇒ β
__________________________ .
β
E.g. A ⇒ B, A implies B. Can be used with forward or backward chaining (bottoms-up or tops-down).
• Contrapositive:
∼ α ⇒ ∼ β, β
α
• Unit Resolution (special case of next rule). For a disjunction, if one disjunct is false the other must be true.
α ∨ β, ∼ β
___________ .
α
• Resolution ("new" -- used in modern theorem provers). for CNF, complete for PC (no other rules needed!). "Cancellation".
α ∨ β, ∼ β ∨ γ
________________ .
α ∨ γ
(Proof: "implication is transitive.")
∼ α ⇒ β, β ⇒ γ
________________ .
∼ α ⇒ γ
• And-Elimination -- infer any of conjuncts from conjunction.
α1 ∧ ... ∧ αn
__________ .
αi
• And-Introduction -- conjunction from list of sentences.
α1 , ... , αn
__________ .
α1 ∧ ... ∧ αn
• Or-Introduction -- From a sentence, can infer its disjunction with anything (!?).
αi
____________________ .
α1 ∨ ... ∨ αi ∨ ... ∨ αn

Resolution Proofs

• To Prove S from KB, assert KB and ∼ S.
• If KB ∧ ∼ S is a contradiction, then KB |= S.
• Resolution can detect a contradiction in any set of inconsistent clauses (hence need CNF) in finite time.
• But it may be a long finite time. Further if set is consistent no contradiction will be found. Thus
• Entailment for first-order logic is only "semi-decidable".
• Hence "negation as failure (to find a proof)".
• Since resolution is like cancellation, the equivalent of finding a contradiction is "deriving the null clause", as in resolving A with ∼ A.
• Entailment for propositional calculus is decidable, as we know (theoretically, truth tables work).

Control of Resolution Proofs

Teleport to Prop. Calc. Inference PPT Courtesy of Hwee Tou Ng (Nat. U. Singapore).