27.10.2011 Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer.

Slides:



Advertisements
Similar presentations
Software Verification 2 Automated Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität and Fraunhofer Institut für.
Advertisements

Completeness and Expressiveness
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
Some important properties Lectures of Prof. Doron Peled, Bar Ilan University.
Artificial Intelligence Chapter 13 The Propositional Calculus Biointelligence Lab School of Computer Sci. & Eng. Seoul National University.
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut.
Techniques for Proving the Completeness of a Proof System Hongseok Yang Seoul National University Cristiano Calcagno Imperial College.
Rigorous Software Development CSCI-GA Instructor: Thomas Wies Spring 2012 Lecture 11.
Logic.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Mar, 4, 2015 Slide credit: some slides adapted from Stuart.
Logic Concepts Lecture Module 11.
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages Chapter 3 : Describing Syntax and Semantics Axiomatic Semantics.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt.
Computability and Complexity 9-1 Computability and Complexity Andrei Bulatov Logic Reminder (Cnt’d)
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Brief Introduction to Logic. Outline Historical View Propositional Logic : Syntax Propositional Logic : Semantics Satisfiability Natural Deduction : Proofs.
Logic in Computer Science Transparency No Chapter 3 Propositional Logic 3.6. Propositional Resolution 3.7. Natural Deduction.
Knoweldge Representation & Reasoning
Technion 1 (Yet another) decision procedure for Equality Logic Ofer Strichman and Orly Meir Technion.
CS 4700: Foundations of Artificial Intelligence
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
Propositional Calculus Math Foundations of Computer Science.
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Intro to Discrete Structures
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut.
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.
Software Verification 2 Automated Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität and Fraunhofer Institut für.
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
Pattern-directed inference systems
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Great Theoretical Ideas in Computer Science about AWESOME Some Generating Functions Probability Infinity MATH Some Formal Logic (which is really.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
0 What logic is or should be Propositions Boolean operations The language of classical propositional logic Interpretation and truth Validity (tautologicity)
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View BDDs.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
Explorations in Artificial Intelligence Prof. Carla P. Gomes Module Logic Representations.
1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ
Semantics In Text: Chapter 3.
LECTURE LECTURE Propositional Logic Syntax 1 Source: MIT OpenCourseWare.
CS6133 Software Specification and Verification
1 The Wumpus Game StenchBreeze Stench Gold Breeze StenchBreeze Start  Breeze.
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut.
Artificial Intelligence “Introduction to Formal Logic” Jennifer J. Burg Department of Mathematics and Computer Science.
CPSC 422, Lecture 21Slide 1 Intelligent Systems (AI-2) Computer Science cpsc422, Lecture 21 Oct, 30, 2015 Slide credit: some slides adapted from Stuart.
Nikolaj Bjørner Microsoft Research DTU Winter course January 2 nd 2012 Organized by Flemming Nielson & Hanne Riis Nielson.
Chapter 7. Propositional and Predicate Logic Fall 2013 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer.
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
Daniel Kroening and Ofer Strichman 1 Decision Procedures An Algorithmic Point of View Basic Concepts and Background.
Knowledge Repn. & Reasoning Lecture #9: Propositional Logic UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2005.
Software Verification 2 Automated Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität and Fraunhofer Institut für.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Knowledge Representation and Reasoning
SS 2017 Software Verification LTL monitoring
The Propositional Calculus
Lecture 2 Propositional Logic
Propositional Calculus: Boolean Algebra and Simplification
SS 2017 Software Verification CTL model checking, BDDs
Software Verification 2 Automated Verification
SS 2018 Software Verification SAT & FOL
SS 2017 Software Verification Automated Verification
Semantics In Text: Chapter 3.
Back to “Serious” Topics…
Presentation transcript:

Software Verification 1 Deductive Verification Prof. Dr. Holger Schlingloff Institut für Informatik der Humboldt Universität und Fraunhofer Institut für Rechnerarchitektur und Softwaretechnik

Folie 2 H. Schlingloff, Software-Verifikation I Propositional Logic A formal specification method consists of three parts  syntax, i.e., what are well-formed specifications  semantics, i.e., what is the meaning of a specification  calculus, i.e., what are transformations or deductions of a specification Propositional logic: probably the first and most widely used specification method  dates back to Aristotle, Chrysippus, Boole, Frege, …  base of most modern logics  fundamental for computer science

Folie 3 H. Schlingloff, Software-Verifikation I Syntax of Propositional Logic Let Ρ be a finite set {p 1,…,p n } of propositions and assume that ,  and (, ) are not in Ρ Syntax PL ::= Ρ |  | (PL  PL)  every p  is a wff   is a wff („falsum“)  if  and  are wffs, then (  ) is a wff  nothing else is a wff

Folie 4 H. Schlingloff, Software-Verifikation I Remarks Ρ may be empty  still a meaningful logic! Minimalistic approach  infix-operator  necessitates parentheses  other connectives can be defined as usual ¬  ≙ (    )(linear blowup!) Τ ≙ ¬  (  ) ≙ (¬  ) (  ) ≙ ¬(¬  ¬  ) ≙ ¬(  ¬  ) (  ) ≙ ((  )  (  )) (exponential blowup!)  operator precedence as usual  literal = a proposition or a negated proposition

Folie 5 H. Schlingloff, Software-Verifikation I Exercise Abbreviations ¬  ≙ (    ) also ~  Τ ≙ ¬  (  ) ≙ (¬  ) also (  +  ), (  |  ), (  v  ) (  ) ≙ ¬(¬  ¬  ) ≙ ¬(  ¬  ) also (  *  ), (  &  ), (  ^  ) (  ) ≙ ((  )  (  )) also (   ), (   ) Write ((p  q)  ¬p) unabbreviated

Folie 6 H. Schlingloff, Software-Verifikation I Choice of the Signature Te set Ρ={p 1,…,p n } of propositions is also called the signature of the logic The choice of Ρ often is the decisive abstraction step for modelling a system  it determines which aspects are “accessible” to the specification  Wittgenstein: “die Welt ist alles was der Fall ist”; the world consists of all true propositions  e.g., sun-is-shining, pot-on-stove, line-busy, button_pressed, window5infocus, motor-on, …  names should be chosen with consideration

Folie 7 H. Schlingloff, Software-Verifikation I Semantics of Propositional Logic Propositional Model  Truth value universe U: {true, false}  Interpretation I: assignment Ρ ↦ U  Model M: (U,I) Validation relation ⊨ between model M and formula   M ⊨ p if I(p)=true  M ⊭   M ⊨ (  ) if M ⊨  implies M ⊨  M validates or satisfies  iff M ⊨    is valid ( ⊨  ) iff every model M validates    is satisfiable (SAT(  )) iff some model M satisfies 

Folie 8 H. Schlingloff, Software-Verifikation I Propositional Calculus Various calculi have been proposed  boolean satisfiability (SAT) algorithms  tableau systems, natural deduction,  enumeration of valid formulæ Hilbert-style axiom system ⊢ (  (  )) (weakening) ⊢ ((  (  ))  ((  )  (  ))) (distribution) ⊢ (¬¬  ) (excluded middle) , (  ) ⊢  (modus ponens) Derivability  All substitution instances of axioms are derivable  If all antecedents of a rule are derivable, so is the consequent

Folie 9 H. Schlingloff, Software-Verifikation I An Example Derivation Show ⊢ (p  p) (1) ⊢ (p  ((p  p)  p))  ((p  (p  p))  (p  p)) (dis) (2) ⊢ (p  ((p  p)  p)) (wea) (3) ⊢ ((p  (p  p))  (p  p)) (1,2,mp) (4) ⊢ (p  (p  p)) (wea) (5) ⊢ (p  p) (3,4,mp)

Folie 10 H. Schlingloff, Software-Verifikation I Correctness and Completeness Correctness: ⊢   ⊨  Only valid formulæ can be derived  Induction on the length of the derivation  Show that all axiom instances are valid, and that the consequent of (mp) is valid if both antecedents are Completeness: ⊨   ⊢  All valid formulæ can be derived  Show that consistent formulæ are satisfiable ~ ⊢ ¬   ~ ⊨ ¬ 

Folie 11 H. Schlingloff, Software-Verifikation I Consistency and Satisfiability A finite set Φ of formulæ is consistent, if ~ ⊢ ¬Λ  Φ  Extension lemma: If Φ is a finite consistent set of formulæ and  is any formula, then Φ  {  } or Φ  {¬  } is consistent  Assume ⊢ ¬(Φ  ) and ⊢ ¬(Φ  ¬  ). Then ⊢ (Φ  ¬  ) and ⊢ (Φ  ¬¬  ). Therefore ⊢ ¬Φ, a contradiction. Let SF(  ) be the set of all subformulæ of  For any consistent , let  # be a maximal consistent extension of  (i.e.,  # and for every  SF(  ), either  # or ¬  #. (Existence guaranteed by extension lemma)

Folie 12 H. Schlingloff, Software-Verifikation I Canonical models For a maximal consistent set  #, the canonical model CM(  # ) is defined by I(p)=true iff p  #. Truth lemma: For any  SF(  ), I(  )=true iff   #  Case  =p: by construction  Case  =  : Φ  {  } cannot be consistent  Case  =(  1   2 ): by induction hypothesis and derivation Therefore, if  is consistent, then for any maximal consistent set  #, CM(  # ) ⊨   any consistent formula is satisfiable  any unsatisfiable formula is inconsistent  any valid formula is derivable

Folie 13 H. Schlingloff, Software-Verifikation I Example: Combinational Circuits Multiplexer  S selects whether I 0 or I 1 is output to Y  Y = if S then I 1 else I 0 end  (Y  ((S  I 1 )  (¬S  I 0 ))) Pictures taken from: I0I0 I1I1 SY

Folie 14 H. Schlingloff, Software-Verifikation I Boolean Specifications Evaluator (output is 1 if input matches a certain binary value) Encoder (output i is set if binary number i is on input lines) Majority function (output is 1 if half or more of the inputs are 1) Comparator (output is 1 if input0 > input1) Half-Adder, Full-Adder, …

Folie 15 H. Schlingloff, Software-Verifikation I Software Example Code generator optimization  if (p and q) then if (r) then x else y else if (q or r) then y else if (p and not r) then x else y Loop optimization

Folie 16 H. Schlingloff, Software-Verifikation I Puzzle Example: Ivor Spence’s Sudoku

Folie 17 H. Schlingloff, Software-Verifikation I How Does He Do It? Propositional modelling  9 propositions per cell: proposition “ijk” indicates that row i, column j contains value k  individual cell clauses - each cell contains exactly one value  (ij1 v ij2 v … v ij9) ^ ~(ij1 ^ ij2) ^ … ^ ~(ij8 ^ ij9)  row and column clauses - each row i contains each number, exactly once  (i11 v … v i91) ^ (i12 v … v i92) ^ … (i19 v … v i99)  j 1  j 2, k=1..9: ~(ij 1 k ^ ij 2 k) - same for columns  block clauses – similar  pre-filled cells – easy SAT solving  729 propositions, ca clauses  few seconds

Folie 18 H. Schlingloff, Software-Verifikation I Verification of Boolean Functions Latch-Up: can a certain line go up?  does (  ¬L 0 ) hold?  is (  L 0 ) satisfiable? Given ,  ; does (  ) hold?  usually reduced to SAT: is ((  ¬  )  (¬  )) satisfiable?  efficient SAT-solver exist (annual competition)  partitioning techniques any output depends only on some inputs  find which ones  generate test patterns (BIST: built-in-self-test)

Folie 19 H. Schlingloff, Software-Verifikation I Optimizing Boolean Functions Given  ; find  such that (  ) holds and  is „optimal“  much harder question  optimal wrt. speed / size / power /…  translation to normal form (e.g., OBDD)