- 96 Views
- Uploaded on
- Presentation posted in: General

CS1502 Formal Methods in Computer Science

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

CS1502 Formal Methods in Computer Science

Lecture Notes 5

Normal Forms

Boolean Logic

- Using logical equivalences, we can transform logical sentences into more standard forms. Important for applications of computers science.
- We will use the equivalences we saw earlier (e.g., DeMorgan’s laws, …)

- Two FOL sentences P and Q mean the same thing (are logicallyequivalent, written P Q) iff they have the same truth value in all situations. If two sentences are logically equivalent, you can substitute one for the other.
- Identity Laws: P ^ T P; P v F P
- Domination Laws: P v T T; P ^ F F
- Idempotent Laws: P v P P; P ^ P P
- Double Negation: ~~P P
- Commutative Laws: P v Q Q v P; P ^ Q Q ^ P
- Associative Laws: (P v Q) v R P v (Q v R)
(P ^ Q) ^ R P ^ (Q ^ R)

- Distributive Laws: P v (Q ^ R) (P v Q) ^ (P v R)
P ^ (Q v R) (P ^ Q) v (P ^ R)

- DeMorgan’s Laws: ~(P ^ Q) ~P v ~Q
~(P v Q) ~P ^ ~Q

Negation Normal FormNNF

- A sentence S is in negation normal form if the is moved as far insideS as possible. Use DeMorgan’s and double negation laws.[(A B) C] (A B) C (A B) C (A B) C

~(~(P ^ Q) v R)

P ^ Q ^ ~R

- CNF: a sentence that is a conjunction of one or more disjunctions of one or more literals
- DNF: a sentence that is a disjunction of one or more conjunctions of one or more literals
- First put the sentence in negation normal form, then continue to transform it.
- CNF example: (~A v C v D) ^ (A v ~C v E) ^ W
- DNF example: (~A ^ C ^ D) v (A ^ ~C ^ E) v W

Example

[(A B) C] (A B) C(A B) C(A B) C NNF, CNF(A C) (B C) NNF,DNF

We will use these normal forms when we do resolution

theorem proving

Cube(a) ^ Small(a) ^ ~Red(a)

Trick question!!

CNF: all outside connectives are ^

(each term contains just one literal)

DNF: all inside connectives are ^

(there is just one term)

- The circuits in computers have inputs (0 or 1) and produce outputs (0 or 1). In 1938, Claude Shannon showed how the rules of propositional logic could be used to design circuits (in his MS thesis at MIT). These rules form the basis for BooleanAlgebra.
- 1 is True and 0 is False.
- + is v ∙ is ^ ¯ is ~ (sometimes ‘) + is Xor
- All the logical equivalences we learned apply, as do the truth-table methods

- Example of hardware minimization: Not covered; we ran out of time.

Gates are Building Blocks of Circuits

AND

And, Xor, Not, Or, Nor, Nand

Not covered, we ran out of time.