CSE 3341.03 Winter 2008 Introduction to Program Verification January 29 how wang works.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Discrete Structures CISC 2315
The Theory of NP-Completeness
1 NP-Complete Problems. 2 We discuss some hard problems:  how hard? (computational complexity)  what makes them hard?  any solutions? Definitions 
CSE Winter 2008 Introduction to Program Verification January 24 tautology checking, take 2.
© The McGraw-Hill Companies, Inc., Chapter 8 The Theory of NP-Completeness.
The Theory of NP-Completeness
1 Other Models of Computation. 2 Models of computation: Turing Machines Recursive Functions Post Systems Rewriting Systems.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
Analysis of Algorithms CS 477/677
CSE 421 Algorithms Richard Anderson Lecture 27 NP Completeness.
Fall 2004COMP 3351 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 22 Instructor: Paul Beame.
1 The Theory of NP-Completeness 2 NP P NPC NP: Non-deterministic Polynomial P: Polynomial NPC: Non-deterministic Polynomial Complete P=NP? X = P.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Themes of Presentations Rule-based systems/expert systems (Catie) Software Engineering (Khansiri) Fuzzy Logic (Mark) Configuration Systems (Sudhan) *
1 UNIT -6 P, NP, and NP-Complete. 2 Tractability u Some problems are intractable: as they grow large, we are unable to solve them in reasonable time u.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
Inference is a process of building a proof of a sentence, or put it differently inference is an implementation of the entailment relation between sentences.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
Logics for Data and Knowledge Representation Propositional Logic: Reasoning Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto.
Tonga Institute of Higher Education Design and Analysis of Algorithms IT 254 Lecture 8: Complexity Theory.
CHAPTERS 7, 8 Oliver Schulte Logical Inference: Through Proof to Truth.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
Cs3102: Theory of Computation Class 24: NP-Completeness Spring 2010 University of Virginia David Evans.
CSC 413/513: Intro to Algorithms NP Completeness.
CSCI 2670 Introduction to Theory of Computing November 29, 2005.
CSCI 3160 Design and Analysis of Algorithms Tutorial 10 Chengyu Lin.
Cliff Shaffer Computer Science Computational Complexity.
1 The Theory of NP-Completeness 2 Cook ’ s Theorem (1971) Prof. Cook Toronto U. Receiving Turing Award (1982) Discussing difficult problems: worst case.
CSE Winter 2008 Introduction to Program Verification January 31 proofs through simplification.
NP-Complete Problems. Running Time v.s. Input Size Concern with problems whose complexity may be described by exponential functions. Tractable problems.
1 Chapter 34: NP-Completeness. 2 About this Tutorial What is NP ? How to check if a problem is in NP ? Cook-Levin Theorem Showing one of the most difficult.
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
CS6133 Software Specification and Verification
NP-Complete problems.
CSE Winter 2008 Introduction to Program Verification January 15 tautology checking.
Module #7: Algorithmic Complexity Rosen 5 th ed., §2.3.
CS 3343: Analysis of Algorithms Lecture 25: P and NP Some slides courtesy of Carola Wenk.
CS6045: Advanced Algorithms NP Completeness. NP-Completeness Some problems are intractable: as they grow large, we are unable to solve them in reasonable.
CSE Winter 2008 Introduction to Program Verification for-loops; review.
1 CSE 326: Data Structures: Graphs Lecture 24: Friday, March 7 th, 2003.
NPC.
1 Time Complexity We use a multitape Turing machine We count the number of steps until a string is accepted We use the O(k) notation.
Young CS 331 D&A of Algo. NP-Completeness1 NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and.
Introduction to NP-Completeness Tahir Azim. The Downside of Computers Many problems can be solved in linear time or polynomial time But there are also.
1 Ch 10 - NP-completeness Tractable and intractable problems Decision/Optimization problems Deterministic/NonDeterministic algorithms Classes P and NP.
Space Complexity. Reminder: P, NP classes P is the class of problems that can be solved with algorithms that runs in polynomial time NP is the class of.
The Theory of NP-Completeness 1. Nondeterministic algorithms A nondeterminstic algorithm consists of phase 1: guessing phase 2: checking If the checking.
1 1. Which of these sequences correspond to Hamilton cycles in the graph? (a) (b) (c) (d) (e)
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
CS 154 Formal Languages and Computability May 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CSE 332: NP Completeness, Part II Richard Anderson Spring 2016.
8.1 Determine whether the following statements are correct or not
Chapter 10 NP-Complete Problems.
tautology checking continued
Richard Anderson Lecture 26 NP-Completeness
Richard Anderson Lecture 26 NP-Completeness
Hard Problems Introduction to NP
Propositional Calculus: Boolean Algebra and Simplification
How Hard Can It Be?.
Computational Complexity
Time Complexity We use a multitape Turing machine
NP-Completeness Reference: Computers and Intractability: A Guide to the Theory of NP-Completeness by Garey and Johnson, W.H. Freeman and Company, 1979.
P, NP and NP-Complete Problems
P, NP and NP-Complete Problems
Instructor: Aaron Roth
Presentation transcript:

