Invariant Based Programming in Education Tutorial, FM’08 Linda Mannila 26.5.2008.

Slides:



Advertisements
Similar presentations
Automated Theorem Proving Lecture 1. Program verification is undecidable! Given program P and specification S, does P satisfy S?
Advertisements

25 February 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department.
Simplified Gated Assignment Surinder Jain Supervisor : Bernhard Scholz Assignment 3 – INFO5993.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
Randomized Algorithms Randomized Algorithms CS648 Lecture 8 Tools for bounding deviation of a random variable Markov’s Inequality Chernoff Bound Lecture.
1 Discrete Structures CS Johnnie Baker Comments on Early Term Test.
Chapter 2: Algorithm Discovery and Design
Invariant Based Programming, March 20101/ Teaching the construction of correct programs using invariant based programming Ralph-Johan Back Johannes Eriksson.
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
From Discrete Mathematics to AI applications: A progression path for an undergraduate program in math Abdul Huq Middle East College of Information Technology,
The C++ Tracing Tutor: Visualizing Computer Program Behavior for Beginning Programming Courses Rika Yoshii Alastair Milne Computer Science Department California.
C SC 520 Principles of Programming Languages 1 C SC 520: Principles of Programming Languages Peter J. Downey Department of Computer Science Spring 2006.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Data Structures, Spring 2004 © L. Joskowicz 1 DAST – Final Lecture Summary and overview What we have learned. Why it is important. What next.
Describing Syntax and Semantics
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
Program Analysis Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Chapter 2: Algorithm Discovery and Design
SEEFM 07, Thessaloniki, Nov 20071/ Teaching the construction of correct programs using invariant based programming Ralph-Johan Back Johannes Eriksson Linda.
Mathematics throughout the CS Curriculum Support by NSF #
Advanced Research Methodology
Do we need theoretical computer science in software engineering curriculum: an experience from Uni Novi Sad Bansko, August 28, 2013.
 A set of objectives or student learning outcomes for a course or a set of courses.  Specifies the set of concepts and skills that the student must.
