PredicatesAndProgramming

# PredicatesAndProgramming - COM SFWR 707 Formal Specication...

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

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

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

View Full Document
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
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

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

View Full Document
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
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

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

View Full Document
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
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

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

View Full Document
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

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern