Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Class 5: Conjunctive Normal Form, Computing, Qualifiers

David Evans
September 05, 2017

Class 5: Conjunctive Normal Form, Computing, Qualifiers

cs2102: Discrete Mathematics
University of Virginia, Fall 2017

See course site for notes:
https://uvacs2102.github.io

David Evans

September 05, 2017
Tweet

More Decks by David Evans

Other Decks in Programming

Transcript

  1. Plan Review: Logic Formulas, Valid, Satisfiable Conjunctive Normal Form, 3CNF

    Computing Machines Quantifiers Add date is today! If you aren’t enrolled in the class yet, need to get a course action form signed and delivered today. PS1: grading almost finished, everyone should receive grade by tonight. Comments will be posted soon.
  2. A formula is valid if there is no way to

    make it false. A formula is satisfiable if there is some way to make it true. If NOT(X) is valid, what does that mean about X?
  3. Logical Formula to Truth Table How big is the table?

    a1 a2 a3 … an Result T T T … T T T T … F … … … … … … … … F F F … T F F F … F
  4. Truth Table to Disjunctive Normal Form Disjunctive normal form: OR

    of clauses, each clause is AND of literals. a1 a2 a3 … an Result T T T … T T T T … F … … … … … … … … F F F … T F F F … F
  5. Truth Table to Disjunctive Normal Form a1 a2 a3 …

    an Result T T T … T T T T … F … … … … … … … … F F F … T F F F … F clauses = Set() # empty is False for each row in table: if result(row): clauses.add(row as conjunct clause)
  6. Truth Table to Conjunctive Normal Form a1 a2 a3 …

    an Result T T T … T T T T … F … … … … … … … … F F F … T F F F … F
  7. Truth Table to Conjunctive Normal Form a1 a2 a3 …

    an Result T T T … T T T T … F … … … … … … … … F F F … T F F F … F clauses = Set() for each row in table: if not result(row): clauses.add(row as disjunctive clause)
  8. 3CNF Definition. A logical formula that is written as a

    conjunction of clauses, where each clause is a disjunction of exactly three literals, and each literal is either a variable or a negation of a variable, is in three- conjunctive normal form (3CNF).
  9. 3CNF Definition. A logical formula that is written as a

    conjunction of clauses, where each clause is a disjunction of exactly three literals, and each literal is either a variable or a negation of a variable, is in three- conjunctive normal form (3CNF). (A ∨ B ∨ ¬C) ∧ (A ∨ B ∨ C) ∧ (¬A ∨ ¬B ∨ C)
  10. Definition. A logical formula that is written as a conjunction

    of clauses, where each clause is a disjunction of exactly three literals, and each literal is either a variable or a negation of a variable, is in three- conjunctive normal form (3CNF). (A ∨ B) Convert clause with two literals to 3CNF:
  11. Definition. A logical formula that is written as a conjunction

    of clauses, where each clause is a disjunction of exactly three literals, and each literal is either a variable or a negation of a variable, is in three- conjunctive normal form (3CNF). (A) Convert clause with one literal to 3CNF:
  12. Definition. A logical formula that is written as a conjunction

    of clauses, where each clause is a disjunction of exactly three literals, and each literal is either a variable or a negation of a variable, is in three- conjunctive normal form (3CNF). (A ∨ B ∨ C ∨ D) Convert clause with four literals to 3CNF:
  13. (A ∨ B ∨ C ∨ D ∨ E ∨

    …) Convert clause with any number of literals to 3CNF:
  14. Physics of Computation #25 control source output If the control

    is “on”, the source flows to the output. Otherwise, the output is “off”. A transistor is a device used to amplify or switch electronic signals (like a faucet). What logical operation is this?
  15. Logic from Transistors With transistors it is possible to make

    two switches: control source output S C O 1 1 1 1 0 0 0 1 0 0 0 0 normal control
  16. Making Transistors Today • A transistor is made of a

    solid piece of semiconductor material. • A semiconductor is a material that has electrical conductivity that varies dynamically between that of a conductor (on) or an insulator (off). • Silicon is a semiconductor.
  17. Transistors in your Smartphone 28 Qualcomm Snapdragon 821 ∼2 Billion

    transistors Cost: $18 (> 1 Million transistors/cent) 14 nanometers process (about 25M transistors per mm2) Snapdragon 835, mid-2017: 3B transistors, 10nm process
  18. Are NANDs the most efficient? 2-bit adder b a s

    c a b s c 0 0 0 0 0 1 1 0 1 0 1 0 1 1 0 1 Check Check
  19. Inside the Mifare Chip 0.001 mm (1000 nm) 0.01 mm

    (10000 nm) Pictures by Karsten Nohl
  20. Zooming in on the Logic… rotated rotated + mirrored 4

    NAND: Y = !(A & B & C & D) match match Pictures by Karsten Nohl
  21. Well-Ordering Principle Every nonempty set of non-negative integers has a

    smallest element. Can we express this using a quantified logical formula?
  22. Charge • Add date is today: make sure you are

    enrolled (or get a course action form signed now!) • Computers are all built on logic – In theory, NAND is all we need – In practice, efficiency matters Due Friday (6:29pm): PS2