Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ 111111 100100 010110 000011.

Similar presentations


Presentation on theme: "1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ 111111 100100 010110 000011."— Presentation transcript:

1 1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ 111111 100100 010110 000011

2 2 Today some special types of logical formulas: Tautologies: are always true Contraditions: always false (never true) Contingencies: true is some situations, false in others

3 3 CA 208 Logic PQ PQPQ 111 101 011 000 P  Q is a contingency, true in some situations, false in others

4 4 CA 208 Logic P PPP  P 101 011 P  P is a tautology, i.e. always true in all situations:

5 5 CA 208 Logic P P  P 11 01 P  P is a tautology, i.e. always true in all situations:

6 6 CA 208 Logic PQ QPQPP  (Q  P) 11 10 01 00 P  (Q  P) is a........, true in.........

7 7 CA 208 Logic PQ QPQPP  (Q  P) 111 101 010 001 P  (Q  P) is a........, true in.........

8 8 CA 208 Logic PQ QPQPP  (Q  P) 1111 1011 0101 0011 P  (Q  P) is a........, true in.........

9 9 CA 208 Logic P P  P 10 00 P  P is a contradiction, false in all situations

10 10 CA 208 Logic PQ QPQPP  (Q  P)  (P  (Q  P)) 1111 1011 0101 0011 Take any tautology, negate it, and you get a contradiction e.g. P  (Q  P) is a tautology, and  (P  (Q  P)) is a contradiction

11 11 CA 208 Logic PQ QPQPP  (Q  P)  (P  (Q  P)) 11110 10110 01010 00110 Take any tautology, negate it, and you get a contradiction e.g. P  (Q  P) is a tautology, and  (P  (Q  P)) is a contradiction

12 12 CA 208 Logic Logical connectives: , , , ,  Take formulas as arguments and form new, more complex formulas

13 13 CA 208 Logic Two new symbols (not logical connectives)  and  Relate (!) two formulas  logical equivalence: Defn: A  B iff A  B is a tautology In words: A and B are logically equivalent if and only if they are true in the same situations and false in the same situations, i.e. they have the same meaning, and you can replace one by the other (and vice versa)

14 14 CA 208 Logic PQ PQPQQPQP(P  Q)  (Q  P) 11111 10111 01111 00001 (P  Q) is logically equivalent to (Q  P), in symbols (P  Q)  (Q  P), i.e. the have the same meaning = true in exactly the same situations, false in the same situations! How do you show this? Truth table: show that (P  Q)  (Q  P) is a tautology, hence (P  Q)  (Q  P),

15 15 CA 208 Logic PQ PQPQQPQP(P  Q)  (Q  P) 11111 10001 01001 00001 (P  Q)  (Q  P), Truth table: show that (P  Q)  (Q  P) is a tautology, hence (P  Q)  (Q  P),

16 16 CA 208 Logic We have that: (P  Q)  (Q  P) (P  Q)  (Q  P)  and  are commutative connectives, i.e. you can swap their arguments

17 17 CA 208 Logic PQP → QQ → P (P → Q)  (Q → P) 11 10 01 00 Question: (P → Q)  (Q → P) ???? Truth table: show whether (P → Q)  (Q → P) is a tautology, if so, then (P → Q)  (Q → P), if not...

18 18 CA 208 Logic PQP → QQ → P (P → Q)  (Q → P) 11111 10010 01100 00111 Question: (P → Q)  (Q → P) ???? Truth table: show whether (P → Q)  (Q → P) is a tautology, if so, then (P → Q)  (Q → P), if not...

19 19 CA 208 Logic PQR QRQRP  (Q  R)PQPQ(P  Q)  R(P  (Q  R))  ((P  Q)  R) 111 110 101 100 011 010 001 000 P  (Q  R)  (P  Q)  R Truth table: show that (P  (Q  R))  ((P  Q)  R) is a tautology...

20 20 CA 208 Logic We have established that: (P  Q)  (Q  P) (P  Q)  (Q  P) P  (Q  R)  (P  Q)  R P  (Q  R)  (P  Q)  R There are lots more logical equivalence It turns out that Propositional Logic is a Boolean Algebra (see next two slides...)

21 21 CA 208 Logic Commutativity (P  Q)  (Q  P) Associativity P  (Q  R)  (P  Q)  R Distributivity P  (Q  R)  (P  Q)  (P  R) Idempotency (P  P)  P Absorption (P  T)  P Commutativity (P  Q)  (Q  P) Associativity: P  (Q  R)  (P  Q)  R Distributivity P  (Q  R)  (P  Q)  (P  R) Idempotency (P  P)  P Absorption (P   )  P

22 22 CA 208 Logic De Morgan  (P  Q)  (  P   Q) Double Negation   P  P The Falsum/Absurd:  (P   P)   De Morgan  (P  Q)  (  P   Q) The Verum/True: T (P   P)  T

23 23 CA 208 Logic Now sth. amazing happens... We can use the logical equivalences  to do calculations (simplifications) with propositional logical formulas What is calculation? Large part of it is simplification... Example from arithmetics and high school algebra: 2 + 2 = 4, n (n + 1) – n = (n^2 + n) – n = n^2 Can do the same with logical formulas Use logical equivalence A  B to replace A for B or vice versa  (P   P)  (  P    P)  (  P  P)  (P   P)  T

24 24 CA 208 Logic More examples of using logical equivalences  to do calculations (simplifications) with propositional logical formulas...

25 25 CA 208 Logic Two new symbols (not logical connectives)  and   logical equivalence: A  B iff A  B is a tautology  logical entailment, logically entails, logically follows (a bit like logical consequence |=, |-): A  B iff A  B is a tautology In words: B logically follows from A (A logically entails B) if and only if whenever A is true, then B is true; in all situations where A is true, B is true as well (rings a bell: |=...)  allows us to model |= (|-) as follows: {P1,..., Pn} |= C iff (P1 ...  Pn)  C iff (P1 ...  Pn)  C is a tautology

26 26 CA 208 Logic PQ PQPQ(P  Q)  P 1111 1001 0101 0001 (P  Q) logically entails P, in symbols (P  Q)  P, iff (P  Q)  P is a tautology... Check this by truth table method... Hence also {P, Q} |= P......! Semantic consequence relation...

27 27 CA 208 Logic PQ PQPQ(P  (P  Q))(P  (P  Q))  Q 11111 10001 01101 00101 This is amazing.... We have in effect operationalised the semantic consequence relation |= in terms of  and ultimately in terms of checking whether the corresponding formula with  is a tautology using the truth table method. We In fact “mechanised” part of what it is for a being to be intelligent: the ability to reason from premises to conclusions!!!! AI.... e.g. {P, P  Q} |= Q iff (P  (P  Q))  Q iff (P  (P  Q))  Q is a tautology:

28 28 CA 208 Logic Show that {P  Q, Q  R} |= P  R iff ((P  Q)  (Q  R))  (P  R) iff ((P  Q)  (Q  R))  (P  R) is a tautology: PQR P  QQ  R(P  Q)  (Q  R)((P  Q)  (Q  R))  (P  R) 111 110 101 100 011 010 001 000

29 29 CA 208 Logic PQ PQPQPQPQPQPQPQPQ 111111 100100 010110 000011


Download ppt "1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ 111111 100100 010110 000011."

Similar presentations


Ads by Google