SPL (Simple Programming Language)

Temporal Verification of Reactive Systems: Safety

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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: cs256-announce@lists.stanford.edu 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 > → 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 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 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...
View Full Document

This document was uploaded on 01/31/2008.

Page1 / 10

SPL (Simple Programming Language) - CS256/Winter 2007 —...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online