0% found this document useful (0 votes)
471 views

Introduction - VDM-SL - Formal Methods in SE

This document provides an outline for a lecture on formal methods in software engineering using VDM-SL. It will introduce VDM-SL, discuss how it relates to object-oriented programming and Java, explain VDM-SL syntax and semantics, present a case study using VDM-SL, show how to convert VDM-SL specifications to Java code, and cover composite objects and maps in VDM-SL. The instructor is Wajiha Mughal and it will be taught in the fourth semester at National University of Modern Languages in Islamabad.

Uploaded by

Hasnat Ali Ibrar
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
471 views

Introduction - VDM-SL - Formal Methods in SE

This document provides an outline for a lecture on formal methods in software engineering using VDM-SL. It will introduce VDM-SL, discuss how it relates to object-oriented programming and Java, explain VDM-SL syntax and semantics, present a case study using VDM-SL, show how to convert VDM-SL specifications to Java code, and cover composite objects and maps in VDM-SL. The instructor is Wajiha Mughal and it will be taught in the fourth semester at National University of Modern Languages in Islamabad.

Uploaded by

Hasnat Ali Ibrar
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Formal Methods in SE

Topic: VDM-SL

Instructor: Wajiha Mughal


Email id: [email protected]
Semester: IV
National University of Modern Languages, Islamabad
Outline

• Introduction to VDM – SL
• VDM and Object Oriented Programing
• VDM and JAVA
• VDM –Syntax and semantics
– State
– Operation
– Values
– Invariants
– Specifying Functions
– User define datatypes
– Nil Values
• VDM-SL Case Study: Incubator Monitor
• VDM-SL Conversion into JAVA code
• Composite objects
• Maps & proofs
Introduction to VDM-SL
• Classifying Formal
Methods:
– Two approaches are there
• Algebraic
• Model-based
Algebraic Model Base
Sequential LARCH Vienna
Systems Development
Method (VDM)
Z
B
Concurrent Calculus of Prototype
Systems Communicating Verification
Systems System (PVS)
OBJ Communicating
Sequential
Processes (CSP)
Introduction to VDM-SL: Model
Base Approach
• Model based formal methods are well-
established and most common in use
– Developed to specify sequential systems.

• Specifying concurrent systems involves


subtle timing considerations
– that are not always easy to capture formally.
Model Base Approach Cont.
• VDM (the Vienna Development Method) is the
most mature, having been developed in the late
1970s.
• It has a recognized international standard (
www.ifad.dk/vdm/bnf.html) that gives the
formal semantics of the language.
• The method also has a comprehensive set of
tools supporting it.
– It also has the longest history of use in industry.
Of the others, both Z (pronounced Zed) and B are
now well established with well-documented
industrial experience.
• All share a strong similarity with VDM..
VDM and Object Oriented
Programing
• VDM specification follows the notion of a
class in an object-oriented methodology
– Example: First, in this case record the
informal specification of software using the
UML class notation.
– Then provide a formal specification for a UML
class in the form of a VDM specification.
• Every aspect of VDM language will be
demonstrated through the development of
Java programs from the VDM specifications.
A lightweight approach to formal program development in VDM
VDM and JAVA

Source: https://www.minigranth.com/core-java-tutorial/oops-in-java-object-oriented-programming/
VDM- SL: Syntax and Semantics

VDM-SL Syntax Semantics


Data types:
, Natural numbers (positive whole numbers)
1 Natural numbers excluding zero
Z integers (positive and negative whole numbers)
R real numbers (positive and negative numbers that can include a fractional part)
boolean values (TRUE or FALSE)
B the set of alphanumeric characters
Char State<Name> of
State: Way to define state in the specification
State: State<Name> of Way to define state in the specification
end
end
Operation: <Operation Name> Mandatory to mention external clause either data is just to read or it can be write as well.
Ext clause (rd/wr)
Operation: <Operation Name> Furthermore,
Mandatory to pre condition
mention and clause
external post condition will is
either data bejust
listed.
to read or it can be write as well.
Pre-condition
Ext clause (rd/wr) Furthermore, pre condition and post condition will be listed.
Post-condition
Pre-condition
Post-condition
Constants: Constant will be specified using key word “values”
Values
Constants: Constant will be specified using key word “values”
Values
Invariants: To declare and initialize invariants in specifications use key word “inv mk”
inv mk
Invariants: To declare and initialize invariants in specifications use key word “inv mk”
inv define
To mk user define Enumerable or user defined datatypes can be represented using keyword “types”
datatypes:
To define user define Enumerable or user defined datatypes can be represented using keyword “types”
types
datatypes:
types

You might also like