Brendan Ang

Search

Search IconIcon to open search

Formal Specification

Last updated Mar 28, 2023 Edit Source

# Formal Specification

A formal specification is the expression, in some formal language and at the some level of abstraction, of a collection of properties the system should satisfy through its behaviour.

# Motivation

Boehm’s First Law: Errors are more frequent during requirements and design activities and are more expensive the later they are removed.

Formality helps us to obtain higher quality specifications which are able to detect serious problems in original informal specifications. It also enables automated analysis of the specification.

# Problem Abstraction

Process of simplifying the problem at hand and facilitating our understanding of a system.

# Systems

# Example on cold vaccine storage

A system that stores vaccine at a temperature that should not exceed -70 degrees

Safety property: $temp+\delta\le-70$ Fault Tree Analysis: Safety invariants (things that should always hold) that need to be verified:

  1. Always after controller has reacted, if sensor is not OK then alarm is raised and actuator is in decr
  2. Always after controller reacted, if sensor is OK and temp + Δ ≥ -70 then cooler is in decr

# Formal Specification Frameworks

Event-B

# Building a Safety Case

Fundamental elements:

  1. Define safety requirements (SR)
  2. Use formal specification in Event-B to model the requirements
  3. Discharging the proof obligations produces evidence that SR is met. Shown through Goal Structured Notation: