190 likes | 438 Views
Propositional Logic (section 1.1). January 12, 2009. Logical Operators. Negation operator Conjunction (and, v) Disjunction (or ^ ) Conditional statement Biconditional statement (less important) Exclusive Or. Conjunction: p ^ q is true when both p and q are true. False otherwise
E N D
Propositional Logic(section 1.1) January 12, 2009
Logical Operators • Negation operator • Conjunction (and, v) • Disjunction (or ^ ) • Conditional statement • Biconditional statement • (less important) Exclusive Or
Conjunction: p ^ q is true when both p and q are true. False otherwise • Disjunction: p v q is false when both p and q are false. True otherwise • Conditional Statement: p q is false when p is true and q is false. True otherwise • Biconditional Statement: p q is true when p, q have the same truth value. False otherwise • Exclusive Or is true when exactly one of p, q is true. False otherwise
Precedence of Logical Operators • Negation • Conjunction (^) • Disjunction (v) • Conditional Statement • Biconditional Statement
Compound Propositions • We can use logical operators to build compound propositions and evaluate their truth values p q T T T T F F F T F F F F
Translating English to logical Expressions Why? English is often ambiguous and translating sentences into compound propositions removes the ambiguity. Using logical expressions, we can analyze them and determine their truth values. And we can use rules of inferences to reason about them.
Example “ You can access the internet from campus only if you are a computer science major or you are not a freshman. p : “You can access the internet from campus” q : “You are a computer science major” r : “You are freshmen” p ( q v ~r )
System Specification • Translating sentences in natural language into logical expressions is an essential part of specifying both hardware and software systems. • Consistency of system specification. • Example: (on page 12) Express the specification “The automated reply cannot be sent when the file system is full”
Let p denote “The automated reply can be sent” • Let q denote “The file system is full” The logical expression for the sentence “The automated reply cannot be sent when the file system is full” is
A more complicated example: (on page 12) Determine whether these system specifications are consistent: 1. The diagnostic message is stored in the buffer or it is retransmitted. 2. The diagnostic message is not stored in the buffer. 3. If the diagnostic message is stored in the buffer, then it is retransmitted.
Let p denote “The diagnostic message is stored in the buffer” • Let q denote “The diagnostic message is retransmitted” The three specifications are
If we add one more requirement “The diagnostic message is not retransmitted” The new specifications now are This is inconsistent! No truth values of p and q will make all the above statements true.
Propositional Equivalence (1.2) • A compound proposition is a tautology if it is always true. • A compound proposition is a contradiction if it is always false. • A compound proposition is called a contingency if it is neither a tautology or a contradiction.
Examples Which is a tautology? And which is a contradiction?
Logical Equivalence Two compound propositions p, q, are called logically equivalent if p q is a tautology. It is denoted as One way to verify a logical equivalence is by examining truth tables.
De Morgan’s Law • The first example above is known as the De Morgan’s law
Example • Express the negation of “Heather will go to the concert or Steve will go to the concert” Heather will not go to the concert AND Steve will not go to the concert.