2 views

Uploaded by Devmani Shukla

GD

- 2nd Year Cse
- inverse functions
- 10.1.1.49.8099
- ECE449_lecture4
- Lecture 34 1
- Functions Domain Range
- ML1
- Some C Programming Language Tips.doc
- Function Root
- The Complexity of Optimizing Finite-State Transducers
- Praktikum 2 Eng
- IRJET-Elevator Control System using Finite Automata
- ASM
- PlanAhead Tutorial Debugging w ChipScope
- Automata Intro
- pdfmarkReference_v9
- description: tags: shakrani
- Tutorial on Axiomatic Set Theory - Movellan
- 2002 Carlson
- Unit 3 Linear Functions Unit Plan TUHSD

You are on page 1of 79

(continued) Lecture 3:

(SE 252/502)

Dr. RAJIB Mall

Organization of this

Lecture

Overview of last lecture

Algebraic specification:

Development technique

Rewrite rules

Example

Pros and cons

Summary

2

Review of last

lecture

Formal specification

techniques:

model-oriented

property-oriented

3

Review of last

lecture

Property-oriented techniques:

axiomatic specification

algebraic specification

Model-oriented techniques:

Z, VDM, Petri net, State machine,

etc.

4

Overview of last

lecture

Axiomatic techniques:

based on early work on

program verification.

Use first-order predicate logic:

specify operations through pre

and post conditions

5

Review of last

lecture

Algebraic technique:

data types are viewed as

heterogeneous algebra

axioms are used to state

properties of data type

operations

6

Algebraic Specification

Using algebraic

specification:

the meaning of a set of

interface procedures is

defined by using equations.

7

Algebraic

Specification

Algebraic specifications are

usually presented in four parts:

types section

exceptions section

signature section

rewrite rules section

8

Types Section

Types Section Lists:

sorts (or types) being specified

sorts being imported

Importing a sort:

makes it available in

specification.

9

Exception Section

Lists names of exceptional

conditions used in later

sections:

under exceptional conditions

error should be indicated.

10

Signature Section

Defines signatures of interface

procedures:

e.g. PUSH takes a stack and an

element and returns a new

stack.

push:

stack element stack

11

Rewrite rules

section

Lists the properties of the

operators:

In the form of a set of axioms

or rewrite rules.

allowed to have conditional

expressions

12

Developing Algebraic

Specification

The first step in defining an

algebraic specification:

operations.

e.g. for string identify operations:

create, compare, concatenate,

length, etc.

13

Developing Algebraic

Specification

classes:

Constructor Operations :

Operations which create or

modify entities of the sort e.g.,

create, update, add, etc.

14

Developing Algebraic

Specification

Inspection Operations :

Operations which

evaluate attributes of the

sort, e.g., eval, get, etc.

15

Developing Algebraic

Specification

A rule of thumb for writing

algebraic specifications:

first establish constructor

and inspection operations

16

Developing Algebraic

Specifications

Next, write down

axioms:

compose each inspection

operator over each

constructor operator.

17

Developing Algebraic

Specifications

If there are m constructors

and n inspection operators:

axioms.

However, an exception to this

rule exists.

18

Developing Algebraic

Specifications

be defined using other

constructors:

we need to define inspection

operations using only primitive

constructors.

19

Example: Stack

Let us specify an unbounded

stack supporting:

push,

pop,

newstack,

top,

empty.

20

Example: Stack

Types:

defines stack

Exception:

underflow, novalue

21

Example: stack

Syntax:

push:

stack element stack

pop:

stack stack+{underflow}

22

Example: stack

top:

stack element+{novalue}

empty:

stack boolean

newstack:

stack

23

Equations: stack

pop(newstack)=underflow

pop(push(s,e))=s

top(newstack)=novalue

top(push(s,e))=e

empty(newstack)=true

empty(push(s,e))=false

24

Rewrite rules

Rewrite rules let you

determine:

the meaning of any sequence

of calls on the stack

functions.

25

Rewrite rules

Empty(push(pop(push(newsta

ck,e1)),e2)):

you can eliminate the call on

pop by observing:

