Model-Oriented Specifications & Language Z

9
http://d3s.mff.cuni.cz Model - Oriented Specifications & Language Z Pavel Parízek

Transcript of Model-Oriented Specifications & Language Z

Page 1: Model-Oriented Specifications & Language Z

http://d3s.mff.cuni.cz

Model-Oriented Specifications &

Language Z

Pavel Parízek

Page 2: Model-Oriented Specifications & Language Z

Model-oriented specifications

2

Model: internal state & operations

ImplementationIterative refinement of specifications“coding from scratch”

Tests generated from the model

Target domain: complex statedatabases, file systems

Popular languages: Z, B, VDMset theory + first-order logic + programming languages

Page 3: Model-Oriented Specifications & Language Z

Language Z

3

Based on: sets, relations, predicates, and formulas in the first-order logic

Specification

Informal description (plain text)

Formal chunks (graphical notation)

Examples: bank account, file system

Page 4: Model-Oriented Specifications & Language Z

Schemas

4

Structure: name, declarations, constraints

System state schema

Schema of operation

Notation for variable names

input arguments (name?) versus output (name!)

pre-state (plain: a) versus post-state (primed: a’)

Page 5: Model-Oriented Specifications & Language Z

Schema calculus and composition

5

Combining schemas

logic connectives (and, or, not)

Including schemas

Benefits: modularity & reuse

Page 6: Model-Oriented Specifications & Language Z

Process of creating specifications in Z

6

Main stepsInformal description (plain text)Schemas for the system state

Sets of necessary information about subject world

Schemas for operations

Recommended approachFirst standard control flow and valid inputsThen incorrect inputs and handling errors

Proving some claimsUsing axioms and inference rules

Page 7: Model-Oriented Specifications & Language Z

Other features of Z

7

Generic schemas

Sequences

Page 8: Model-Oriented Specifications & Language Z

Tool support

8

https://formalmethods.wikia.org/wiki/Z_notation#Tool_support

http://czt.sourceforge.net/

Page 9: Model-Oriented Specifications & Language Z

Literature

9

J.M. Spivey. The Z Notation: A Reference Manual. Oxford

https://spivey.oriel.ox.ac.uk/wiki/files/zrm/zrm.pdf

J. Bowen. Formal Specification and Documentation using Z: A Case Study Approach.