CSE Winter 2008 Introduction to Program Verification January 29 how wang works

Wang's algorithm: overview wang program checks proposition containing non-logical terms by checking and transforming the sequent constructed from the input input: true, false, arbitrary terms, logical operators no semantic (upper-case)variables; syntactic variables: terms with arity 0 e. g. x, a23, etc.

Wang's algorithm strictly syntactic tautology used a semantic approach bound truth-values to variables wang uses equivalence-preserving rewrite rules to transform sequents If S1 transforms to S2 then (S1 iff S2). so if S2 is a tautology, S1 is also

algorithm has the typical structure of a rules-based algorithm flow-of-control is implicit determined by the input data iterates until no rule applies notice that unlike tautology, wang is biased toward truth rather falsity shortcuts if tautology criterion is met tautology shortcuts if falsifiabilty criterion is met Why is "bias toward truth" better?

example rewrite rule for sequents Replace a sequent with a conjunction on the right-hand side by two copies in which the conjunction is replaced by each of its conjuncts: {.. } >> {P and Q,.. } is rewritten as {.. } >> {P,.. } and {.. } >> {Q,.. }. The propositional form of this rule is: (R implies (P and Q) or S) iff ((R implies P or S) and (R implies Q or S))

correctness of the algorithm why is termination guaranteed? why is the algorithm correct ? I. e., why does computing a valid/invalid sequent guarantee that the input proposition is valid or invalid?

how to make a counter-example? suppose input is not a tautology: how can we construct a counter-example? examples: |: p and q and r implies not p or w. Counterexample: each of [r, q, p] is true and w is false. * Not valid. |: p implies p implies q. ?

verifying wang's rules We can use tautology to prove the rules are right (assuming tautology is correctly programmed) just need to know how to recode the rules into propositional formulae. Exercises 3.5, 3.7

worst-case running time? tautologies are the worst case for the tautology program: 2 n steps for n variables what's the worst case for wang? A implies P 1 and... P m we get m sequents of the form {A} >> {P i } each of which can split into more so we could get exponential growth in sequents as m increases ("Sorcerer's Apprentice")

bi-conditionals long bi-conditional propositions are stressful for both wang and tautology tautology: large number of variables time is exponential in # of variables wang: large number of sequent splits all sequents must be tested, and # of sequents is exponential but there is a simple linear algorithm! p. 33

How hard is it to check tautologies? measure difficulty of a problem in terms of time complexity (generalize over all algorithms that solve the problem) complexity = time or space function which ultimately bounds running time or space used, for all inputs take time-complexity to be some function of length of input

complexity categories: easy: polynomial time hard: polynomial time on unbounded # of parallel processors intractable: worse than polynomial time even with unbounded parallelism

is tautology checking intractable, hard, or easy? the two algorithms we’ve looked at suggest that tautology checking, using those algorithms, is not easy worst-case is exponential on a deterministic processor but still could be tractable we don’t know the complexity of tautology-checking

Is satisfiability easy? easy = there is a method with polynomial time on a single processor. Perhaps not: tautology checking might have complexity O(2 N) on a single processor as suggested by truth-table method. But does Wang's method ever require O(2 N) ? (not always — but we can't show that it never does.) No one knows. Famous result (Steve Cook, U of T, 1970): Satisfiability is tractable

satisifiability is "NP-complete" Cook's famous theorem: all tractable yes- no problems can be expressed as satisfiability questions! so if satisfiability is easy, all tractable problems are easy! key unsolved problem: is class of P(easy) problems =class of NP(tractable problems)?