it is of the form pop(push(s,e)).

26

Rewrite rules

After simplification:

empty(push(newstack,e1))

false

27

Two important

questions

Finite termination property:

Does application of rewrite rules

terminate after a finite number of

steps?

We might endlessly go on applying

rewrite rules without coming to

any conclusion?

28

Two important

questions

Unique termination property:

Can different sequence in application of

the rewrite rules always give the same

answer?

If we choose to simplify different terms

of the expression in different

experiments:

shall we always get the same answer?

29

Algebraic

Specification

For arbitrary algebraic

equations:

convergence is undecidable.

has fewer terms than the left:

rewrite process must terminate.

30

Auxiliary Functions

Sometimes development of a

specification requires:

extra functions not part of the

system:

to define the meaning of some

interface procedures.

31

Auxiliary Functions:

Example

To specify bounded stacks:

need to add a depth function:

push returns either a stack or

an exception overflow

when depth is exceeded.

32

Bounded stack

In order to specify a bounded

stack:

we need to make changes to

different sections to include

auxiliary functions.

33

Auxiliary Functions

Syntax:

push:

stack element ==> stack

depth:

stack integer

34

Auxiliary Functions

Equations:

depth(newstack)=0

depth(push(s,e))=depth(s)+1

push(s,e)=overflow if

depth(s) >= Max

35

Example 2: coord

Types:

sort coord

imports integer, boolean

36

Example: coord

Signature:

create(integer,integer) coord

X(coord) integer

Y(coord) integer

Eq(coord,coord) boolean

37

Example: coord

Rewrite rules:

X(create(x,y))=x

Y(create(x,y))=y

Eq(create(x1,y1),create(x2,y2))

= ((x1=x2) and (y1=y2))

38

Structured

Specifications

Writing formal specifications is time

consuming.

To reduce effort, we need to reuse

specifications:

instantiation of generic specifications

incremental development of

specifications

39

Specification

Instantiation

Take an existing

specification:

specified with some generic

parameter

Instantiate with some sort

40

Incremental

Development

Develop specifications for

simple sorts:

using these specify more

complex entities.

41

Algebraic specifications

have a strong mathematical

basis:

can be viewed as

heterogeneous algebra.

42

An important shortcoming of

algebraic specifications:

cannot deal with side effects

difficult to use with common

programming languages.

43

Algebraic specifications are

hard to understand:

also changing a single property

of the system

may require changing several

equations.

44

Specification of

timing constraints

Timing constraints:

expressed in terms of

occurrence of certain

events.

45

Events

environment.

Can also be an externally

observable response:

that the system makes to its

environment

46

Types of timing

constraints

Performance constraints:

constraints imposed on the

response of the system.

Behavioral constraints:

constraints imposed on the action

and reaction time of the

environment (or the user).

47

Specification of

timing

constraints

We will specify timing

constraints:

in terms of stimuli and

response

modelled as FSMs (Finite State

Machines)

48

State machine

modelling

Assumes that at any time:

the system is in one of a

number of possible states.

it may cause a transition to a

different state.

49

Finite Automaton

with

A set ofOutput

states

final state:

an alphabet of output symbols

a transition function:

symbols to states

50

Representation

Dial

Timer alarm/ Again

Event

dial-tone

Await

first

digit

Await

second

First digit/

start-timer(20) digit

Second digit/

silence

Await

next

digit

Action

51

Types of finite

automaton

A finite automaton with output

may be organized in two ways:

A Moore machine is an automaton

each state is associated with an

output symbol

transition with an output symbol

52

Classification:

Three types of timing

constraints:

Minimum

Maximum

Durational

53

Minimum

Between two events:

No less than t time

units may elapse

e1

e2

54

Maximum

Between two events:

No more than t time

units may elapse

e1

e2

55

Durational

An event must occur

for t units of time

56

Maximum

S-S (stimulus-stimulus)

S-R (stimulus-response)

R-S (response-stimulus)

R-R (response - response)

57

Maximum S-S

Maximum time between

occurrence of two stimuli:

e.g. after dialling first digit,

the second digit should be

