Software specification in CASL - The Common Algebraic Specification - - PowerPoint PPT Presentation

software specification in casl the common algebraic
SMART_READER_LITE
LIVE PREVIEW

Software specification in CASL - The Common Algebraic Specification - - PowerPoint PPT Presentation

Software specification in CASL - The Common Algebraic Specification Language Till Mossakowski, Lutz Schr oder October 2006 2 Overview Why formal specification? Waterfall Model Example: sorting CASL the Common Algebraic


slide-1
SLIDE 1

Software specification in CASL - The Common Algebraic Specification Language

Till Mossakowski, Lutz Schr¨

  • der

October 2006

slide-2
SLIDE 2

2

Overview

  • Why formal specification?
  • Waterfall Model
  • Example: sorting
  • CASL – the Common Algebraic Specification Language
  • Layers of CASL
  • Overview of the course
  • Scheinkriterien

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-3
SLIDE 3

3

Why formal specification?

Erroneous software systems may lead to

  • economic losses

(e.g.: loss of Ariane V and mars probe, pentium bug),

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-4
SLIDE 4

3

Why formal specification?

Erroneous software systems may lead to

  • economic losses

(e.g.: loss of Ariane V and mars probe, pentium bug),

  • security problems (e.g.: Loveletter virus),

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-5
SLIDE 5

3

Why formal specification?

Erroneous software systems may lead to

  • economic losses

(e.g.: loss of Ariane V and mars probe, pentium bug),

  • security problems (e.g.: Loveletter virus),
  • damage of persons (e.g.: death due to erroneously

computed radiation dose)

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-6
SLIDE 6

4

Formal specification — Success stories

  • complete formal verification of microprocessor arithmetic

(pentium 4, AMD)

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-7
SLIDE 7

4

Formal specification — Success stories

  • complete formal verification of microprocessor arithmetic

(pentium 4, AMD)

  • NASA uses axiomatic specification of physical units

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-8
SLIDE 8

4

Formal specification — Success stories

  • complete formal verification of microprocessor arithmetic

(pentium 4, AMD)

  • NASA uses axiomatic specification of physical units
  • verification of the Java bytecode verifier

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-9
SLIDE 9

4

Formal specification — Success stories

  • complete formal verification of microprocessor arithmetic

(pentium 4, AMD)

  • NASA uses axiomatic specification of physical units
  • verification of the Java bytecode verifier
  • found 12 deadlocks in Occam code for international space

station

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-10
SLIDE 10

5

Axiomatic Specfication

  • loose requirements, close to informal descriptions

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-11
SLIDE 11

5

Axiomatic Specfication

  • loose requirements, close to informal descriptions
  • clarification of underlying mathematical concepts

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-12
SLIDE 12

5

Axiomatic Specfication

  • loose requirements, close to informal descriptions
  • clarification of underlying mathematical concepts
  • design of algorithms and data structures independently of

any implementation language

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-13
SLIDE 13

5

Axiomatic Specfication

  • loose requirements, close to informal descriptions
  • clarification of underlying mathematical concepts
  • design of algorithms and data structures independently of

any implementation language

  • Casl is a standard for axiomatic specification

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-14
SLIDE 14

6

Waterfall Model (slide by M. Roggenbach)

Requirement Elicitation and Analysis ↑ ↓ Nat Lang. Informal Specification ↑ ↓ Validation

  • Spec. Lang.

Formal Requirements Specification ↑ ↓ “Invent & Verify”,

  • Spec. Lang.

Formal Design Specification ↑ ↓ Transformation or

  • Progr. Lang.

Implementation ↑ ↓ Systematic Testing Test ↑ ↓ Maintenance

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-15
SLIDE 15

7

Example: sorting

Informal specification: To sort a list means to find a list with the same elements, which is in ascending order.

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-16
SLIDE 16

7

Example: sorting

Informal specification: To sort a list means to find a list with the same elements, which is in ascending order. Formal requirements specification:

  • is ordered(sorter(L))
  • is ordered(L) ⇔ ∀L1, L2 : List; x, y : Elem .

L = L1 + +[x, y] + +L2 ⇒ x ≤ y

  • permutation(L, sorter(L))
  • permutation(L1, L2) ⇔

∀x : Elem . count(x, L1) = count(x, L2)

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-17
SLIDE 17

8

Sorting (cont’d)

We want to show insert sort to enjoy these properties. Formal design specification:

  • insert(x, []) = [x]
  • insert(x, y :: L) =

x :: y :: L) when x ≤ y else y :: insert(x, L)

  • insert sort([]) = []
  • insert sort(x :: L) = insert(x, insert sort(L))

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-18
SLIDE 18

9

Implementation (in Haskell)

insert :: Ord a => (a,[a]) -> [a] insert(x,[]) = [x] insert(x,y:l) = if x <= y then x:y:l else y:insert(x,l) insert_sort :: Ord a => [a] -> [a] insert_sort([]) = [] insert_sort(x:l) = insert(x,insert_sort(l))

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-19
SLIDE 19

10

CASL – the Common Algebraic Specification Language

  • de facto standard for specification of functional

requirements

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-20
SLIDE 20

10

CASL – the Common Algebraic Specification Language

  • de facto standard for specification of functional

requirements

  • developed by the “Common Framework Initiative”

