Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 CS1502 Formal Methods in Computer Science Notes 15 Problem Sessions.

Similar presentations


Presentation on theme: "1 CS1502 Formal Methods in Computer Science Notes 15 Problem Sessions."— Presentation transcript:

1 1 CS1502 Formal Methods in Computer Science Notes 15 Problem Sessions

2 2 Preliminaries 3 proofs we will be able replace with Taut Con 1 proof we will be able to replace with FO Con First 4 proofs in http://www.cs.pitt.edu/~wiebe/courses/CS1502/lectures/lec15solutions.pdf Why? –Review –Illustrate that you don’t *need* any of the con rules

3 3 6 Fitch Proofs We’ll do them in Fitch in lecture Next 6 proofs in http://www.cs.pitt.edu/~wiebe/courses/CS1502/lectures/lec15solutions.pdf http://www.cs.pitt.edu/~wiebe/courses/CS1502/lectures/lec15solutions.pdfhttp://www.cs.pitt.edu/~wiebe/courses/CS1502/lectures/lec15solutions.pdf Problems 1-3: use only Intro/Elim rules Problem 4: may use Taut Con on at most two support sentences Problems 5-6: May use FO Con on at most one support sentence, and Taut Con for the resolution step

4 4 Problem 7 Prove the argument below is valid using a Fitch- style proof. Some teachers are scholars. No scholar has time for either football or basketball.  Some teachers do not have time for basketball.

5 5 Informal Proof Prove that if the square of an integer is even, then so is that integer. Proving the contrapositive is easier: If an integer is not even, then its square isn’t even either. Let n be an integer. Assume ~Even(n), i.e., Odd(n). Then we can express n as 2m + 1 for some m. But we see that n*n = 2(2m*m + 2m) + 1, showing that n*n is odd. Thus, we have shown ~Even(n)  ~Even(n*n)

6 6 Review Questions around 10.13, 10.17; (see next slide) Recall the circles from lecture: 1. inner – tautological consequence 2. middle – FO but not tautological cons 3. Outer – logical but not FO cons 4. Outside the circle – not a logical cons Here are answers:10.10: 2; 10.13: 1; 10.14: 3; 10.15: 2; 10.16: 1; 10.17: 3; Varations: in lecture

7 7 Necessary S is always true PossibleSatisfiable S could be true Equivalence S and S’ always have the same truth values Consequence Whenever P1…Pn are true, Q is also true Tautological Translate sentences into propositional logic using TFF algorithm S is a tautology S is Tautologically possible S and S’ are Tautologically equivalent Q is a tautological consequence of P1…Pn First Order (FO) Replace predicates with nonsense names S is an FO validity S is FO possible (FO satisfiable) S and S’ are FO equivalent Q is a FO consequence of P1…Pn Logical S is logically necessary (a logical truth) (logically valid) S is logically possible (satisfiable) S and S’ are logically equivalent Q is a logical consequence of P1…Pn

8 8 Problem 8 Does  x  y P(x, y) follow from  x  y P(x, y)?  x  y P(x, y)? Hint: does  x  y SameRow(x, y) follow from  x  y SameRow(x, y)?

9 9 Problem 9  Does  x  y [P(x, y)  Q(x)] follow from  x [  y P(x, y)  Q(x)]?  Hint: does  x  y [LeftOf(x,y)  Large(x)] follow from  x [  y LeftOf(x,y)  Large(x)]?

10 10 Problem 10 all x (P(x)  Q(x)) all x (Q(x)  P(x)) ----- All x (P(x)  Q(x))


Download ppt "1 CS1502 Formal Methods in Computer Science Notes 15 Problem Sessions."

Similar presentations


Ads by Google