dialled no more than 20 secs

later.

58

FSM Representation

To represent timing

constraints in an FSM:

a timer alarm is used as

an artificial stimulus.

59

Representation

Dial

Timer alarm/ Again

Event

dial-tone

Await

first

digit

Await

second

First digit/

start-timer(20) digit

Second digit/

silence

Await

next

digit

Action

60

Maximum S-R

Maximum time between

stimulus and response:

e.g. caller shall receive dial

tone no later than 20 secs after

lifting the receiver.

61

Representation

Offhook/

Start

timer(20)

Await

First

Digit

First

Digit

Alarm/

Dial tone

Start

timer (20)

Await

Second

Digit

Second

Digit

Alarm/

Dial tone

Dial

Again

62

Complete

Representation

Await

Await

Offhook/

Start

timer(20)

First

Digit

Second

Digit

Alarm/

Dial tone

Start

timer (20)

Dial

Again

Second

Digit

Await

Eighth

Digit

Eighth digit/

Alarm/

Alarm/

Ring tone

Dial

tone

Dial tone

Dial

Complete

63

Maximum R-S

Maximum time between systems

response and the next stimulus

from the environment:

e.g after receiving the dial tone, the

caller shall dial the first digit

within 20 sec.

64

Maximum R-R

Maximum time allowed between

two responses:

after a connection has been made,

the caller will receive a ring back

tone no more than 0.5 sec after the

callee has received the ring tone.

65

Minimum

constraints

S-S

R-S

R-R

66

Minimum S-S

A minimum time is required

between two stimuli:

e.g. a minimum of 0.5 sec must

elapse between the dialling of

one digit and the dialling of the

next.

67

Minimum S-S

This is an example of behavioral

constraints on system users:

the complete specification should

include

response the system should make if

the user responds too soon.

68

Representation

Timer alarm/

Handle

digit

First digit/

start-timer(0.5)

Await

Next

Digit

Second digit/

silence

Second digit/

beeping

Await

Caller

On hook

69

Durational timing

constraints

To go back to the

international operator

press the button for at least

15 secs (but no more than 30

secs)

70

Durational timing

constraints

To get back to the local

operator:

press the button for at least 30

secs, but no more than 45 secs

button for at least 45 secs.

71

Representation

Timer

alarm(15)

Set timer

15,30,45

B

Timer

alarm(30)

Timer

alarm(45)

C

D

E

72

Reference

Ian Somerville, Chapter

Chapter 10

R. Mall, Chapter 3

B. Dasarathy, Timing

constraints of R-T systems,

IEEE TSE, 1985, pp. 80--86.

73

Summary

We started by discussing some

general concepts in:

formal specification

techniques.

74

Summary

Formal requirements

specifications:

have several positive

characteristics.

But the major shortcoming is

that they are hard to use.

75

Summary

It is possible that formal

techniques will become

more usable in future

with the development of

suitable front-ends.

76

Summary

We discussed a sample

specification technique,

algebraic specification

gives us a flavour of the issues

involved in formal

specification.

77

Summary

We discussed specification of

timing constraints:

classification

modelling using FSMs

78

Next Lecture

Real-time system design:

Structured analysis of

system behavior

Ward and Mellor technique

79

