Mathematical Modeling and Formal Specification Languages CIS 376 Bruce R. Maxim UM-Dearborn.

Slides:



Advertisements
Similar presentations
© Fachgebiet Softwaretechnik, Heinz Nixdorf Institut, Universität Paderborn 2.4 The Z Notation [Reference: M. Spivey: The Z Notation, Prentice Hall]
Advertisements

Semantics Static semantics Dynamic semantics attribute grammars
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
25 February 2009Instructor: Tasneem Darwish1 University of Palestine Faculty of Applied Engineering and Urban Planning Software Engineering Department.
Software system modeling
ISBN Chapter 3 Describing Syntax and Semantics.
CS 355 – Programming Languages
Chapter 9 Describing Process Specifications and Structured Decisions
©Ian Sommerville 2000Software Engineering, 6/e, Chapter 91 Formal Specification l Techniques for the unambiguous specification of software.
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
Chapter 1 Principles of Programming and Software Engineering.
© Copyright 2011 John Wiley & Sons, Inc.
Describing Syntax and Semantics
School of Computer ScienceG53FSP Formal Specification1 Dr. Rong Qu Introduction to Formal Specification
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
MCA –Software Engineering Kantipur City College. Topics include  Formal Methods Concept  Formal Specification Language Test plan creation Test-case.
1 Software Testing Techniques CIS 375 Bruce R. Maxim UM-Dearborn.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 10 Slide 1 Formal Specification.
Formal Methods 1. Software Engineering and Formal Methods  Every software engineering methodology is based on a recommended development process  proceeding.
Verification and Validation Yonsei University 2 nd Semester, 2014 Sanghyun Park.
Formal Methods CIS 376 Bruce R. Maxim UM-Dearborn.
© Bertrand Meyer and Yishai Feldman Notice Some of the material is taken from Object-Oriented Software Construction, 2nd edition, by Bertrand Meyer (Prentice.
Software Models (Cont.) 9/22/2015ICS 413 – Software Engineering1 -Component-based software engineering -Formal Development Model.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
1 Program Correctness CIS 375 Bruce R. Maxim UM-Dearborn.
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.
WXGE6103 Software Engineering Process and Practice Formal Specification.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
1 Introduction to Software Engineering Lecture 1.
Formal Verification Lecture 9. Formal Verification Formal verification relies on Descriptions of the properties or requirements Descriptions of systems.
Requirements Specification. Welcome to Software Engineering: “Requirements Specification” “Requirements Specification”  Verb?  Noun?  “Specification”
Formal Semantics of Programming Languages 虞慧群 Topic 1: Introduction.
Object-Oriented Modeling: Static Models. Object-Oriented Modeling Model the system as interacting objects Model the system as interacting objects Match.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
ISBN Chapter 3 Describing Semantics.
Chapter 3 Part II Describing Syntax and Semantics.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
Semantics In Text: 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 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.
Formal Methods.
An Axiomatic Basis for Computer Programming Robert Stewart.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
2004 Hawaii Inter Conf Comp Sci1 Specifying and Proving Object- Oriented Programs Arthur C. Fleck Computer Science Department University of Iowa.
Formal Specification: a Roadmap Axel van Lamsweerde published on ICSE (International Conference on Software Engineering) Jing Ai 10/28/2003.
Static Techniques for V&V. Hierarchy of V&V techniques Static Analysis V&V Dynamic Techniques Model Checking Simulation Symbolic Execution Testing Informal.
Quality Assurance in the Presence of Variability Kim Lauenroth, Andreas Metzger, Klaus Pohl Institute for Computer Science and Business Information Systems.
Duminda WijesekeraSWSE 623: Introduction1 Introduction to Formal and Semi- formal Methods Based on A Specifier's Introduction to Formal Methods (J. Wing)
Capturing Requirements. Questions to Ask about Requirements 1)Are the requirements correct? 2)Consistent? 3)Unambiguous? 4)Complete? 5)Feasible? 6)Relevant?
Requirements Engineering Methods for Requirements Engineering Lecture-31.
Programming Language Design Issues Programming Languages – Principles and Practice by Kenneth C Louden.
Faithful mapping of model classes to mathematical structures Ádám Darvas ETH Zürich Switzerland Peter Müller Microsoft Research Redmond, WA, USA SAVCBS.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
Interface specifications At the core of each Larch interface language is a model of the state manipulated by the associated programming language. Each.
Principles of Programming & Software Engineering
Formal Specification.
Integrating SysML with OWL (or other logic based formalisms)
Principles of Programming and Software Engineering
IS 2935: Developing Secure Systems
Software Verification and Validation
Software Verification and Validation
Chapter 11 Describing Process Specifications and Structured Decisions
Department of Computer Science Abdul Wali Khan University Mardan
Software system modeling
Software Verification and Validation
Presentation transcript:

