1. Trang chủ
  2. » Mẫu Slide

Lecture Formal methods in software engineering - Lecture 19: Abstract model specification (cont) - TRƯỜNG CÁN BỘ QUẢN LÝ GIÁO DỤC THÀNH PHỐ HỒ CHÍ MINH

10 5 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 300,65 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Example File System DirEntry Name Object    contents. name[r]

Trang 1

Abstract Model Specification

Trang 2

 The flexibility to model a specification 

which can directly lead to the code.

 Easy to understand

 A large class of structural models can be 

described in Z without higher – order 

features, and can thus be analyzed 

efficiently.

 Independent Conditions can be added later

Trang 3

CHAM: for architectural description and 

analysis. 

Software Systems  chemicals (whose 

reactions are controlled by explicitly stated  rules).

Where floating molecules can only interact 

according to a stated set of reaction rules.

Trang 4

­ Chemical reactions

­ Molecules (components)

­ Reactions (Connectors)

­ Solutions (States of CHAM)

­ This is used in areas where intended 

architecture will tend to be large, complex,  and assembled from existing components.

Trang 5

Modeling Notation 

Trang 6

• Alloy

– Is a modeling notation that describes structural  properties

– Has a declaration syntax compatible with 

graphical object models

– Has a “set­based” formula syntax

Trang 7

File System

DirEntry Name Object

   contents

!

name

! Parent

(~children)

entries

! Dir

File

Trang 8

state {

partition File, Dir: static Object

Root: fixed Dir!

entries: Dir! ­> DirEntry

name: DirEntry ­> static Name!

contents: DirEntry ­> static Object!

parent (~children) : Object ­> Dir

   }

def parent {all o | o.parent = o.~contents.~entries}

inv UniqueNames {all d | all e1, e2: d.entries | e1.name = e2.name ­> e1 = e2}

inv Parents {

no Root.parent

all d: Dir – Root | one d.parent}

inv Acyclic {no d | d in d.+parent}

inv Reachable {Object in Root.*children}

cond TwoDeep {some Root.children.children}

assert FileHasEntry {all o | sole o.parent}

assert AtMostOneParent {all o | sole o.parent}

op NewDirEntries (d: Dir, es: DirEntry’) {

no es & DirEntry

d.entries’ = d.entries + es

Trang 9

• Structure of the model

– Domain paragraph

– State paragraph

– Definition paragraph

– Invariants

– Condition

– Assertions

– Operations

Trang 10

• Alloy supports two kinds of analysis

– Simulation: Consistency of an invariant or 

operation is demonstrated by generating a  state or transition.

– Checking: A consequence of a specification is 

tested by attempting to generate a  counterexample.

Ngày đăng: 01/04/2021, 16:02

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN

🧩 Sản phẩm bạn có thể quan tâm

w