------------------- Propositional Logic (Chapter 5.1-5.5) ------------------- Notation for expressing concepts precisely, and formalism for reasoning. "Propositions" are statements, which are either true or false, as opposed to other kinds of English sentences (e.g., commands, questions). Example: "David works hard", "It rained in Paris on Sept. 3, 1524". "Propositional variables" represent propositions (just like variables in algebra represent numbers). Since propositions are either true (1) or false (0), these are the only values a propositional variable can take. "Connectives" are operators that can be used to form more complex propositions (just like addition, subtraction in algebra). - Negation (~, "not"); in English: "not", "it is not the case that" Example: David does not work hard. - Conjunction (/\, "and"); in English: "and", "but". Example: David works hard and he makes a lot of money. - Disjunction (\/, "or"); in English: "or", "either...or". Example: David works hard or he doesn't make a lot of money. - Implication (->, "implies"); in English, p -> q corresponds to many forms: . p implies q . if p then q . p is a sufficient condition for q . p only if q . q follows from p . q is a necessary condition for p Example: If David works hard then he makes a lot of money. - Biconditional (<->, "if and only if"); in English, "if and only if" (abbreviated "iff"), "is a necessary and sufficient condition for". Example: David makes a lot of money if and only if he works hard. Propositional Formulas: - Let PV be a set of propositional variables. The set of propositional formulas PF is the smallest set such that: . any variable in PV is in PF. . if p1 and p2 are in PF then so do the following expressions: ~p1, (p1 /\ p2), (p1 \/ p2), (p1 -> p2), and (p1 <-> p2). - Truth assignment: for a set PV of propositional variables, a function T:PV-->{0,1} is a truth assignment. - How can we define the meaning of the connectives clearly and precisely? Since connective applies to propositions (either 0 or 1), we only need to specify its value for all possible arguments. This is done using a *truth table*. - Negation, conjunction, disjunction, and implication truth tables. - Example: for propositional variables p, q, and r, let T(p)=1, T(q)=0, and T(r)=0, Then T satisfies (p \/ q) -> ~r. Note: "->" represents "if...then" but not fully, e.g., it does not represent the idea of cause-and-effect (in logic, a statement such as "if 3 > 7, then 2 is a prime" is acceptable). Also, English sometimes uses the words "if...then" with different meaning, e.g., "If you eat your vegetables, then you will get some dessert." The meaning of this sentence is really "if and only if", because it also means "if you do not eat your veggies, you will not get dessert". "or" in english is sometimes inclusive, such as: "you are a Canadian citizen if your father *or* mother is a Canadian citizen" sometimes "or" is used as an exclusive or, such as: I come here to see you or I call you. - Precedence (to avoid lots of parentheses): 1. ~ 2. /\ 3. \/ 4. ->, <-> . associate to the right . example: ~p /\ r -> q means ((~p) /\ r) -> q p -> q -> p means p -> (q -> p) Example: p /\ q -> ~r \/ s is the short form for: (p /\ q) -> ((~r) \/ s) ~p /\ q \/ r is the same as (~p /\ q) \/ r and is *not* the same as ~p /\ (q \/ r). - Syntax vs semantics: A formula is just a sequence of symbols, we must define precisely what it means to correspond to our intention and understanding. Truth value assignment (or just truth assignment): - Gives a value (0 or 1) to each propositional variable. - Value can be extended to all formulas using those variables through the truth tables, by working "inside-out" (example). - A truth assignment "satisfies" a formula F if it gives F value 1; otherwise, it "falsifies" F. - A formula is "satisfiable" if there is some truth assignment that satisfies it (i.e., if there is some line in its truth table equal to 1) -- example: p /\ q. - A formula is "unsatisfiable" (or "contradictory") if *no* truth assignment satisfies it -- example: p /\ ~p. - A formula is a "tautology" if *all* truth assignments satisfy it -- example: ~p \/ p. Logical implication and logical equivalence: - A formula p "logically implies" a formula q if and only if every truth assignment that satisfies p also satisfies q. Example: p /\ (p -> q) logically implies q (just check the truth tables) - Theorem: p logically implies q if and only if (p -> q) is a tautology. - NOTE: p logically implies q is *different* from (p -> q). The latter is a propositional formula, while the former is not. - A formula p is logically equivalent to a formula q (or simple p LEQV q) if and only if p logically implies q and q logically implies p. Example: p /\ q LEQV ~(~p \/ ~q) p -> q LEQV ~p \/ q - p and q are LEQV if they have the same truth table. - Theorem: p LEQV q if and only if (p <-> q) is a tautology. Examples: p /\ (q /\ r) LEQV (p /\ q) /\ r But p -> (q -> r) not LEQV (p -> q) -> r - Logical equivalence similar to equality in algebra. - Substitution of equals: . If A LEQV B and C' obtained from C by replacing some occurrences of A by B, then C' LEQV C. (Similar to algebra: e.g., x = y means x^2 + x = y^2 + x.) Example: p -> q LEQV ~p \/ q so r \/ (p -> q) LEQV r \/ ~p \/ q.