Propositional calculus
description
Transcript of Propositional calculus
Propositional calculus
Propositional formula:We have a non-empty set A of propositional variables
1. Each variable is a formula2. When α,β are variables, than (¬α), (α β), (α β), (α β), (α β) are formulas.3. Anything other is not a formula
Such definition is called recursive or inductive
Propositional calculusbasic terms
Evaluation ≡is a mapping of A into {FALSE, TRUE}.Evaluation of the formula runs after the common rules for logical couplings.
Propositional formula with s n logical variables has 2n possible
truth values depanding on evaluation of the varibles
• The formula is tautology iff it is TRUE for all possible evaulations of the variables
• The formula is contradiction iff it is FALSE for all possible evaulations of the variables
• The formula is satisfable iff there exist at least one evaluation under which it is TRUE
Semantic consequence
• The formula Φ is the semantic consequence of the set of formulas Ψ={Ψ1,Ψ2,…Ψn} iff Φ has value TRUE in all evaluations in which all the formulas {Ψ1,Ψ2,…Ψn} have evaluation TRUE. The notation is Ψ Φ
• The formulas Φ and Ψ are tautologicaly equivalent iff Ψ is semantic consequence of Φ and Φ is semantic consequence of Ψ.
• 0-ary couplings: TRUE (tautology) and FALSE (constradiction)
• Unary couplings: Identity and negation• For logical function of 2 variables we can obtain 24
• Possible logical functions, so there are 14 possible logical couplings
Possible full system could be form by couplings ¬, and
or ¬and
or |
Full system of logical couplings
All logical couplingsx y F
0F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
F13
F14
F15
F x y ¬ x ¬y T
0
0
1
1
0
1
0
1
0
0
0
0
0
0
0
1
0
0
1
0
0
0
1
1
0
1
0
0
0
1
0
1
0
1
1
0
0
1
1
0
1
0
0
0
1
0
0
1
1
0
1
0
1
0
1
1
1
1
0
0
1
1
0
1
1
1
1
0
1
1
1
1
F0 = contradictionF1 = AND, F2 = (inhibition)F4 = (back inhibition)F6 = XORF7 = ORF8 = NOR, Peirce arrowF9 = equivalenceF10 = not xF11 = back implicationF12 = not yF13 = implicationF14 = NAND, (Sheffers stroke)F15 tautology
Normal forms
• Conjunctive normal form (CNF)– The formula is conjunction of one or finite couple of literals or disjunction of
literals.– Example: (x ¬y) (¬y z ) (x ¬r z )∨ ∧ ∨ ∧ ∨ ∨
• Disjunctive normal form (DNF)– The formula is disjunction of one or finite couple of literals or conjunction of
literals.– Example: (x ¬y) (¬y z ) (x ¬r z )∧ ∨ ∧ ∨ ∧ ∧
• The formula in conjunction in CNF is called clause. Clause is disjunction of literals or one literal. There exist also empty clause with no literal which is not satisfable.
• For any logical formula there exist tautologicaly equivalent DNF formula and also tautologicaly equivalent CNF formula.
Inference system
• By inference system it is possible to derive conclusions from assumptions.
• For any logical coupling we have I-rule for definition and E-rule for elimination.
Formal (syntactic, logic) deduction
• Operation of deriving formula from a set of formulas S we notate →. By using this operation we can obtain a new set of formulas containing assumptions and formulas derived by several sequence of the inference rules from the assumptions.
• We call derived formula β to be logical consequence of S. • The set of formulas S is contradictory , iff there exist the
formula α such that both α and ¬α could be logicaly derived from S.
• In the other situation we call the set S non-contradictory or health.
Completness of propositional calculus
• Formula ϕ is semantic consequence of the set of formulas S if in each evaluation in which all formulas in S are TRUE the formula ϕ is also TRUE.
• Formula ϕ is logical consequence of the set of formulas S if it could be derived from the set S by sequence of inference rules (there exist a proof).
• If the set S is non-contradictory the each formula which is a logical consequence is also a semantic consequence.
• For the propositional calculus there holds also a conversion. Any formula which is a semantic consequence of S is also a logical consequence of S. Everything what is TRUE could be proved. This property is called completness.
Resolution principe
• We have a set of formulas S and a inference systém. Let α be a formula. We are interestred in a question wheather α is a logical consequence of S.
• The resolution principe is based on the fact that α logicaly follows from S iff S {¬∪ α} is not satisfiable.
• It is equivalent with the well known fact that α β⇒ and ¬α β∨ are tautologicaly equivalent.
• The resolution principe is a foundation of logical programming.
Resolution principe
• We will asume CNF.• We will write {x,¬y,¬z,v,¬w} instead of
x ¬y ¬z v ¬w.∧ ∧ ∧ ∧• The empty clause will be notated as [].• The resolution principe consist in the elimination of
two complementary literals from the clauses:– (x y) (¬x z) y z.∨ ∧ ∨ ⇒ ∨
• We will call D to be a resolvent of the clause C1 and C2 by the literal iff there exist a literal p such that:– p C1, ¬p C2 and D= (C1 ÷{p}) (C1 ÷{¬p}).∈ ∈ ∪
Resolution principe
• In resolution principe we repeatedly form resolventas:– R0(S) = S,– Rj+1(S) = R(Rj(S)) for j= 1, 2, ... .
• Let R*(S) be union of all Rj(S) for j= 1, 2, ... – S = R0(S) R1(S) ... Rk(S) ... .⊆ ⊆ ⊆ ⊆
• As the set of all variables is finite we can make only finite amount of disjunction and there exist a number n such that Rn+1(S)=Rn(S) = R*(S).
• The empty clause is contained in the set R*(S) in the case that S or some of the Rk(S) contains both {x} and {¬x} for some variable x.
• Resolution principe: The set of clases S is satisfiable iff the result of resolventa aplications does not contain empty clause [].
• To decide wheather formula ϕ is a semantic consequence of the set of formulas S is equivalent to the decision wheather set of formulas S {¬∪ ϕ} je unsatisfiable, it means wheather it is possible to derive the empty clause from the set of formulas S {¬∪ ϕ} .
Procedure of the resolution principe
1. For any formula in S find tautologicaly equivalent CNF formula. We replace all formulas in the assumption. We obtain a set of disjunctions which must be TRUE together. If there are any tautologies we skip them. If the set is now empty it contained only tautologies and it was satisfable. In the other case we apply resolution principe (we look for complementary literals).
2. We add (in arbitary order) new resolventas.3. If we during the procedure find the empty clause, the
original set S was unsitisfiable. If the procedure stops and R*(S) does not contain the empty clause the original set S was satisfiable.
Example
• The set S = {x y z, z t v, z (x y), ∨ ∨ ∨ ∨ ⇒ ∨ y x, w t, v w}⇒ ⇒ ∨
• Is x semantic consequence of S?• We will convert this problem into problem of
satisfiability of the set S {∪ ¬x}• Procedure:• Convert S into CNF:– {x y z, z t v, ∨ ∨ ∨ ∨ ¬z x y, ∨ ∨ ¬y x, ∨ ¬w t, v w}∨ ∨
Example
• We derived the empty formula, so the set is unsatifiable and so x is the semantic consequence of S.