Mathematics throughout the CS Curriculum Support by NSF #

Slides:



Advertisements
Similar presentations
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Advertisements

Writing specifications for object-oriented programs K. Rustan M. Leino Microsoft Research, Redmond, WA, USA 21 Jan 2005 Invited talk, AIOOL 2005 Paris,
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Challenges in increasing tool support for programming K. Rustan M. Leino Microsoft Research, Redmond, WA, USA 23 Sep 2004 ICTAC Guiyang, Guizhou, PRC joint.
Semantics Static semantics Dynamic semantics attribute grammars
Computer Science School of Computing Clemson University Introduction to Mathematical Reasoning Jason Hallstrom and Murali Sitaraman Clemson University.
School of Computing Clemson University Mathematical Reasoning  Goal: To prove correctness  Method: Use a reasoning table  Prove correctness on all valid.
Addressing the Challenges of Current Software. Questions to Address Why? What? Where? How?
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Annoucements  Next labs 9 and 10 are paired for everyone. So don’t miss the lab.  There is a review session for the quiz on Monday, November 4, at 8:00.
David Evans CS655: Programming Languages University of Virginia Computer Science Lecture 19: Minding Ps & Qs: Axiomatic.
(c) 2007 Mauro Pezzè & Michal Young Ch 7, slide 1 Symbolic Execution and Proof of Properties.
ISBN Chapter 3 Describing Syntax and Semantics.
Formal Specification and Verification. Specifications Imprecise specifications can cause serious problems downstream Lots of interpretations even with.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
CS 355 – Programming Languages
Software Engineering and Design Principles Chapter 1.
Katz Formal Specifications Larch 1 Algebraic Specification and Larch Formal Specifications of Complex Systems Shmuel Katz The Technion.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 18 Program Correctness To treat programming.
Describing Syntax and Semantics
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
MCA –Software Engineering Kantipur City College. Topics include  Formal Methods Concept  Formal Specification Language Test plan creation Test-case.
Jason Hallstrom (Clemson), Joan Krone (Denison), Joseph E. Hollingsworth (IU Southeast), and Murali Sitaraman(Clemson) This workshop is funded in part.
Do we need theoretical computer science in software engineering curriculum: an experience from Uni Novi Sad Bansko, August 28, 2013.
Computer Science School of Computing Clemson University Discrete Math and Reasoning about Software Correctness Murali Sitaraman
Pre/Post Condition Logic 03/06/2013. Agenda Hoare’s Logic Overview Application to Pre/Post Conditions.
Computer Science School of Computing Clemson University Specification and Reasoning in SE Projects Using a Web IDE Charles T. Cook (Clemson) Svetlana V.
Computer Science School of Computing Clemson University Mathematical Reasoning across the Curriculum Software Development Foundations and Software Engineering.
Lecture 16 March 22, 2011 Formal Methods CS 315 Spring Adapted from slides provided by Jason Hallstrom and Murali Sitaraman (Clemson)
Introduction Ellen Walker CPSC 201 Data Structures Hiram College.
COSO 1030 Section 2 Software Engineering Concepts and Computation Complexity.
CompSci 105 SS 2005 Principles of Computer Science Lecture 4 Lecturer: Santokh Singh.
1 Program Correctness CIS 375 Bruce R. Maxim UM-Dearborn.
Lecture 17 March 24, 2011 Formal Methods 2 CS 315 Spring Adapted from slides provided by Jason Hallstrom and Murali Sitaraman (Clemson)
Chapter 25 Formal Methods Formal methods Specify program using math Develop program using math Prove program matches specification using.
CS 363 Comparative Programming Languages Semantics.
Computer Science School of Computing Clemson University Discrete Math and Reasoning about Software Correctness Joseph E. Hollingsworth
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
Introduction to Data Structures and Algorithms CS 110: Data Structures and Algorithms First Semester,
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
What is Testing? Testing is the process of finding errors in the system implementation. –The intent of testing is to find problems with the system.
Chapter 3 Part II Describing Syntax and Semantics.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
COP4020 Programming Languages Introduction to Axiomatic Semantics Prof. Robert van Engelen.
Software Development Problem Analysis and Specification Design Implementation (Coding) Testing, Execution and Debugging Maintenance.
Iconic Programmer A Visualization Tool for Teaching Concepts without Context.
CSCI1600: Embedded and Real Time Software Lecture 28: Verification I Steven Reiss, Fall 2015.
PROGRAMMING PRE- AND POSTCONDITIONS, INVARIANTS AND METHOD CONTRACTS B MODULE 2: SOFTWARE SYSTEMS 13 NOVEMBER 2013.
Computer Science School of Computing Clemson University Mathematical Reasoning with Objects.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
C HAPTER 3 Describing Syntax and Semantics. D YNAMIC S EMANTICS Describing syntax is relatively simple There is no single widely acceptable notation or.
Course: Software Engineering – Design I IntroductionSlide Number 1 What is a specification Description of a (computer) system, which:  is precise;  defines.
Integrating Math Units and Proof Checking for Specification and Verification SAVCBS Workshop 2008 SIGSOFT 2008 / FSE 16 November 9th, 2008 Hampton Smith.
Lecture 18 March 29, 2011 Formal Methods 3 CS 315 Spring Adapted from slides provided by Jason Hallstrom and Murali Sitaraman (Clemson)
Introductory Lecture. What is Discrete Mathematics? Discrete mathematics is the part of mathematics devoted to the study of discrete (as opposed to continuous)
서울대한양대 ( 안 산 ) 충남대 1년1년 컴퓨터기초 (C) 컴퓨터프로그래밍 (C, Java) 컴퓨터프로그래밍 (C) 2. 봄 프로그래밍 원리 (Scheme, ML) Structure & Interpretation of Computer Programs 프로그래밍 방법론.
© Bertrand Meyer and Yishai Feldman Notice Some of the material is taken from Object-Oriented Software Construction, 2nd edition, by Bertrand Meyer (Prentice.
Formal Methods in Software Engineering 1
Introduction to Components and Specifications Using RESOLVE
Programming Languages 2nd edition Tucker and Noonan
Semantics In Text: Chapter 3.
Mathematical Reasoning
Logic: tool-based modeling and reasoning
More Mathematical Reasoning (Conditional Statements)
Mathematical Reasoning with Data Abstractions
Programming Languages and Compilers (CS 421)
Programming Languages 2nd edition Tucker and Noonan
COP4020 Programming Languages
Formal Methods Lecture 16 March 22, 2011 CS 315 Spring 2011
Presentation transcript:

Mathematics throughout the CS Curriculum Support by NSF #

General Consensus Most CS faculty agree that math is important. Discrete Math is usually required.

The Problem Students study math, but don’t see the connection to their CS courses. Content Reasoning skills Why Reasoning Skills? What Reasoning Skills??

Beyond the Classroom Current Software is too large for one person to understand at the code level. Software engineers must work at the modular level. How do we prepare future programmers? What do they need to know? How can they reason about large programs composed of many parts?

What reasoning skills are necessary? Concept Inventory Boolean LogicStandard Logic Symbols, Standard Proof Techniques Discrete Math StructuresSets, Strings, Numbers, Relations, and other mathematical theories as needed Precise SpecificationsMathematical Descriptions of Software interfaces for clients and implementers. Math models for structures Pre and Post conditions for operations. Modular ReasoningEach Module needs to be proven correct only once. Verification ConditionsMathematical Assertions equivalent to the correctness of the program. Correctness ProofsApplication of Proof Techniques to the program

Apply in All Courses Introductory Level Programming Data Structures and Algorithms Software Engineering Theory of Programming Languages Electives

Motivation for Reasoning Binary search in C++ library Proven correct? Failed!

Need Precise Specs Need to distinguish between mathematical integers and computer integers Specs take this distinction into account.

Introductory Programming Informal and Formal Reasoning Reasoning Tables Reasoning based on specification without needing to see code.

Example Operation PlusTwo(updates i: int) requires ?? ensures i = #i + 2; Code Increment(i);

Increment Operation Increment (updates i: int) requires i < max_int; ensures i = #i + 1; No need to see Code i := i + 1;

Example Operation PlusTwo(updates i: int) requires i < max_int - 1; ensures i = #i + 2; Code Increment(i);

Reasoning Table Operation PlusTwo State NumberAssumeConfirm 0I0 < max_int - 1 Increment(i) 1i1 = i0 + 1i1 < max_int Increment(i) 2i2 = i1 + 1i2 = i0 + 2

Upper Level Formal Methods in Software Engineering Algorithms (Distinction between proving an algorithm and that an implementation meets the specification of the algorithm) Theory of Programming Languages – (Verifying Compiler Challenge)

Formal Methods Unit Often at end of text Missing altogether

Precise Specifications requires clause (pre-condition) ensures clause (post-condition) loop invariants Math modeling

Stack Model Stack_Family is_modeled_by Str(Entry) exemplar S; Initialization ensures S = Λ; Note: Entry is a generic type.

Example Operation Push(alters E: Entry; updates S: Stack); requires |S| < Max_Depth; ensures S = o #S; Operation Pop(replaces R: Entry; updates S: Stack); requires |S| > 0; ensures #S = o S;

Proof Rules for Verification code: Assume B; code1; Confirm Q; code; Assume B; code2; Confirm Q; code; If B then code1 else code2; endif; Confirm Q;

Verification Conditions Automated generation of VC’s

Summary To meet the challenges of current software, students need – To reason about large programs modularly – To read and write mathematical specs – To distinguish between spec and implementation