DOC PREVIEW
USC CSCI 599 - October26b

This preview shows page 1-2-3-26-27-28 out of 28 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 28 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

PowerPoint PresentationSlide 2Slide 3Slide 4Slide 5Slide 6Slide 7Slide 8Slide 9Slide 10Slide 11Slide 12Cruise Control SystemSystem Block DiagramDriver InterfaceBrakes InterfaceAccelerator InterfaceSpeedMeter Interface(1)SpeedMeter Interface(2)Cruise Interface (1)Cruise Interface (2)Cruise Interface (3)Cruise Interface (4)Cruise Interface (5)Cruise Interface (6)The Architecture(1)The Architecture(2)Slide 28CS599 Formal Methods in Software Architectures1Temporal Examples in Rapide•Mohammad Al Said•Miheer Bhachech•Aditya GargCS599 Formal Methods in Software Architectures2Rapide SyntaxArchitecture•architecture_declaration ::= architecture identifier `(' [ parameter_list ] `)' [ return interface_expression ] is [ module_constituent_list ] [ connect { connection } ] end [ architecture ] [ identifier ] `;' •connection ::= pattern connector pattern `;' | other kinds of pattern connections ... •connector ::= `to' | `=>' | `||>'CS599 Formal Methods in Software Architectures3InterfaceThe interface type of a component consists of the set of constituents by which the component communicates with other components.•Interface types are declared using the following syntax: •type_declaration ::= type identifier is interface_expression `;' •interface_type_expression ::= interface { interface_constituent } [ behavior behavior_declaration ] end [ interface ] [ identifier ] •interface_constituent ::= provides { interface_declarative_item } | requires { interface_declarative_item } | action { action_name_declaration } | private { interface_declarative_item } | service { service_declarative_item } | constraint { pattern_constraint_list}CS599 Formal Methods in Software Architectures4Actions and Functions•action_name_declaration ::= action mode identifier `(' [ formal_parameter_list ] `)' `;' •mode ::= in | out •function_name_declaration ::= function identifier `(' [ formal_parameter_list ] `)' [ return type_expression ] `;' •For example, •action in Write(value : Data); function Read() return Data;CS599 Formal Methods in Software Architectures5Tool SupportThere are several tools to assist programmers who want to develop Rapide models of systems. The tools include: •an architecture-based editor for defining system models, •a compiler for producing executables from the system models, •a constraint checking runtime system that is used by an executable to produce a history of the execution, •a graphical browser for viewing histories, and •an animation facility providing another view of histories. •The Rapide Toolset is available for Solaris 2.5, SunOS 4.1.3. and Linux.CS599 Formal Methods in Software Architectures6CS599 Formal Methods in Software Architectures7Gas_StationAssumptions:• Operator schedules pumps to customers.• No mechanism that map customers to the right pump.• Main Gas tank refilling process is not included.• Main Gas Tank is divided into 3 tanks based on Fuel grade. • Car’ Gas tank is not included.CS599 Formal Methods in Software Architectures8type Dollars is Real; type Gallons is Real;type Fuel is Integer; type Customer is interface action out Pre_Pay(Cost : Dollars), Turn_On(), Walk(), Turn_Off(), Select_Grade(Fuel_Grade : Fuel); in Okay(), Change(Cost : Dollars); behavior D : Dollars; FG : Fuel; begin start => Pre_Pay(D);; Okay => Walk;; Okay => Select_Grade(FG); Turn_On();; end Customer;CustomerCS599 Formal Methods in Software Architectures9type Operator is interface action in Request(Cost : Dollars), Refill_Tank(FL : Boolean; Tank : Fuel), Result(Cost : Dollars); out Schedule(Cost : Dollars), behavior Payment : Dollars; Fuel_Level_Low : var Boolean :=False; Tank_Number: Fuel; Action Add_Fuel_To_Tank(Tank : Fuel); Begin (?X : Boolean ; ?Y : Fuel) (Refill_Tank(?X ; ?Y) => Fuel_Level_Low :=?X; Tank_Number :=?Y;; Fuel_Level_Low => Add_Fuel_To_Tank($Tank_Number);; (?X : Dollars)Request(?X) => Payment := ?X; Schedule(?X);; (?X : Dollars)Result(?X) => Remit($Payment - ?X);; end Operator;OperatorCS599 Formal Methods in Software Architectures10type Pump is interface action in On(), Off(), Activate(Cost : Dollars), Select_Fuel_Grade(Fuel_Grade : Fuel), Ok(); out Report(Amount : Gallons; Cost : Dollars), Request_Gas_From_Tank(GT : Fuel); behavior Free : var Boolean := True; Premium_Cost : var Real := 1.9; Plus_Cost : var Real := 1.8; Regular_Cost : var Real :=1.7; Reading, Limit : var Dollars := 0; Gallons_Dispensed : var Gallons :=0; action In_Use(), Done(), Fuel_Grade_Selected(); begin (?X : Dollars)(On ~ Activate(?X) AND Ok) where $Free => Free := False; Limit := ?X; Fuel_Grade_Selected;; Fuel_Grade_Selected => In_Use;; In_Use => if (((?Y : Fuel) Select_Fuel_Grade(?Y) == 1 ) then Reading := $Premium_Cost * $Gallons_Dispensed ) elsif (((?Y : Fuel) Select_Fuel_Grade(?Y) == 2) then Reading := $Plus_Cost * $Gallons_Dispensed ) else Reading := $Regular_Cost * $Gallons_Dispensed endif; Done;; Off or Done => Free := True; Report($Reading);; end Pump;PumpCS599 Formal Methods in Software Architectures11type Fuel_Tank is interface action in Requested_Gas_Type(Fuel_Grade : Fuel); out Ok(), Request_To_Refill_Tank(FL : Boolean ; Tank : Integer); behavior Fuel_Level : var Boolean :=True; Available_Gas , Threshold : Gallons; action Select_Tank_Type(Fuel_Grade : Fuel) , Send_To_Pump(); begin (?FG : Fuel) Request_Gas_Type(?FG) => Select_Tank_Type(?FG);; (Available_Gas <= Threshold ) => Fuel_Level_Ok :=False; Request_To_Refill_Tank($Fuel_Level, ?FG);; Send_To_Pump => Ok;; end Fuel_Tank; Fuel_TankCS599 Formal Methods in Software Architectures12architecture gas_station() return root is O : Operator; P1, P2, P3, P4 : Pump; C1, C2, C3, C4 : Customer; T : Tank; connect (?C : Customer; ?X : Dollars) ?C.Pre_Pay(?X) => O.Request(?X); (?X : Dollars; ?P : Pump) O.Schedule(?X) => ?P.Activate(?X); (?X : Dollars) O.Schedule(?X) => ?C.Okay; (?C : Customer; ?P : Pump; ?F : Fuel) ?C.Select_Grade(?F) => ?P.Select_Fuel_Grade(?F); (?P : Pump; T : Tank; ?F : Fuel) ?P.Request_Gas_From_Tank(?F) => T.Requested_Gas_Type(?F); (?F : Fuel ; FL : Boolean) T.Request_To_Refill_Tank(?FL , ?F) =>