(an open international collaboration)

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-21
SLIDE 21

10

CASL – the Common Algebraic Specification Language

  • de facto standard for specification of functional

requirements

  • developed by the “Common Framework Initiative”

(an open international collaboration)

  • approved by IFIP WG 1.3

“Foundations of Systems Specifications”

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-22
SLIDE 22

10

CASL – the Common Algebraic Specification Language

  • de facto standard for specification of functional

requirements

  • developed by the “Common Framework Initiative”

(an open international collaboration)

  • approved by IFIP WG 1.3

“Foundations of Systems Specifications”

  • Casl User Manual (Lecture Notes in Computer Science

2900) and Reference Manual (Lecture Notes in Computer Science 2960)

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-23
SLIDE 23

11

Foundations of CASL

  • detailed language summary, with informal explantation

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-24
SLIDE 24

11

Foundations of CASL

  • detailed language summary, with informal explantation
  • formal definition of abstract and concrete syntax

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-25
SLIDE 25

11

Foundations of CASL

  • detailed language summary, with informal explantation
  • formal definition of abstract and concrete syntax
  • complete formal semantics

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-26
SLIDE 26

11

Foundations of CASL

  • detailed language summary, with informal explantation
  • formal definition of abstract and concrete syntax
  • complete formal semantics
  • proof systems

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-27
SLIDE 27

11

Foundations of CASL

  • detailed language summary, with informal explantation
  • formal definition of abstract and concrete syntax
  • complete formal semantics
  • proof systems
  • libraries of basic datatypes

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-28
SLIDE 28

11

Foundations of CASL

  • detailed language summary, with informal explantation
  • formal definition of abstract and concrete syntax
  • complete formal semantics
  • proof systems
  • libraries of basic datatypes

All this is contained in the Reference Manual — here, we will largely follow the User Manual

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-29
SLIDE 29

12

CASL has rock-solid foundations

  • the complete formal semantics maps the syntax to

underlying mathematical concepts

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-30
SLIDE 30

12

CASL has rock-solid foundations

  • the complete formal semantics maps the syntax to

underlying mathematical concepts

  • Casl specifications denote classes of models

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-31
SLIDE 31

12

CASL has rock-solid foundations

  • the complete formal semantics maps the syntax to

underlying mathematical concepts

  • Casl specifications denote classes of models
  • The semantics is largely indepdendent of the details of the

logic (institution)

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-32
SLIDE 32

12

CASL has rock-solid foundations

  • the complete formal semantics maps the syntax to

underlying mathematical concepts

  • Casl specifications denote classes of models
  • The semantics is largely indepdendent of the details of the

logic (institution)

  • The semantics is the ultimative reference for the meaning
  • f Casl

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-33
SLIDE 33

13

CASL on the web

  • Casl in general: http://www.cofi.info
  • Casl tools: http://www.tzi.de/hets
  • Casl libraries: http://www.cofi.info/Libraries

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-34
SLIDE 34

14

Layers of CASL

Casl consists of several major layers, which are quite independent and may be understood (and used) separately: Basic specifications many-sorted first-order logic, subsorting, partial functions, induction, datatypes.

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-35
SLIDE 35

14

Layers of CASL

Casl consists of several major layers, which are quite independent and may be understood (and used) separately: Basic specifications many-sorted first-order logic, subsorting, partial functions, induction, datatypes. Structured specifications translation, reduction, union, and extension of specifications; generic (parametrized) and named specifications

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-36
SLIDE 36

15

Why Modular Decomposition?

  • reduction of complexity
  • better understanding of specification and code

(small pieces, well-defined interfaces)

  • better distribution of work

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-37
SLIDE 37

15

Why Modular Decomposition?

  • reduction of complexity
  • better understanding of specification and code

(small pieces, well-defined interfaces)

  • better distribution of work

vs.

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-38
SLIDE 38

15

Why Modular Decomposition?

  • reduction of complexity
  • better understanding of specification and code

(small pieces, well-defined interfaces)

  • better distribution of work

vs.

  • better maintenance and possibilities of re-use

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-39
SLIDE 39

16

Layers of CASL (cont’d)

Architectural specifications structuring of implementation: define how models of a specification may be constructed

  • ut of models of simpler specifications.

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-40
SLIDE 40

16

Layers of CASL (cont’d)

Architectural specifications structuring of implementation: define how models of a specification may be constructed

  • ut of models of simpler specifications.

Libraries allow the distributed (over the Internet) storage and retrieval of (particular versions of) named specifications.

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-41
SLIDE 41

17

Overview of the course

  • recall basics of first-order logic
  • loose + free specifications (case study: text formatting)
  • Casl tools: Hets and SPASS
  • partial functions, subsorting
  • generated specifications
  • a bit of semantics
  • structuring and generic specifications
  • architectural specifications
  • case studies (invoice system, steam boiler)
  • outlook: Casl extensions

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-42
SLIDE 42

18

Scheinkriterien

  • 3 ¨

Ubungsbl¨ atter

  • ggf. Fachgespr¨

ach

  • Modulpr¨

ufung m¨

  • glich

T.Mossakowski, L. Schr¨

  • der: Casl; October 2006
slide-43
SLIDE 43

Continue with slides for CASL User Manual (by M. Bidoit and P.D. Mosses)