SPL (Simple Programming Language)

Temporal Verification of Reactive Systems: Safety

Info icon This preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
CS256/Winter 2007 — Lecture #2 Zohar Manna Announcements Homework 1 (short) given today, due Tuesday Next homeworks given each Tue, due next Tue Mailing list created: cs2[email protected] If you don’t receive welcome message by the end of the day, please let Matteo know. Matteo’s extra office hours this week: Tomorrow (Friday) 2:00–3:00 pm 2-1 SPL (Simple Programming Language) Syntax Basic Statements skip assignment ( u 1 , . . . , u k ) | {z } variables := ( e 1 , . . . , e k ) | {z } expressions await c (where c is a boolean expression) special case: halt await f Communication by message-passing α e (send) α u (receive) (where α is a channel) Semaphore operations request r ( r > 0 r := r - 1 ) release r ( r := r + 1 ) (where r is an integer variable) 2-2 SPL (CON’T) Schematic Statements In Mutual-Exclusion programs: noncritical may not terminate critical terminates In Producer-Consumer programs: produce x terminates – assign nonzero value to x 2-3 consume y terminates No program variables are modified by schematic statements. One exception: x ” in produce x
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
SPL (CON’T) Compound Statements Conditional if c then S 1 else S 2 if c then S Concatenation S 1 ; · · · ; S k Example: when c do S await c ; S Selection S 1 or · · · or S k while while c do S Example: loop forever do S while t do S 2-4 SPL (CON’T) Compound Statements (Con’t) Cooperation Statement : [ 1 : S 1 ; b 1 : | {z } process ] k · · · k [ k : S k ; b k : ]; b : S 1 , . . . , S k are parallel to one another interleaved execution. entry step : from to 1 , ‘ 2 , . . . , ‘ k , exit step : from c 1 , c 2 , . . . , c k to b . Block [ local declaration | {z } ; S ] local variable , . . . , variable : type where ϕ i |{z} y 1 = e 1 , . . . , y n = e n 2-5 SPL (CON’T) Basic types – boolean, integer, character, . . . Structured types – array, list, set, . . . Static variable initialization (variables get initialized at the start of the execution) 2-6 Programs P :: " declaration ; P 1 :: [ 1 : S 1 ; b 1 : ] k · · · k P k :: [ k : S k ; b k : ] # P 1 , . . . , P k are top-level processes Variables in P called program variables Declaration mode variable , . . . , variable | {z } program variables : type where ϕ i y y in (not modified) constraints on local initial values out ϕ 1 . . . ϕ n data-precondition of the program 2-7
Image of page 2
Channel Declaration synchronous channels (no buffering capacity) mode α 1 , α 2 , . . . , α n : channel of type asynchronous channels (unbounded buffering capacity) mode α 1 , α 2 , . . . , α n : channel [1 .. ] of type where ϕ i ϕ i is optional ϕ i = Λ (empty list) by default 2-8 Foundations for SPL Semantics Labels : S Label identifies statement S Equivalence Relation L between labels: For : [ 1 : S 1 ; . . . ; k : S k ] L 1 For : [ 1 : S 1 or . . . or k : S k ] L 1 L · · · ∼ L k For : [ local declaration ; 1 : S 1 ] L 1 2-9 Example: In Figure 0.1 0 L 1 2 L 3 L 5 Note: For : [ 1 : S 1 || . . . || k : S k ] 6∼ L 1 6∼ L 2 6∼ L . . .
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern