You are on page 1of 10

Propositional Calculus: Syntax and Semantics

validity and satisability part 2


Eli S. Mostrales esmostrales@gmail.com
Department of Computer Science MSU-Iligan Institute of Technology

Lecture Notes on Discrete Mathematics June 27, 2011

Eli S. Mostrales

Boolean Functions

Propositional Calculus: Syntax and Semantics

boolean functions

validity and satisability


1. Construct a truth table for the following wff: (A0 (A1 A0 )) 2. Show that the following is a tautology: ((A B) (B A))

Eli S. Mostrales

Boolean Functions

Propositional Calculus: Syntax and Semantics

boolean functions

validity and satisability and truth tables


Tautology there are well-formed formulas that evaluate to the value matter what the assigned values are of their respective constituent atomic formulas such a formula is called (logically) valid or a tautology examples of tautologies are: P P, P P, and P (Q P) no

Eli S. Mostrales

Boolean Functions

Propositional Calculus: Syntax and Semantics

boolean functions

validity and satisability and truth tables


truth table of a wff if a wff contains n letters P, Q, . . . , (from now on we may use the word letters to refer to these aliases of atomic formulas), then there are 2n possible distributions of the truth values among these letters the 2n -row table that contains the calculations of these values is the truth table of the wff we already dened some of these truth tables calling them functions using our alternative notation (Haskell) again, we may use our alternative notation to dene these wffs and understand them to be truth tables, that is, evaluation of these wffs for all the possible assignments appropriate to these wffs
Eli S. Mostrales Boolean Functions

Propositional Calculus: Syntax and Semantics

boolean functions

validity and satisability and truth tables


the function (==>) p q that evaluates to when p = is just evaluating the function, A((P Q)) where A = {(P, ), (Q, )} ,q =

the function (==>) p q is simply able to return the value of A((P Q)) for all the four possible assignments A

Eli S. Mostrales

Boolean Functions

Propositional Calculus: Syntax and Semantics

boolean functions

validity and satisability and truth tables


now, set p q to > p = No > q = Oo and dene > formula1 = (hindi p) /\ (p ==> q) <=> hindi (q /\ (hindi p)) we check by evaluating the following: Main> formula1 No :: Boolean

Eli S. Mostrales

Boolean Functions

Propositional Calculus: Syntax and Semantics

boolean functions

validity and satisability and truth tables


what happens when we dene formula2 below: > formula1 = (hindi p) /\ (p ==> q) <=> hindi (q /\ (hindi p)) > formula2 p q = ((hindi p) /\ (p ==> q) <=> hindi (q /\ (hindi p))) formula2 is formula1 with arguments p and q added so we can evaluate expressions like formula2 Oo No which of course should evaluate to the same value as formula1 Problem: How to evaluate formula2 to obtain all its values for all possible arguments?

Eli S. Mostrales

Boolean Functions

Propositional Calculus: Syntax and Semantics

boolean functions

validity and satisability and truth tables


a boolean function of two arguments (like formula2 above) can be veried for validity by evaluating all the 4 possible combinations to its arguments: (bf Oo Oo) /\ (bf No /\ (bf Oo No) Oo) /\ (bf No No)

if we set bf as an argument to a function that does validity check we have: valid2 :: (Boolean -> Boolean -> Boolean) -> Boolean valid2 bf = (bf Oo Oo) /\ (bf Oo No) /\ (bf No Oo) /\ (bf No No)
Eli S. Mostrales Boolean Functions

Propositional Calculus: Syntax and Semantics

boolean functions

validity and satisability and truth tables


a boolean function of two arguments (like formula2 above) can be veried for validity by evaluating all the 4 possible combinations to its arguments: (bf Oo Oo) /\ (bf No /\ (bf Oo No) Oo) /\ (bf No No)

if we set bf as an argument to a function that does validity check we have: valid2 :: (Boolean -> Boolean -> Boolean) -> Boolean valid2 bf = (bf Oo Oo) /\ (bf Oo No) /\ (bf No Oo) /\ (bf No No)
Eli S. Mostrales Boolean Functions

Propositional Calculus: Syntax and Semantics

boolean functions

validity and satisability and truth tables


a boolean function of two arguments (like formula2 above) can be veried for validity by evaluating all the 4 possible combinations to its arguments: (bf Oo Oo) /\ (bf No /\ (bf Oo No) Oo) /\ (bf No No)

if we set bf as an argument to a function that does validity check we have: valid2 :: (Boolean -> Boolean -> Boolean) -> Boolean valid2 bf = (bf Oo Oo) /\ (bf Oo No) /\ (bf No Oo) /\ (bf No No)
Eli S. Mostrales Boolean Functions