School of Computing and Mathematics, University of Huddersfield CIA2326: Week 11 LECTURE: Formal Specification TUTORIAL/PRACTICAL: Finish off last weeks.

Slides:



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

Copyright W. Howden1 Programming by Contract CSE 111 6/4/2014.
Carlos D. Rivera February 28, 2007 Design-by-Contract.
PZ03D Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ03D - Program verification Programming Language Design.
School of Computing Clemson University Mathematical Reasoning  Goal: To prove correctness  Method: Use a reasoning table  Prove correctness on all valid.
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
© Colin Potts C6-1 Some future trends in requirements engineering Colin Potts Georgia Tech.
LIFE CYCLE MODELS FORMAL TRANSFORMATION
Software system modeling
Partial correctness © Marcelo d’Amorim 2010.
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
Shaoying Liu Department of Computer Science
AI - Week 13 Knowledge Representation, Logic, Semantic Web Lee McCluskey, room 2/07
School of Computing and Engineering, University of Huddersfield CHA2545: WEEK 14 LECTURE: ABSTRACT SYNTAX SIMPLE EXAMPLE OF SEMANTICS DEFINITION TUTORIAL/PRACTICAL:
Formal Methods of Systems Specification Logical Specification of Hard- and Software Prof. Dr. Holger Schlingloff Institut für Informatik der.
School of Computing and Mathematics, University of Huddersfield CAS2545: WEEK 11 LECTURE: n The meaning of Algebraic Specifications TUTORIAL/PRACTICAL:
Language Specfication and Implementation - PART II: Semantics of Procedural Programming Languages Lee McCluskey Department of Computing and Mathematical.
Knowledge and Systems Research Group, University of Huddersfield B vs OCL: Comparing Specification Languages for Planning Domains Diane Kitchin, Lee McCluskey,
Formal Methods. Importance of high quality software ● Software has increasingly significant in our everyday activities - manages our bank accounts - pays.
PDDL: A Language with a Purpose? Lee McCluskey Department of Computing and Mathematical Sciences, The University of Huddersfield.
Modelling Conceptual Knowledge using Logic - Week 6 Lee McCluskey Department of Computing and Mathematical Sciences University of Huddersfield.
School of Computing and Mathematics, University of Huddersfield CIA2326 Week 14 LECTURE: How to reason with Algebraic Specifications TUTORIAL/PRACTICAL:
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
Formal Aspects of Computer Science - Week11 Real Application of Logic Lee McCluskey, room 2/07
©Ian Sommerville 2006Software Engineering, 8th edition. Chapter 10 Slide 1 Formal Specification.
Formal Specification Thomas Alspaugh ICS Nov 7.
MCA –Software Engineering Kantipur City College. Topics include  Formal Methods Concept  Formal Specification Language Test plan creation Test-case.
1 Topic Mathematical Proofs. 2 Topic Mathematical Proofs California Standards: 24.2 Students identify the hypothesis and conclusion in logical.
By D. Beyer et. al. Simon Fraser University (Spring 09) Presentation By: Pashootan Vaezipoor.
University of Toronto Department of Computer Science © 2001, Steve Easterbrook CSC444 Lec17 1 Lecture 17: Formal Modeling Methods Formal Modeling Techniques.
Formal Methods 1. Software Engineering and Formal Methods  Every software engineering methodology is based on a recommended development process  proceeding.
Software Engineering Prof. Dr. Bertrand Meyer March 2007 – June 2007 Chair of Software Engineering Static program checking and verification Slides: Based.
Course: Software Engineering © Alessandra RussoUnit 1 - Introduction, slide Number 1 Unit 1: Introduction Course: C525 Software Engineering Lecturer: Alessandra.
©Ian Sommerville 2000Software Engineering, Chapter 10 Slide 1 Chapter 10 Formal Specification.
Mathematical Modeling and Formal Specification Languages CIS 376 Bruce R. Maxim UM-Dearborn.
MATH 224 – Discrete Mathematics
Introduction to Formal Methods Based on Jeannette M. Wing. A Specifier's Introduction to Formal Methods. IEEE Computer, 23(9):8-24, September,
Overview of Formal Methods. Topics Introduction and terminology FM and Software Engineering Applications of FM Propositional and Predicate Logic Program.
Chapter 25 Formal Methods Formal methods Specify program using math Develop program using math Prove program matches specification using.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
School of Computing and Engineering, University of Huddersfield CIA2326 Week 14 LECTURE: Formal Specifications. How to reason with Algebraic Specifications.
Honors Geometry Intro. to Deductive Reasoning. Reasoning based on observing patterns, as we did in the first section of Unit I, is called inductive reasoning.
Math 021.  An equation is defined as two algebraic expressions separated by an = sign.  The solution to an equation is a number that when substituted.
 Solve and algebraic equation and provide a justification for each step.  Identify which property of equality or congruence is being used.