- 2nd Year CseUploaded bymainak saha
- inverse functionsUploaded byRoszelan Majid
- 10.1.1.49.8099Uploaded bykrishnanand
- ECE449_lecture4Uploaded byAvinash Kumar
- Lecture 34 1Uploaded byAmandeep Gupta
- Functions Domain RangeUploaded byAiram Anitsirhc Cuasito Manzano
- ML1Uploaded byHumbang Purba
- Some C Programming Language Tips.docUploaded byMahmoud Eladawi
- Function RootUploaded byokokok1226
- The Complexity of Optimizing Finite-State TransducersUploaded bymaneco
- Praktikum 2 EngUploaded bykhalil
- IRJET-Elevator Control System using Finite AutomataUploaded byIRJET Journal
- ASMUploaded bymohapatramugdha99
- PlanAhead Tutorial Debugging w ChipScopeUploaded byKiran Kumar
- Automata IntroUploaded byKeith W Barnwell
- pdfmarkReference_v9Uploaded byacil435
- description: tags: shakraniUploaded byanon-712550
- Tutorial on Axiomatic Set Theory - MovellanUploaded byRanu Games
- 2002 CarlsonUploaded bySayda Quiroga
- Unit 3 Linear Functions Unit Plan TUHSDUploaded byLindsey
- Stacks and QueuesUploaded byAnonymous yIJZrtGy
- 1Uploaded byapi-368121935
- PPt_001Uploaded byLam Wong
- 200211248Uploaded byTran Tung
- Mathematics Paper 2 HLUploaded byVíctor Calderón Callao
- AppendicesUploaded byNag Challa
- Ex.01Uploaded byArunachalam Muthiah
- D72601GC10Uploaded byTarun Chawla
- Introducción al MapleUploaded byJose Manuel Luna
- ACFrOgBxk_US2WPmaH5qmy4l0BhlPCxkeV06BREtalAoqQevJ1QI0Sk7VMl2sRRRDE3V_61fIisG-K1rwjeIA8ApxAwxgDfywcl6YK7Kb8kHTEvlevO5dMGbGpdf3sw=Uploaded byArun Sharma

- Rajib Mall Lecture NotesUploaded byAnuj Nagpal
- 16 bash Shell Scripting.pdfUploaded byDevmani Shukla
- LECTURE 1Uploaded byDevmani Shukla
- LECTURE 1Uploaded byDevmani Shukla
- LECTURE 3Uploaded byDevmani Shukla
- Homework1 (2)Uploaded byDevmani Shukla
- 14556 HomeworkUploaded byDevmani Shukla
- coUploaded byDevmani Shukla
- New Microsoft Office Word DocumentUploaded byDevmani Shukla

- Barcol-air_Fan_Coils_2008-copy.pdfUploaded byhyreepkt
- MMC 4609 - Communication Research Strategy - Exam 2 ReviewUploaded byMark Fiorentino
- 2003 5-7 p1Uploaded byAPinkFluffyUnicorn
- Sargent T., Et. Al (2010) - Practicing DynareUploaded byMiguel Ataurima Arellano
- Hot Ashalt Mix Desing System - MOTUploaded byengrrahman3135
- Beam-searching and Transmission Scheduling in.pdfUploaded byMohammad
- Presentation Math Coordinate GeometryUploaded byonemastura2093
- Quartal Triads for a Coltrane SoundUploaded byPim Van Harten
- 188521887-Design-of-Water-Treatment-Systems.pdfUploaded bySharath Raju
- Leica Na2 Nak2Uploaded bybbutros_317684077
- 264935_chemistry_session_2.pdfUploaded byfatimah
- Addressing Modes in 8051Uploaded bySundar Sathappan
- ZeeTrack User ManuaalUploaded bycarlyblack2006
- leg edema sensorUploaded byapi-335376701
- Real NumbersUploaded byAbhi 7
- FW 2Uploaded byCristine Joy Mag-isa
- in MeasurementUploaded byAnonymous oNgQtJ
- k011Uploaded byLuis Fernando
- Trickle Tower and Shower FiltersUploaded byFik Ry
- RTP Streaming With XineUploaded bykokoalove
- The effects of a model-eliciting activity on high school student.pdfUploaded byNeng
- Lab Programs GUIUploaded byDVADONE
- Topic 2 Matlab ExamplesUploaded byKokyi Chan
- Zheng Wei Hong on Buddhist LogicUploaded byParker
- glm_multivariate_cc_p.pdfUploaded byMunirul Ula
- 2011 Yamaguchi Control of a Five-Axle, Three-steering Coupled-Vehicle System and Its Experimental VeriﬁcationUploaded bySubhajeet Rath
- F1 Maths C9 NotesUploaded byKarmen Thum
- airfoilterminology-121104015724-phpapp01.pptUploaded byEng-ezz Alarab
- Online booking system project report.docxUploaded bymandeep kumar
- Strain Gauge Based AccelerometerUploaded byanandakumarmts