150 likes | 204 Views
Propositional calculus. Propositional formula :. We have a non-empty set A of propositional variables. 1. Each variable is a formula. 2. When α , β are variables, than (¬ α ), ( α β ), ( α β ), ( α β ), ( α β ) are formulas. 3 . Anything other is not a formula.
E N D
Propositionalcalculus Propositional formula: We have a non-empty set A of propositional variables 1.Each variable is a formula 2.When α,β are variables, than (¬α), (α β),(α β),(α β), (α β) are formulas. 3.Anything other is not a formula Such definition is called recursive or inductive
Propositionalcalculus basic terms Evaluation≡is a mappingofAinto{FALSE,TRUE}. Evaluationoftheformularunsafterthecommonrulesforlogicalcouplings. Propositionalformulawithsnlogical variables has 2npossible truthvaluesdepanding on evaluationofthevaribles • TheformulaistautologyiffitisTRUEforallpossibleevaulationsofthevariables • TheformulaiscontradictioniffitisFALSEforallpossibleevaulationsofthevariables • Theformulaissatisfableiffthereexistat least oneevaluationunderwhichitisTRUE
Semanticconsequence •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 Ψ.
Full systemoflogicalcouplings • 0-ary couplings:TRUE(tautology)andFALSE(constradiction) • Unary couplings: Identity and negation • Forlogicalfunctionof 2 variableswecanobtain24 • Possiblelogicalfunctions, so there are 14 possiblelogicalcouplings Possible full system could be form by couplings ¬, and or ¬and or |
All logical couplings F 10 F 11 F 12 F 13 F 14 F 15 x y F 0 F 1 F 2 F 3 F 4 F 5 F 6 F 7 F 8 F 9 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= contradiction F1=AND, F2=(inhibition) F4=(back inhibition) F6=XOR F7=OR F8=NOR,Peirce arrow F9=equivalence F10=notx F11= back implication F12=noty F13=implication F14=NAND,(Sheffers stroke) F15tautology
Normal forms • Conjunctivenormalform (CNF) • Theformulaisconjunctionofoneorfinitecoupleofliteralsordisjunctionofliterals. • Example: (x ∨¬y)∧(¬y ∨z )∧(x ∨¬r ∨z ) • Disjunctivenormalform(DNF) • Theformulaisdisjunctionofoneorfinitecoupleofliteralsorconjunctionofliterals. • Example: (x ∧¬y)∨(¬y ∧z )∨(x ∧¬r ∧z ) • Theformula in conjunction in CNF iscalledclause. Clauseisdisjunctionofliteralsoroneliteral. Thereexistalsoemptyclausewith no literalwhichis not satisfable. • Foranylogicalformulathereexisttautologicalyequivalent DNF formula and alsotautologicalyequivalent CNF formula.
Inference system • By inference systemitispossible to deriveconclusionsfromassumptions. • Foranylogicalcouplingwehave I-rule fordefinition and E-rule forelimination.
Formal (syntactic, logic) deduction • Operationofderivingformulafrom a set offormulas S wenotate→. By usingthisoperationwecanobtain a new set offormulascontainingassumptions and formulasderived by severalsequenceofthe inference rulesfromtheassumptions. • We call derivedformulaβ to belogicalconsequenceof S. • The set offormulas S iscontradictory, iffthereexisttheformulaα such thatbothα and ¬αcouldbelogicalyderivedfrom S. • In theothersituationwe call the set S non-contradictoryorhealth.
Completnessofpropositionalcalculus • Formulaϕissemanticconsequenceofthe set offormulas S if in eachevaluation in whichallformulas in S are TRUE theformulaϕisalso TRUE. • Formulaϕislogicalconsequenceofthe set offormulas S ifitcouldbederivedfromthe set S by sequenceof inference rules (thereexist a proof). • Ifthe set S is non-contradictorytheeachformulawhichis a logicalconsequenceisalso a semanticconsequence. • Forthepropositionalcalculusthereholdsalso a conversion. Anyformulawhichis a semanticconsequenceof S isalso a logicalconsequenceof S. Everythingwhatis TRUE couldbe proved. Thispropertyiscalledcompletness.
Resolution principe • Wehave a set offormulas S and a inference systém. Let αbe a formula. We are interestred in a questionwheatherαis a logicalconsequenceof S. • Theresolution principe isbased on thefactthatα logicalyfollowsfrom S iff S∪{¬α} is not satisfiable. • Itisequivalentwiththewellknownfactthatα⇒β and ¬α∨β are tautologicalyequivalent. • Theresolution principe is a foundationoflogicalprogramming.
Resolution principe • Wewillasume CNF. • Wewillwrite {x,¬y,¬z,v,¬w} insteadof x∧¬y∧¬z∧v∧¬w. • Theemptyclausewillbenotated as []. • Theresolution principe consist in theeliminationoftwocomplementaryliteralsfromtheclauses: • (x ∨ y) ∧ (¬x ∨ z) ⇒ y ∨ z. • Wewill call D to be a resolvent oftheclause C1 and C2 by theliteraliffthereexist a literal p such that: • p∈C1, ¬p∈C2 and D= (C1 ÷{p}) ∪(C1 ÷{¬p}).
Resolution principe • In resolution principe werepeatedlyformresolventas: • R0(S) = S, • Rj+1(S) = R(Rj(S)) for j= 1, 2, ... . • Let R*(S) be union ofallRj(S) for j= 1, 2, ... • S = R0(S) ⊆R1(S) ⊆... ⊆Rk(S)⊆... . • As the set ofallvariablesisfinitewecan make onlyfiniteamountofdisjunction and thereexist a number n such that Rn+1(S)=Rn(S) = R*(S). • Theemptyclauseiscontained in the set R*(S) in the case that S orsomeoftheRk(S) containsboth {x} and {¬x} forsomevariable x. • Resolution principe: The set ofclases S issatisfiableifftheresultof resolventa aplicationsdoes not containemptyclause []. • To decidewheatherformulaϕis a semanticconsequenceofthe set offormulas S isequivalent to thedecisionwheather set offormulasS∪{¬ϕ} je unsatisfiable, itmeanswheatheritispossible to derivetheemptyclausefromthe set offormulasS∪{¬ϕ} .
Procedureoftheresolution principe • Foranyformula in S findtautologicalyequivalent CNF formula. Wereplaceallformulas in theassumption. Weobtain a set ofdisjunctionswhichmustbe TRUE together. Ifthere are anytautologieswe skip them. Ifthe set isnowemptyitcontainedonlytautologies and itwassatisfable. In theother case weapplyresolution principe (welookforcomplementaryliterals). • Weadd (in arbitaryorder) newresolventas. • Ifweduringtheprocedurefindtheemptyclause, theoriginal set S wasunsitisfiable. Iftheprocedurestops and R*(S) does not containtheemptyclausetheoriginal set S wassatisfiable.
Example • The set S = {x ∨ y ∨ z, z ∨ t ∨ v, z ⇒ (x ∨ y), y ⇒ x, w ⇒ t, v ∨ w} • Is x semanticconsequenceof S? • Wewillconvertthisproblemintoproblemofsatisfiabilityofthe 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.