Formal Methods.
Formal Methods in SE Software Verification Using Formal Methods By: Qaisar Javaid, Assistant Professor Formal Methods1.
Algebraic Proof Addition:If a = b, then a + c = b + c. Subtraction:If a = b, then a - c = b - c. Multiplication: If a = b, then ca = cb. Division: If a.
School of Computing and Engineering, University of Huddersfield CHA2545: WEEK 14 – SEMANTICS EXAMPLE LECTURE: SIMPLE EXAMPLE OF SEMANTICS DEFINITION TUTORIAL/PRACTICAL:
Logic and Proof Day 5. Day 5 Math Review Goals/Objectives Review properties of equality and use them to write algebraic proofs. Identify properties of.
©Ian Sommerville 2000Software Engineering, Chapter 10 Slide 1 Chapter 10 Formal Specification.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Course: Software Engineering – Design I IntroductionSlide Number 1 What is a specification Description of a (computer) system, which:  is precise;  defines.
Formal Methods: for All or for Chosen? Victor Kuliamin 1 Vitaliy Omelchenko 1 Olga Petrenko 2 1 Institute for System Programming 2 Institute of Open Education.
Mathematical Induction Thinking Skill: Develop Confidence in Reason Warm Up: Find the k+1 term (P k+1 ) 1) 2)
IS 2620: Developing Secure Systems Formal Verification/Methods Lecture 9 March 15, 2012.
Formal Specification.
Formal Techniques (CS340 © John C. Knight 2004)
CSE 311 Foundations of Computing I
Programming Languages 2nd edition Tucker and Noonan
Semantics In Text: Chapter 3.
Chapter 2: Geometric Reasoning
Department of Computer Science Abdul Wali Khan University Mardan
Software system modeling
Linear Algebra Lecture 6.
Programming Languages 2nd edition Tucker and Noonan
Proving Statements about Segments
Presentation transcript:

School of Computing and Mathematics, University of Huddersfield CIA2326: Week 11 LECTURE: Formal Specification TUTORIAL/PRACTICAL: Finish off last weeks exercises NEXT Week LECTURE: Revision TUTORIAL/PRACTICAL: c/w solutions

School of Computing and Engineering, University of Huddersfield Last Week: Formal Specifications FOR: good for capturing requirements in safety related/critical applications because - can eliminate bugs EARLY in SD process - can be used as a precise contract - can be reasoned with using logic - can be manipulated using computer tools - can be used as a basis to “prove” code correct

School of Computing and Engineering, University of Huddersfield Last Week: Formal Specifications AGAINST - not very understandable if they are in Maths -are only part of the story – they do not guarantee quality -themselves need validating – they may have bugs e.g. be incomplete, inconsistent

School of Computing and Mathematics, University of Huddersfield Formal Specification : Logic -Can write parts of requirements specifications as logic statements For all Segment1, Segment2 in Segments segments_are_in_oceanic_conflict(Segment1,Segment2)  are_in_vertical_oceanic_conflict(Segment1,Segment2) AND are_in_lateral_and_longitudinal_oceanic_conflict(Segment1,Segment2) (the_Profile_containing(Segment) is_wholly_or_partly_in_shanwick_oca) => [(Segment starts_at_or_after_first_recognised_pt_for_oceanic_cpr) (the_entry_Time_of(Segment) is_at_or_later_than the_Time_of( the_first_recognised_4D_pt_for_oceanic_cpr_of( the_Profile_containing(Segment))))

School of Computing and Mathematics, University of Huddersfield Formal Specification : Logic This has the advantages MODULARITY – statements can be added/removed in relative isolation. Definitions can be built up hierarchically Individuals (eg Segment1) can be regarded as “objects” with structure Logic statements tend to be are more readable than maths Logic statements tend to be are more abstract than other approaches – see below There are well developed proof tools for logic

Formal Specification : Algebra Sortname: Segments Function names: the_Segment(Profile,4D_pt1,4D_pt2,Val) ;; primitive the_Profile_containing(Segment) ;; Ax.2 the_entry_4D_pt_of(Segment) ;; Ax.3 the_exit_4D_pt_of(Segment) ;; Ax.4 the_machno_Val_on(Segment) ;; Ax.5 the_cruise_climb_status_Val_of(Segment) ;; Ax Predicate names: Segment1 = Segment2 ;; constrained equality (Ax.1) Segment1 \= Segment2 ;; constrained inequality (Ax.1) (Int_gte_0 is_a_min_long_sep_value_for Segment1 and Segment2 entered_via_the_mst_command) ;; primitive (time_periods_of Segment1 and Segment2 overlap) ;; Ax.7 (flight_level_ranges_of Segment1 and Segment2 overlap) ;; Ax.8 (Flight_level lies_in_flight_level_range_of Segment).... Axioms: Segment1 = Segment2 [the_entry_4D_pt_of(Segment1) = the_entry_4D_pt_of(Segment2) & the_exit_4D_pt_of(Segment1) = the_exit_4D_pt_of(Segment2) & the_machno_Val_on(Segment1) = the_machno_Val_on(Segment2) & the_Profile_containing(Segment1) = the_Profile_containing(Segment2) ]....

School of Computing and Mathematics, University of Huddersfield “State – Based” Formal Specs Lang(FSL) The most commonly used type of FSL using a combination of Logic, Abstract Data Types and Maths Examples: Z, VDM, B They also incorporate “methods” for refining a specification into a program. They are all supplied with “tools environments” which include syntax checkers, proof tools and animators..

School of Computing and Mathematics, University of Huddersfield “State – Based” Formal Specs Lang(FSL) Basics: Define the “state” of the system in terms of mathematical data structures such as SETS, MAPS and basic types. Define the “operations” on the system via PRE and POST conditions. The conditions are composed of logical combinations of the mathematical data structures. Define “invariants” – those properties of the system that should always be true.

School of Computing and Mathematics, University of Huddersfield Conclusions Formal Specifications are important for certain types of software project They are meant to precisely and objectively capture what is required There are many FSL types – logic based, algebra based, state based.