PredicatesAndProgramming

PredicatesAndProgramming - COM SFWR 707 Formal Specication...

Info icon This preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
COM SFWR 707 Formal Specification Techniques Dr. R. Khedri COM SFWR 707 Formal Specification Techniques Dr. Ridha Khedri Department of Computing and Software, McMaster University Canada L8S 4L7, Hamilton, Ontario Acknowledgments : Material based on A Logical Approach to Discrete Math by D. Gries and F. B. Schneider. Dr. R. Khedri COM SFWR 707 Formal Specification Techniques
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
COM SFWR 707 Formal Specification Techniques Dr. R. Khedri Introduction Universal quantification Existential quantification Part I Predicate Calculus Dr. R. Khedri COM SFWR 707 Formal Specification Techniques
Image of page 2
COM SFWR 707 Formal Specification Techniques Dr. R. Khedri Introduction Universal quantification Existential quantification Program Verification Introduction Predicate logic is an extension of propositional logic It allows the use of variables of types other than IB This extension leads to a logic with enhanced expressive Propositional calculus permits reasoning about formulas constructed from boolean variables and boolean operators Predicate calculus permits reasoning about a more expressive class of formulas Dr. R. Khedri COM SFWR 707 Formal Specification Techniques
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
COM SFWR 707 Formal Specification Techniques Dr. R. Khedri Introduction Universal quantification Existential quantification Program Verification Introduction A predicate-calculus formula is a boolean expression in which some boolean variables may have been replaced by: Predicates : applications of boolean functions whose arguments may be of types other than IB Universal and existential quantification Example 1 x < y x = z = q ( x , z + x ) 2 ( x , y | : f ( x , y ) = f ( y , x ) ) Dr. R. Khedri COM SFWR 707 Formal Specification Techniques
Image of page 4
COM SFWR 707 Formal Specification Techniques Dr. R. Khedri Introduction Universal quantification Existential quantification Program Verification Introduction The pure predicate calculus includes 1 The axioms of propositional calculus 2 The axioms for quantifications ( x | R : P ) and ( x | R : P ) 3 The inference rules of the predicate calculus 1 Substitution: E E [ v := F ] 2 Transitivity: X = Y , Y = Z X = Z 3 Leibniz: X = Y E [ z := X ]= E [ z := Y ] 4 Leibniz for quantification: P = Q * ( x | E [ z := P ] : S ) = * ( x | E [ z := Q ] : S ) R = P = Q * ( x | R : E [ z := P ] ) = * ( x | R : E [ z := Q ] ) Dr. R. Khedri COM SFWR 707 Formal Specification Techniques
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
COM SFWR 707 Formal Specification Techniques Dr. R. Khedri Introduction Universal quantification Existential quantification Program Verification Introduction In the pure predicate calculus, the function symbols ( <, >, + , · , etc.) are uninterpreted except for equality = the logic provides no specific rules for manipulating function symbols general rules for manipulation that are sound independently of the meanings of the function symbols so, the pure predicate calculus is sound in all domains that may be of interest Dr. R. Khedri COM SFWR 707 Formal Specification Techniques
Image of page 6
COM SFWR 707 Formal Specification Techniques Dr. R. Khedri Introduction Universal quantification Existential quantification Program Verification Introduction We get a theory by adding axioms that give meanings to some of the (uninterpreted) function symbols The
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '10
  • RidhaKhedri
  • Natural number, Imperative programming, Dr. R. Khedri, Dr. Ridha Khedri, Formal specification techniques, COM SFWR

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern