Formal Methods in Computer Science CS1502 Review for Exam 2 PowerPoint PPT Presentation

presentation player overlay
1 / 21
About This Presentation
Transcript and Presenter's Notes

Title: Formal Methods in Computer Science CS1502 Review for Exam 2


1
Formal Methods in Computer ScienceCS1502Review
for Exam 2
  • Patchrawat Uthaisombut
  • University of Pittsburgh

2
Outline
  • Translation
  • well-formed formula
  • Aristotelian forms
  • tricky points
  • Proofs
  • Proofs with ?, ?
  • FO counterexample
  • Interpretation
  • Tautology,truth-functional form
  • Tautological consequence
  • FO validity
  • FO consequence

3
Well-Formed Formula (wff)
4
Well-Formed Formula
  • Definition of wff.
  • Satisfaction of P(x)
  • Object c satisfies S(x) if and only if S(c) is
    true.
  • Truth value of P(c)
  • Truth value of ?x P(x)
  • ?x S(x) is true if and only if every object in
    the domain satisfies S(x).
  • Truth value of ?x P(x)
  • ?x S(x) is true if and only if at least one
    object in the domain satisfies S(x).

5
Wffs vs Sentences
  • Differences between wffs and sentences.
  • Sentences are wffs with no free variables.
  • All sentences are wffs
  • Not all wffs are sentences.
  • Translate this into logic.

6
Translation
7
Aristotelian Forms
  • All Ps are Qs
  • ?x (P(x) ? Q(x))
  • Some Ps are Qs
  • ?x (P(x) /\ Q(x))
  • No Ps are Qs
  • All Ps are not Qs.
  • ?x (P(x) ? Q(x))
  • ?x (P(x) /\ Q(x))
  • Some Ps are not Qs
  • Not all Ps are Qs.
  • ?x (P(x) /\ Q(x))
  • ?x (P(x) ? Q(x))

8
Tricky point
  • No tets are in the same column.
  • ?x ?y (Tet(x) /\ Tet(y)) ? SameCol(x,y)
  • Consider the case xb and yb.
  • Incorrect translation.

9
Identity and Variables
  • For every pair of objects, it is the case that
  • ?x ?y (x ! y ? )
  • No tets are in the same column.
  • ?x ?y (x ! y /\ Tet(x) /\ Tet(y))
    ?SameCol(x,y)

10
Tricky point
  • There are two Cubes that are Small
  • ?x ?y ( (Cube(x) /\ Cube(y) ) /\ (Small(x) /\
    Small(y))
  • Incorrect translation

11
Identity and Variables
  • There exist two objects which are
  • ?x ?y (x ! y /\ )
  • There are two Cubes that are Small
  • ?x ?y ( (x ! y /\ Cube(x) /\ Cube(y) ) /\
    (Small(x) /\ Small(y))

12
  • There is exactly 1 cube.
  • There is at least one cube and for any object in
    the domain, if it is a cube, it is that same one.
  • ?x (Cube(x) /\ ?y (Cube(y) ? yx))
  • ?x ( /\ ?y ( ? yx))

13
Exercises
  • Object c is not in the same row as any cube.
  • No cubes are the same size.
  • Every tet has exactly one object behind it.
  • There are two cubes that are in front of all
    tets.

14
Different types of truths
15
Different Kinds of Truths
  • Tautologies bool conn.
  • First-order validity bool conn. quan.
    .
  • Logical truths bool conn. quan.
    pred.
  • Model-specific truths bool conn. quan. pred.
    restriction of the model/worlds.
  • ?x Tet(x) ? ?x Tet(x)
  • ?x Tet(x) ? ?x (Cube(x) \/ Dodec(x))

16
Truth-Functional Form
17
Finding the truth-functional form
  • Tet(a) /\ ((Tet(b) \/ ?x Cube(x)) ? Tet(b))
  • A /\ ((B \/ C) ? B)
  • ?x Large(x) /\ ?y(Tet(y) ? ?z LeftOf(y,z))
  • A /\ B

B
C
B
A
A
B
18
First-Order Counterexample
19
FO counterexample
  • ?x SameShape(x,x)
  • Replace the predicate with nonsensical one.
  • ?x SameShape(x,x) becomes ?x P(x,x)
  • Come up with a interpretation of the predicate
  • P(x,y) means x is taller than y.
  • Come up with a world (not necessarily Tarskis
    world).
  • A world with 3 people John, James, Jack with
    height 4, 5, 6 respectively.
  • Verify that the sentence is false under this
    interpretation in this world.
  • P(John, John) is false. Thus, ?x P(x,x) is
    false.
  • State the conslution
  • Not an FO validity.

20
FO counterexample
  • To demonstrate that a sentence is not an FO
    validity.
  • To demonstrate that in an argument, the
    conclusion is not an FO consequence of the
    premises.

21
Proofs
Write a Comment
User Comments (0)
About PowerShow.com