Presentation is loading. Please wait.

Presentation is loading. Please wait.

Propositional Equivalences Rosen 5th and 6th Editions section 1.2

Similar presentations


Presentation on theme: "Propositional Equivalences Rosen 5th and 6th Editions section 1.2"— Presentation transcript:

1 Propositional Equivalences Rosen 5th and 6th Editions section 1.2

2 I assume you know what follows

3

4

5

6 Okay? If not then please read appropriate section from Rosen

7

8

9 // // are functions f and g logically equivalent? public class Obfuscate { public static boolean f(int x,int y){ boolean z; if (!(x>5 || (x<=5 && y<3))) z = true; else z = false; return z; } public static boolean g(int x,int y){return x<=5 && y>=3;} public static void main(String[] args) { int n = Integer.parseInt(args[0]); int m = Integer.parseInt(args[1]); System.out.println(f(n,m) + " " + g(n,m));

10 What’s the difference between
& and && | and ||

11

12

13 Can you think of a reason why we might use
| in place of || & in place of &&

14 Propositional Equivalences

15

16

17


Download ppt "Propositional Equivalences Rosen 5th and 6th Editions section 1.2"

Similar presentations


Ads by Google