View Full Document

USC CSCI 599 - October26b

Documents in this Course
Week8_1

Week8_1

22 pages

Week2_b

Week2_b

10 pages

LECT6BW

LECT6BW

20 pages

LECT6BW

LECT6BW

20 pages

5

5

44 pages

12

12

15 pages

16

16

20 pages

Nima

Nima

8 pages

Week1

Week1

38 pages

Week11_c

Week11_c

30 pages

afsin

afsin

5 pages

October5b

October5b

43 pages

Week11_2

Week11_2

20 pages

final

final

2 pages

c-4

c-4

12 pages

0420

0420

3 pages

Week9_b

Week9_b

20 pages

S7Kriegel

S7Kriegel

21 pages

Week4_2

Week4_2

16 pages

sandpres

sandpres

21 pages

Week6_1

Week6_1

20 pages

4

4

33 pages

Week10_c

Week10_c

13 pages

fft

fft

18 pages

LECT7BW

LECT7BW

19 pages

24

24

15 pages

14

14

35 pages

Week9_c

Week9_c

24 pages

Week11_67

Week11_67

22 pages

Week1

Week1

37 pages

LECT3BW

LECT3BW

28 pages

Week8_c2

Week8_c2

19 pages

Week5_1

Week5_1

19 pages

LECT5BW

LECT5BW

24 pages

Week10_b

Week10_b

16 pages

Week11_1

Week11_1

43 pages

Week7_2

Week7_2

15 pages

Week5_b

Week5_b

19 pages

Week11_a

Week11_a

29 pages

LECT14BW

LECT14BW

24 pages

T7kriegel

T7kriegel

21 pages

0413

0413

2 pages

3

3

23 pages

C2-TSE

C2-TSE

16 pages

10_19_99

10_19_99

12 pages

s1and2-v2

s1and2-v2

37 pages

Week10_3

Week10_3

23 pages

jalal

jalal

6 pages

1

1

25 pages

T3Querys

T3Querys

47 pages

CS17

CS17

15 pages

porkaew

porkaew

20 pages

LECT4BW

LECT4BW

21 pages

Week10_1

Week10_1

25 pages

wavelet

wavelet

17 pages

October5a

October5a

22 pages

p289-korn

p289-korn

12 pages

2

2

33 pages

rose

rose

36 pages

9_7_99

9_7_99

18 pages

Week10_2

Week10_2

28 pages

Week7_3

Week7_3

37 pages

Load more
Download October26b
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view October26b and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view October26b 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?