Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSE 2353 – September 4th 2002 Logic.

Similar presentations


Presentation on theme: "CSE 2353 – September 4th 2002 Logic."— Presentation transcript:

1 CSE 2353 – September 4th 2002 Logic

2 Review Propositions Operators Truth Tables Precedence Conditionals
Implication Others Truth Tables Precedence Conditionals Contrapositive, Inverse, Converse Tautologies and Contradictions

3 Operations And (conjunction) ^ Or (inclusive disjunction) v
Xor (exclusive disjunction) v Not (negation) ~  If … then (implication)   Iff (biconditional)  Nand | Nor  Construct sentences with words

4 Implication If p then q (otherwise q or ~q) Telecomm Example:
“e” = equipped; “s” = in service; “d” = diags If s then e If d then e If s then d

5 Implication Consistency Check() If (s and e) or ~s then
If (d and e) or ~d then If (s and d) or ~s then Return success Return failure

6 Implication Consistency check() Simpler code; multiple return points
If (s and ~e) then return fail If (d and ~e) then return fail If (s and ~d) then return fail Return success Simpler code; multiple return points

7 Implication Consistency check() Simpler code; no branches; one return.
Val = true; Val &= (~s or e); Val &= (~d or e); Val &= (~s or d); Return Val; Simpler code; no branches; one return.

8 Implication Simplest code. Or
Return (~s or e) and (~d or e) and (~s or d); Or Return ( ~s or d) and (~d or e);

9 Duality Swap t,f Swap ^,v Example (p ^ q) v ~p Dual (p v q) ^ ~p
If expressions are equivalent, so are duals

10 Arguments If you insulted Bob then I’ll never speak to you again. You insulted Bob so I’ll never speak to you again. Premise Conclusion

11 Arguments If you are a mathematician then you are clever. You are clever and rich. Therefore If you are rich then you are a mathematician. Premise Conclustion

12 Laws Idempotent Commutative Associative Absorption Distributive
Involution De Morgan’s Complement

13 Laws Example Prove that (~p ^ q) v ~(p v q)  ~p.

14 Predicates Universal Quantifier  All rats are grey R(x): x is a rat.
G(x): x is grey (x)[R(x) G(x)]

15 Predicates Existential Quantifier  Some rats are grey
R(x): x is a rat. G(x): x is grey (x) [R(x) ^ G(x)]

16 Examples Some children didn’t apologize

17 Examples All students who did their homework passed the final exam.

18 Examples Some body set off the fire alarm and everybody left the building.

19 2 Place Predicates P(x,y) x + y = 7 (x)(y) [ P(x,y) ] is true
(y) (x) [ P(x,y) ] is not true

20 Negation, Specification, and Generalization
~(x)[F(x)] = ~(x)[G(x)] =


Download ppt "CSE 2353 – September 4th 2002 Logic."

Similar presentations


Ads by Google