A Visual Interactive Tool For the Course “Automata and Formal Languages” Holon Institute of Technology Mark Trakhtenbrot, Vladimir Nodelman, Avi Lamai.
1 UTeach Professional Development Courses. 2 UTS Step 1 Early exposure to classroom environment (can be as early as a student’s first semester)
Intro to Discrete Structures
Algorithms Describing what you know. Contents What are they and were do we find them? Why show the algorithm? What formalisms are used for presenting.
Rika Yoshii, Ph.D. and Jacquelyn Hernandez CSIS Department California State University, San Marcos Send us suggestions and requests to.
A Z Approach in Validating ORA-SS Data Models Scott Uk-Jin Lee Jing Sun Gillian Dobbie Yuan Fang Li.
MATH 224 – Discrete Mathematics
Chapter 3 (Part 3): Mathematical Reasoning, Induction & Recursion  Recursive Algorithms (3.5)  Program Correctness (3.6)
1 Inference Rules and Proofs (Z); Program Specification and Verification Inference Rules and Proofs (Z); Program Specification and Verification.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CS 363 Comparative Programming Languages Semantics.
Analysis of Algorithms CSCI Previous Evaluations of Programs Correctness – does the algorithm do what it is supposed to do? Generality – does it.
UNIVERSITY OF LOUISVILLE Assessing the Mathematics Knowledge of Teachers William S. Bush University of Louisville North Carolina Association of Mathematics.
An Interactive Tutorial for NP-Completeness. Outline  Background and Motivation  Visualizations  The NP-Complete Problems  Practice Exercises on NP-Complete.
Introduction to Problem Solving. Steps in Programming A Very Simplified Picture –Problem Definition & Analysis – High Level Strategy for a solution –Arriving.
A Manual for Dissertation Yong Zheng DePaul University May 17,
CS Data Structures I Chapter 2 Principles of Programming & Software Engineering.
Fault-Tolerant Parallel and Distributed Computing for Software Engineering Undergraduates Ali Ebnenasir and Jean Mayo {aebnenas, Department.
Lecture Comp 25 Math & Logic Discussion. What is logic? Logic is the study of reason Focus is the method or process by which an argument unfolds Aristotle.
Chapter 5: Sequences, Mathematical Induction, and Recursion 5.5 Application: Correctness of Algorithms 1 [P]rogramming reliability – must be an activity.
Deriving Operational Software Specification from System Goals Xin Bai EEL 5881 Course Fall, 2003.
9 th International Workshop on Intuitionistic Fuzzy Sets and Generalized Nets, 8 October 2010, Warsaw, Poland Utilizing the Model Graphic Structures when.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Syntax and Semantics CIS 331 Syntax: the form or structure of the expressions, statements, and program units. Semantics: the meaning of the expressions,
1.  Interpretation refers to the task of drawing inferences from the collected facts after an analytical and/or experimental study.  The task of interpretation.
Seven Myths of Formal Methods - by Anthony Hall, Praxis Systems Presented by Shanmughapriya Senthil.
1 CSC 221: Computer Programming I Spring 2008 course overview  What did we set out to learn?  What did you actually learn?  Where do you go from here?
Compiler Construction (CS-636)
Formal Methods in SE Software Verification Using Formal Methods By: Qaisar Javaid, Assistant Professor Formal Methods1.
John Wilkins CSU Dominguez Hills March 14, CSUDH Mathematics Department Aligned with California Teaching Commission Previous alignment process with.
CS 162 Introduction to Computer Science II Winter, 2014: 60 Spring, 2014: 60 Summer, 2014: 71.
Yr 7.  Pupils use mathematics as an integral part of classroom activities. They represent their work with objects or pictures and discuss it. They recognise.
Concepts and Realization of a Diagram Editor Generator Based on Hypergraph Transformation Author: Mark Minas Presenter: Song Gu.
CES 592 Theory of Software Systems B. Ravikumar (Ravi) Office: 124 Darwin Hall.
 Introduction  Methodology  Case Study 1 : Event-B and RODN  Case Study 2 : B-Method and Atelier B  Observations and Analysis  Conclusion.
September 1999Compaq Computer CorporationSlide 1 of 16 Verification of cache-coherence protocols with TLA+ Homayoon Akhiani, Damien Doligez, Paul Harter,
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.
1 Sobah Abbas Petersen Adjunct Associate Professor, NTNU Researcher, Sintef TDT4252 Modelling of Information Systems Advanced Course TDT4252,
Formal Methods. What Are Formal Methods Formal methods refers to a variety of mathematical modeling techniques that are applicable to computer system.
Assistant Instructor Nian K. Ghafoor Feb Definition of Proposal Proposal is a plan for master’s thesis or doctoral dissertation which provides the.
Overview of Types of Measures Margaret Kasimatis, PhD VP for Academic Planning & Effectiveness.
서울대한양대 ( 안 산 ) 충남대 1년1년 컴퓨터기초 (C) 컴퓨터프로그래밍 (C, Java) 컴퓨터프로그래밍 (C) 2. 봄 프로그래밍 원리 (Scheme, ML) Structure & Interpretation of Computer Programs 프로그래밍 방법론.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
Matching Logic An Alternative to Hoare/Floyd Logic
Tutorial, FM’08 Linda Mannila
Presentation transcript:

Invariant Based Programming in Education Tutorial, FM’08 Linda Mannila

Background Challenges at CS departments ◦ First year students have weak skills in logic, formal reasoning, writing proofs etc. ◦ Students do not see a connection between theoretical and practical courses Goal ◦ Giving students hands-on skills in constructing proofs and reasoning about correctness early on ◦ Linking theory with practice

IBP in Education Course for PhD students in case study sessions with faculty, students, researchers Undergraduate course, given twice, starting in spring 2007

Undergraduate Course Elective (~15 students/course) Prerequisities: ◦ Introductory programming ◦ Logic 17 interactive, example-driven sessions ◦ 4 (7) sessions with SOCOS Addition,..., linear search,..., sorting Evaluation ◦ questionnaires, interviews, observations, assignments, exam

Experienced benefits (+) Introduction to program correctness and formal verification Good introduction to formal verification and how tools can be used in that context Helps remove errors in the algorithm that could lead to bugs A practical method for introducing program correctness IBP summarizes the proof conditions in a good way IBP is intuitive Introduction to a more abstract view of programming Learning to think about how a program works in general, without a given programming language Learned to think about a program as states and transitions instead of merely as transitions as is usually the case More tangible overview of the program structure Learning to draw a program makes it easier to see its structure Makes it easy to keep the track of the various parts of a program New and useful contents

Experienced difficulties (-) Syntax and notation ◦ It’s difficult to formulate one’s programs according to the standard ◦ Since I have programmed previously e.g. the Java way of expressing things is quite ingrained Proofs ◦ Proving programs by hand is very work intense ◦ Proving complex programs is difficult Finding the correct invariant and postcondition Using SOCOS

Preliminary error analysis Only minor problems related to the ◦ Method (e.g. the syntax) ◦ Algorithm Main problem ◦ Weak logical background ◦ Interpreting and constructing quantified expressions ◦ Understanding when to use quantifiers ◦ Understanding which one to use Problems with logic affect other aspects ◦ Unclear invariants (not necessarily weak) ◦ Unclear proofs

Conclusions Learning IBP is not difficult ◦ Students get the big picture rather quickly ◦ Appreciate the diagrammatic notation Main difficulties related to predicate logic ◦ More focus on using logic in practice ◦ Students need more practice in reading and constructing quantified expressions Remedy? ◦ Split the course into two parts: 1) manual and 2) with tool support  More time for practice

Assignment Results (2007) Scores ◦ Average 25.5 (max 40) ◦ Seven students > 30 points Most common errors ◦ Syntax related (e.g. using Java like syntax or not following the given proof format) Other errors ◦ Incomplete invariants ◦ Problems with the algorithm ◦ Using undeclared variables ◦ One “off by one” error

Error analysis (2008) Jonas Erikson, Master’s Thesis Analyzed student solutions to four assignments (all in all ~50 solutions) Three main error categories: ◦ Syntax (related to the diagram representation) ◦ Reasoning (related to misconceptions and weak understanding) ◦ Logical background (related to having a weak background in expressing logical statements)

Total number of errors Nested loops

Related to syntax

Related to reasoning Nested loops

Related to logical background Define own predicates, use quantifiers to a larger extent

Discussion Could IBP be introduced at high school level? ◦ As a course in mathematics? ◦ Would the method need to be simplified? How?