1 / 14

COSC 4P42 Formal Methods in Software Engineering

COSC 4P42 Formal Methods in Software Engineering. Course: Mon, 3:30pm - 5:00pm, Winter 2013, Room: WH327 Fri, 3:30pm - 5:00pm, Winter 2013, Room: MCD205 Instructor: Michael Winter Office J323 Office Hours: Mon & Fri 1:00pm – 3:00pm email: mwinter@brocku.ca

jovita
Download Presentation

COSC 4P42 Formal Methods in Software Engineering

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. COSC 4P42Formal Methods in Software Engineering • Course: • Mon, 3:30pm - 5:00pm, Winter 2013, Room: WH327 • Fri, 3:30pm - 5:00pm, Winter 2013, Room: MCD205 • Instructor: Michael Winter • Office J323 • Office Hours: Mon & Fri 1:00pm – 3:00pm • email: mwinter@brocku.ca • Webpage: www.cosc.brocku.ca/~mwinter/Courses/4P42/

  2. Course Description (Brock Calendar): Specification and correctness of software. Topics include algebraic specifications, semantics of programming languages, Hoare/dynamic logic, specification languages, program transformation. • Prerequisites: 3.5 COSC credits and MATH 1P67 or permission of the instructor • course procedures • plagiarism

  3. Textbooks • Main Text • None (course material is on the web page). • Supplemental Texts • The Formal Semantics of Programming Languages: An Introduction, G. Winskel, The MIT Press (1993), ISBN 0-262-23169-7 (hc), 0-262-73103-7 (pb) • The Design of Well-Structured and Correct Programs, S. Alagic & M.A. Arbib, Springer-Verlag (1978), ISBN 0-387-90299-6 • Fundamentals of Algebraic Specifications 1: Equations and Initial Semantics, H. Ehrig & B. Mahr, Springer-Verlag (1985), ISBN 0-387-13718-1

  4. Course Work • Marking Scheme • Lab Tests (3x20%) 60% • Final Exam (Lab D205) 40% • Important Dates Test Length Date (D205)/Time 1 45 mins Feb 01 (3:30pm-4:15pm) 2 45 mins Mar 01 (3:30pm-4:15pm) 3 45 mins Mar 22 (3:30pm-4:15pm) Exam 90 mins Apr 10 (10am-11:30am)

  5. Course Outline * February 18-22 is Reading Week, no classes. March 29 is Good Friday, no classes. Make up on April 08.

  6. A mark of at least 40% on the final exam is required to achieve a passing grade in this course. No electronic devices and especially no calculators will be allowed in the examination room. • Consideration regarding illness for test or exam dates will only be considered if accompanied with the completed Departmental Medical Excuse form.

  7. Motivation Assume you are a project coordinator in a software company. The latest project your team is working on has the following constraints: • avoid integer multiplication (there are issues with the hardware); • the operation square(n)=n2 will frequently be used in the program. You present this problem to a member of your team. He comes up with the following piece of code:

  8. A program r := 0; s := 1; i := 0; while i < n do r := r+s; s := s+2; i := i+1; od The program above computes n2 in the variable r.

  9. Testing

  10. Problems with Testing Testing may unveil errors in the code, but • You may only test finitely many examples. • Testing cannot verify that the code is bug-free. “Correctness cannot be established through testing. Testing can only delete errors, but never exclude errors.” Are you satisfied with the testing procedure? Yes?!?, but what if this program • controls a machine producing toys worth $10,000 an hour? • controls a rocket sending a new television satellite into orbit? An error in the code might cause a big financial loss for our company!!!

  11. n-1  2i+1. i=0 A proof The programmer says: “My program obviously computes Here is the proof that this is equal to n2.” (Compare this approach to Math 1P66/67.)

  12. n-1  2i+1. i=0 Further Problems? Are you satisfied with this proof? Yes?!?, but what if this program • controls the reentry of a space shuttle? • controls the rollercoaster you are sitting in? • controls the cooling system of the nuclear plant next door? The previous argument still contains the informal step: “My program obviously computes “ This could be wrong!!!!!

  13. Hoare logic Hoare logic is a calculus that can be used to prove partial correctness assertion of the form: {} c {} where ,  are formulas and c is a command (or program). The intended meaning of such a statement is as follows: If the precondition  is satisfied and the program c terminates, then the postcondition  will be satisfied (after the execution of c). Example: {n≥0} p {r=n2} where p is our program.

  14. Hoare logic – proof rules (Skip): {} skip {} (Assignment): {[a/x]} x:=a {} (Sequencing): {} c0 {} {} c1 {} {} c0;c1 {} (Conditional): {b} c0 {} {b} c1 {} {} if b then c0else c1fi {} (Loop): {b} c{} {} while b do c od {b} (Consequence): ’ {’} c {’} ’   {} c {}

More Related