Mathematical Modeling and Formal Specification Languages CIS 376 Bruce R. Maxim UM-Dearborn

Mathematical Models Abstract representations of a system using mathematical entities and concepts Model should captures the essential characteristics of the system while ignoring irrelevant details If model is to be used for deductive reasoning about the system it needs to provide sufficient analytic power

Mathematical Model Benefits Mathematical model is more concise and more precise than natural language, pseudo-code, or diagrams Mathematical model can be used to calculate and predict system behavior Model can be analyzed using mathematical reasoning to prove system properties or derive new behaviors

Types of Mathematical Models Continuous Models –uses calculus and continuous function theory (e.g. derivatives, integrals, differential equations) –a function f would define the state of the system with an infinite number of states and smooth transitions Discrete Models –based on logic and set theory –state transition functions are used to model transitions among a finite number of states

Discrete Modeling Techniques Informal models –natural language –charts –tables Structural Models (employ formalisms) –data flow diagrams –ER diagrams –object models Formal Models (use formal semantics) –function models –state machine models –formal specification

Object Models Object models represent systems as structured collections of classes and object relations Object models provide a static view of a system Some object models rely on a combination of DFD, ER diagrams, and STD to yield a composite static/dynamic system model Object models are structural in nature and can be useful for creating initial system models that can be mapped to a formal model if needed

Function Models Similar to circuit design work A logic table for a full adder might be captured and represented as Adder(x, y, c input ) = (s, c output ) = ((x + y + c input ) mod 2, (x + y + c input ) div 2) Also similar to the algebraic specification we have seen in data type semantic specification

Function Modeling Example Abstract Stack - 1 Being by defining stack and element to be unspecified types stack: TYPE element: TYPE Use a subtype to define a non-empty stack type nonempty_stack a : TYPE = {s : stack | s /= empty}

Function Modeling Example Abstract Stack - 2 Basic operations are defined as functions push : [element, stack  nonempty_stack] pop: [nonempty_stack  stack] top : [nonempty_stack  element] Behavior is described by axioms Pop_Push : AXIOM pop(push(e, s)) = s Top_Push : AXIOM top(push(e, s)) = e

Function Modeling Example Abstract Stack - 3 Type checking assures that the expression pop(empty) is never allowed The theorem below follows from the type declarations Push_Empty: THEOREM push(e, s) /= empty The use of subtypes and theorems provides a powerful tool for capturing requirements in your type definitions

Formal Specification Language Based on formal mathematical logic with some programming language support (e.g. type system and parameterization) Generally non-executable models Designed to specify what is to be computed and not how the computation should be accomplished Most formal languages are based on axiomatic set theory or higher-order logic

Specification Language Features - part 1 Explicit semantics –language must have a mathematical basis Expressiveness –flexibility –convenience –economy of expression Programming language data types –arrays, structs, strings, sets, lists, etc.

Specification Language Features - part 2 Convenient syntax Diagramatic notation Strong typing –can be richer than ordinary programming languages –provides economy and clarity of expression –type checking provides consistency checks Total functions –most logics assume total functions –subtypes help make total functions more flexible

Specification Language Features - part 3 Axioms and definitions –axioms should be used carefully to avoid introducing inconsistencies –definitional principle ensures well-formed definitions –in some languages type checking assertions will be generated to ensure valid definitions Modularization –ability to break specifications into independent modules –parameterized modules allow for easier reusability

Specification Language Features - part 4 Built-in model of computation –handles simple type checking constraints –enhance proof-checking Maturity –documentation –tool support –theoretical basis –specification library availability –standardization

Importance of Type Checking Specification languages can have much richer type systems than programming languages since type do not have to be implemented directly Type checking can be used to detect faults and inconsistencies Essential model features can be embedded in types and subtypes

System Operations as Functions Basic system operations are often modeled as functions Functions can modify the system state so invariant conditions are often imposed on appropriate combinations of functions (e.g. similar to algebraic specification) Theorems and axioms can be used to model other system invariants employing functions

Logical Errors in Formal Specifications Logical inconsistency –Easiest logic errors to detect Accuracy –Does specification match intended meaning? –System invariants can help in detecting these errors. Completeness –Does specification identify all contingencies? –Are appropriate behaviors defined for all cases? –Peer review can aid in detection.

Techniques for Detecting Specification Errors Manual –Formal specification inspection –Theorem proving, proof checking, and model checking for logic defects Automated –Parsing specification for syntactic correctness –Type checking for semantic consistency –Simulation or animation based on the specification

Formal Specification Process Model Clarify requirements and high level design Articulate implicit assumptions Identify undocumented or unexpected assumptions Expose defects Identify exceptions Evaluate test coverage