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 conjunt clause)
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)
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).
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)
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:
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:
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:
Definition. A logical formula that is written as a conjunction of clauses, where each clause is a disjunction of exactly two literals, and each literal is either a variable or a negation of a variable, is in two- conjunctive normal form (2CNF).
computer science; they are used to certify that software and hardware will always behave correctly, something that no amount of testing can do.” “Proofs can certify that a computing system will always behave correctly, something that no amount of testing can do.”
will always behave correctly, something that no amount of testing can do.” ∀ ∈ . ¬(Test ⟹ Correct()) Test s = ∀ ∈ (). ℎ , ∈ ℎ(, ) Correct s = ∀ ∈ (). ℎ , ∈ ℎ(, )
else: result = b return result AcceptableBehaviors(max, x = (a, b)): result ≡ max , no other state modified result ∈ , ∧ result ≥ ∧ result ≥ . Hoare triple for if statement: ∧ 1 , ∧ ¬ 2 if then 1 else 2
else: result = b return result AcceptableBehaviors(max, x = (a, b)): result ≡ max , no other state modified result ∈ , ∧ result ≥ ∧ result ≥ . Hoare triple for if statement: ∧ 1 , ∧ ¬ 2 if then 1 else 2 P = True = result ∈ , ∧ result ≥ ∧ result ≥
else: result = b return result Hoare triple for if statement: ∧ 1 , ∧ ¬ 2 if then 1 else 2 P = True = result ∈ , ∧ result ≥ ∧ result ≥ ∧ a > b result = a
else: result = b return result AcceptableBehaviors(max, x = (a, b)): result ≡ max , no other state modified result ∈ , ∧ result ≥ ∧ result ≥ . ∃ ∈ . ⟹ Correct()
enrolled (or bring me a course action to sign now!) • Be paranoid: assumptions about computing systems are not true in practice • Thursday: how hard is it to determine if a 3CNF can be satisfied (and why we care) Due Friday (6:29pm): PS2