1 Semantics Q1 2007 S EMANTICS (Q1,’07) Week 5 Jacob Andersen PhD student

Slides:



Advertisements
Similar presentations
Process Algebra Book: Chapter 8. The Main Issue Q: When are two models equivalent? A: When they satisfy different properties. Q: Does this mean that the.
Advertisements

Semantics Static semantics Dynamic semantics attribute grammars
- Vasvi Kakkad.  Formal -  Tool for mathematical analysis of language  Method for precisely designing language  Well formed model for describing and.
8. Introduction to Denotational Semantics. © O. Nierstrasz PS — Denotational Semantics 8.2 Roadmap Overview:  Syntax and Semantics  Semantics of Expressions.
Programming Paradigms for Concurrency Lecture 11 Part III – Message Passing Concurrency TexPoint fonts used in EMF. Read the TexPoint manual before you.
Semantics Q S EMANTICS (Q1,’07) Week 1 Jacob Andersen PhD student
ISBN Chapter 3 Describing Syntax and Semantics.
Course on Probabilistic Methods in Concurrency (Concurrent Languages for Probabilistic Asynchronous Communication) Lecture 1 The pi-calculus and the asynchronous.
CPSC 668Set 14: Simulations1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
C LAUS B RABRAND © C ONCURRENCY (Q3,’06) J AN 19, 2006 C ONCURRENCY Claus Brabrand [ ]
A Semantic Characterization of Unbounded-Nondeterministic Abstract State Machines Andreas Glausch and Wolfgang Reisig 1.
C. Varela; Adapted w/permission from S. Haridi and P. Van Roy1 Declarative Computation Model Defining practical programming languages Carlos Varela RPI.
1 Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications.
1 Semantics Q S EMANTICS (Q1,’07) Week 6 Jacob Andersen PhD student
1 Ivan Lanese Computer Science Department University of Bologna Roberto Bruni Computer Science Department University of Pisa A mobile calculus with parametric.
C LAUS B RABRAND S EMANTICS (Q1,’06) S EP 28, 2006 C LAUS B RABRAND © , University of Aarhus [ ] [
C LAUS B RABRAND S EMANTICS (Q1,’05) S EP 8, 2005 C LAUS B RABRAND © 2005, University of Aarhus [ ] [
CS 330 Programming Languages 09 / 18 / 2007 Instructor: Michael Eckmann.
C LAUS B RABRAND S EMANTICS (Q1,’06) O CT 06, 2006 C LAUS B RABRAND © , University of Aarhus [ ] [
C LAUS B RABRAND C ONCURRENCY (Q3,’06) M AR 13, 2006 C LAUS B RABRAND © 2005, University of Aarhus [ ] [
1 Semantics Q S EMANTICS (Q1,’07) Week 2 Jacob Andersen PhD student
1 Semantics Q S EMANTICS (Q1,’07) Week 3 Jacob Andersen PhD student
Programming Language Semantics Mooly SagivEran Yahav Schrirber 317Open space html://
C LAUS B RABRAND © S EMANTICS (Q1,’06) A UG 31, 2006 C LAUS B RABRAND © 2005–2006, University of Aarhus [ ] [
C LAUS B RABRAND S EMANTICS (Q1,’05) S EP 29, 2005 C LAUS B RABRAND © 2005, University of Aarhus [ ] [
C LAUS B RABRAND S EMANTICS (Q1,’05) O CT 06, 2005 C LAUS B RABRAND © 2005, University of Aarhus [ ] [
1 Ivan Lanese Computer Science Department University of Bologna Italy Concurrent and located synchronizations in π-calculus.
C LAUS B RABRAND S EMANTICS (Q1,’06) S EP 14, 2006 C LAUS B RABRAND © , University of Aarhus [ ] [
1 Semantics Q S EMANTICS (Q1,’07) Week 4 Jacob Andersen PhD student
Semantics with Applications Mooly Sagiv Schrirber html:// Textbooks:Winskel The.
CSE S. Tanimoto Syntax and Types 1 Representation, Syntax, Paradigms, Types Representation Formal Syntax Paradigms Data Types Type Inference.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Describing Syntax and Semantics
C LAUS B RABRAND S EMANTICS (Q1,’06) S EP 21, 2006 C LAUS B RABRAND © , University of Aarhus [ ] [
C LAUS B RABRAND S EMANTICS (Q1,’05) S EP 22, 2005 C LAUS B RABRAND © 2005, University of Aarhus [ ] [
C LAUS B RABRAND © S EMANTICS (Q1,’05) S EP 1, 2005 C LAUS B RABRAND © 2005, University of Aarhus [ ] [
CSE 341, S. Tanimoto Concepts 1- 1 Programming Language Concepts Formal Syntax Paradigms Data Types Polymorphism.
Benjamin Gamble. What is Time?  Can mean many different things to a computer Dynamic Equation Variable System State 2.
SDS Foil no 1 Process Algebra Process Algebra – calculating with behaviours.
Advanced Topics in SE Spring Process Algebra Hossein Hojjat Formal Methods Lab University of Tehran.
Reactive systems – general
2G1516 Formal Methods2005 Mads Dam IMIT, KTH 1 CCS: Operational Semantics And Process Algebra Mads Dam Reading: Peled 8.3, 8.4, 8.6 – rest of ch. 8.
CS5204 – Operating Systems 1  -Calculus Reasoning about concurrency and communication (Part 1).
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
CS 363 Comparative Programming Languages Semantics.
Internet Security CSCE 813 Communicating Sequential Processes.
11/19/20151 Metodi formali nello sviluppo software a.a.2013/2014 Prof.Anna Labella.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Chapter 3 Part II Describing Syntax and Semantics.
Semantics In Text: Chapter 3.
Laws of concurrent design Tony Hoare Microsoft ResearchCambridge FMCAD October.
CS 5204 Spring 99 1 A Simple Agent A CCS agent is described both by a structural diagram and one or more algebraic equations. The diagram is for readability.
1 / 48 Formal a Language Theory and Describing Semantics Principles of Programming Languages 4.
Week 04 Object Oriented Analysis and Designing. What is a model? A model is quicker and easier to build A model can be used in simulations, to learn more.
Operational Semantics Mooly Sagiv Tel Aviv University Textbook: Semantics with Applications Chapter.
CIS 540 Principles of Embedded Computation Spring Instructor: Rajeev Alur
Model Checking Lecture 1. Model checking, narrowly interpreted: Decision procedures for checking if a given Kripke structure is a model for a given formula.
Software Systems Verification and Validation Laboratory Assignment 4 Model checking Assignment date: Lab 4 Delivery date: Lab 4, 5.
Operational Semantics Mooly Sagiv Tel Aviv University Sunday Scrieber 8 Monday Schrieber.
Process Algebra (2IF45) Basic Process Algebra Dr. Suzana Andova.
Overview of Compilation Prepared by Manuel E. Bermúdez, Ph.D. Associate Professor University of Florida Programming Language Principles Lecture 2.
Model Checking Lecture 1: Specification Tom Henzinger.
1 Theoretical Foundations of Concurrency A formal study of concurrency enables: understanding the essential nature of concurrency reasoning about the behavior.
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Operational Semantics Mooly Sagiv Reference: Semantics with Applications Chapter 2 H. Nielson and F. Nielson
Describing Syntax and Semantics
Representation, Syntax, Paradigms, Types
Representation, Syntax, Paradigms, Types
Representation, Syntax, Paradigms, Types
Representation, Syntax, Paradigms, Types
Presentation transcript:

1 Semantics Q S EMANTICS (Q1,’07) Week 5 Jacob Andersen PhD student

2 Semantics Q News… Exam Date & Time (Preliminary): –Wednesday October 31 st 9.00 – Page on CCS tools.

3 Semantics Q Outline Type Checking (from last week) Concurrency vs. Sequentiality CCS: "Calculus of Communicating Systems" By-example (one construction at a time) Syntax of CCS 7 linguistic constructions(!) Semantics of CCS 1 page(!) Describing processes with CCS CCS tools

4 Semantics Q T YPE C HECKING D EFINITIONS

5 Semantics Q Adding Boolean Variables: Let B ++ Consider language Let B ++: –Mixed Expressions ( e  Exp): –Definitions (d  Def): –Note: The type of a var is now context dependent I.e. a context-free (grammar) approach will not suffice –Examples: ? ? … e ::= n | t | x | ~ e | e  e’ | e ? e’ : e” | let d in e d ::= nil |  x = e | d ; d’ | d and d’ | d in d’   { +, -, *, =, or } …where: x or tt x * x type definition (annotation)   { bool, int } …where:

6 Semantics Q Static Semantics: Let B ++ FV E, DV D and FV D as before …adding: We now need type environments: Type = { bool, int } Define static semantics (type checking rel’s): “ e has type  (given type environment  )” “ d yields type env.  (given type env.  )” FV E ( e ? e’: e” ) = FV E ( e )  FV E ( e’ )  FV E ( e” ) TEnv V = Var  Type  |- e :   |- d : 

7 Semantics Q Static Semantics (expressions) Expressions: [ NUM ] E  |- n : int  |- t : bool [ TVL ] E [ VAR ] E  |- x :  (x) [ VAR ] E  |- ~ e : bool  |- e : bool [ LET ] E  |- let d in e :   |- d :   [  ] |- e :  [ IFE ] E  |- e 0 ? e 1 : e 2 :   |- e 0 : bool  |- e 1 :  1  |- e 2 :  2  = 1 =2 = 1 =2 [ BOP ] E  |- e 0  e 1 : type  (  0,  1 )  |- e 0 :  0  |- e 1 :  1

8 Semantics Q Static Semantics (definitions) Definitions: [ NIL ] D  |- nil : [] [ DEF ] D  |-  x = e : [x  ]  |- e :  ’  = ’ = ’ [ SEQ ] D  |- d 0 ; d 1 :  0 [  1 ]  |- d 0 :  0  [  0 ] |- d 1 :  1 [ AND ] D  |- d 0 and d 1 :  0  1  |- d 0 :  0  |- d 1 :  1 [ IN ] D  |- d 0 in d 1 :  1  |- d 0 :  0  [  0 ] |- d 1 :  1 DV( d 0 )  DV( d 1 ) = Ø Note: combined environment Note: only last environment Note: disjoint environment Note: type check

9 Semantics Q Dynamic Semantics: Let B ++ Type Environment (Compile-time): Type = { bool, int } Environment (Runtime): Val = B  Z, B = { tt, ff } –Define type correspondence relation ‘~’: –Note:   TEnv = Var  Type   Env = Var  Val  ~    x  V:  ( x ) = bool   ( x )  B  ( x ) = int   ( x )  Z (  0 ~  0   1 ~  1 )   0 [  1 ] ~  0 [  1 ]

10 Semantics Q Exp. Transition System for Let B ++ Let++ Expression Configurations: Let B ++ Expression Configurations: –   Var  Type: Env  := »i.e., “only type corresponding runtime environments”  = { | |- wfe e } T = { | z  Z } only well-formed exps   = { |   Env    :  |- e :  } T  = { |   Env   r  B  Z } {   ( Var  B  Z ) |  ~  }

11 Semantics Q Def. Transition System for Let B ++ Let++ Definition Configurations: Let B ++ Definition Configurations: –   Var  Type: Env  := »i.e., “only type corresponding runtime environments”  V = { | |- wfd d } only well-formed defs T V = { }   = { |   Env    :  |- V d :  } T  = { |   Env  } {   ( Var  B  Z ) |  ~  }

12 Semantics Q Exp. Dynamic Semantics: Let B ++ SOS of Expressions for Let B ++: –E.g. [LET]: [ LET 2 ] [ LET 3 ] [ LET 1 ]   Env   |- let d in e   let d’ in e  |- d   d’  |- let  0 in r   r  |- let  0 in e   let  0 in e’  [  0 ] |- e   [  0] e’ 0 ~ 00 ~ 0

13 Semantics Q Def. Dynamic Semantics: Let B ++ SOS of Definitions for Let B ++: –E.g [SEQ]: [ SEQ 2 ] [ SEQ 3 ] [ SEQ 1 ]  |- d 0 ; d 1   d 0 ’ ; d 1  |- d 0   d 0 ’  |-  0 ;  1    0 [  1 ]  |-  0 ; d 1    0 ; d 1 ’  [  0 ] |- d 1   [  0] d 1 ’   Env  0 ~ 00 ~ 0

14 Semantics Q C ONCURRENCY VS. S EQUENTIALITY

15 Semantics Q Concurrency vs. Sequentiality Sequential programming: Describe computation as a “reduction” of expressions to values Inherently deterministic Termination often desirable Resulting value is of primary interest and focus Concurrent programming: Describe execution as “process evolution” Inherently non-deterministic Non-termination often desirable (Op.Sys., Control sys, Cell-phone, …) Describe possible executions (aka. execution traces) Describe possible interactions during execution Describe interaction with an environment Resulting “value” is not (necessarily) interesting

16 Semantics Q Concurrency is much Harder Harder than sequential programming: Huge number of possible executions Inherently non-deterministic Parallelism conceptually harder Consequences: Programs are harder to write! Programs are harder to debug! Errors are not always reproducible New kinds of errors possible: »Deadlock, starvation, priority inversion, interference, …

17 Semantics Q Concurrency Problems Therac-25 Radiation Therapy –’85-’87 Massive overdoses (6 deaths / amputations)! Mars Pathfinder –July ’97 Periodic resets (on mars)! Windows 95/98 w/ Device Drivers –late ’90es Dysfunction (“blue screen of death”)!

18 Semantics Q Concurrency Problems (cont’d) Mobile Phones –’00-… Freeze and odd behaviors (really annoying)! Cruise Control System Model –’86 [Grady Booch] Accellerated after car ignition (car crashes)! … 

19 Semantics Q Problem: System Development? In the presence of all these errors: deadlock, starvation, priority inversion, interference, anti-cooperation, un-intended execution traces, un-fairness, … How to…: 1. …design a system that “works” ? 2. …verify that the system is “safe” ? 3. …verify that the system “meets its specification” ? …and: What does “works”, “safe”, and “to meet a specification” mean ?!?

20 Semantics Q Solution: Modelling “Models come to the rescue”: Create models (~ architecture, bridge construction, …) Note: “Errors are much cheaper to commit in models than in implementations”

21 Semantics Q Dictionary: “ model ” In this course (we use): 3+4 : as in “Model-based design” (designing a model of a concurrent system) 12 : as in “Model-checking” (checking implementation against declarative (logic) specification) Main Entry: 1 mod·el Pronunciation: 'mä-d & l Function: noun Etymology: Middle French modelle, from Old Italian modello, from (assumed) Vulgar Latin modellus, from Latin modulus small measure, from modus 1 obsolete : a set of plans for a building 2 dialect British : COPY, IMAGE 3 : structural design 4 : a usually miniature representation of something; also : a pattern of something to be made 5 : an example for imitation or emulation 6 : a person or thing that serves as a pattern for an artist; especially : one who poses for an artist 7 : ARCHETYPE 8 : an organism whose appearance a mimic imitates 9 : one who is employed to display clothes or other merchandise : MANNEQUIN 10 a : a type or design of clothing / b : a type or design of product (as a car) 11 : a description or analogy used to help visualize something (as an atom) that cannot be directly observed 12 : a system of postulates, data, and inferences presented as a mathematical description of an entity or state of affairs 13 : VERSION Webster’s(“ model ”):

22 Semantics Q Modelling: Level of Abstraction Consider a client/server system: Extremely abstract (high level of abstraction): » Appropriate (level of abstraction) for … : » Extremely concrete (low level of abstraction): » Universe = event.Universe def NAND_Gate =... Transistor =... Accumulator = Client =... def Server = request.process.reply.Server Client = calc.request.wait.reply.Client Database =... higher level of abstraction def

23 Semantics Q Solution: Modelling “Models come to the rescue”: Create models (~ architecture, bridge construction, …) Formal modelling (e.g., CCS) permits: (Offline) Reasoning  understanding (Runtime) Testing  confidence (C-time) Property Verification  safety (C-time) Specification Verification  correctness “Never send a human to do a machine’s job” -- A.Smith (’99) auto- mate Note: “Errors are much cheaper to commit in models than in implementations”

24 Semantics Q Methodology: Model-based Design Design abstract model Decompose model Reason/Test/Verify model »individual parts and whole Recompose insights »make model safe Impl. concrete program concretize REAL PROBLEM SAFE MODEL SAFE PROGRAM abstract ? ? ? ? MODEL test reason verify

25 Semantics Q CCS: Why a Calculus (pl. Calculi) Compositional:  || »Break things into (several) smaller things Algebraic: , , … »Intuitive ideal (also eases automated verification) Syntactic: and … »Provide basis for programming languages P | QPQ big P + Q Q + P P | Q Q | P P  P’ P | Q  P’ | Q Q  Q’ P | Q  P | Q’ [ PAR 1 ] [ PAR 2 ]

26 Semantics Q Parallel- vs. Concurrent Programming Strategy: –Optimal strategy for a particular goal –Use available resources efficiently Safety: –Conceptually independent players –Control interaction and “rules” The Football Match Analogy: “An analogy that one can make is with football*; - the coach of the team is a parallel programmer while - the referee is a concurrent programmer” -- [P.Panangaden, ’96] The Referee (~ the concurrent programmer): -- Make sure what is happening is a soccer match The Trainer (~ the parallel programmer): -- Make sure my agents are performing “optimally” */ interpret appropriately on either side of the Atlantic

27 Semantics Q C ALCULUS OF C OMMUNICATING S YSTEMS CCS: Calculus of Communicating Systems [ Robin Milner, ’89 ]

28 Semantics Q Concurrency and Communication Concurrency: Parallel processes (construction ‘ P|Q ’) »Abstract away (physical) processors »Abstract away diff. in real- vs pseudo-parallelism Communication: Process synchronization (aka. hand-shaking) »Abstract away communication protocol »Abstract away actual values passed

29 Semantics Q Example: a process modelling a CS student: Interface: Process name: CS Input action(s):{ coke } Output action(s):{ coin, exercise } Behavior of the process described by a CCS program Process Interface exercise coin coke

30 Semantics Q The Inactive Process: “ 0 ” The inactive process: (aka. “the zero process” or “the nil process”) »Performs no action whatsoever! Note that it offers: »the prototypical behavior of a deadlocked process (that cannot proceed any further in its execution) Example: 0 0

31 Semantics Q Action Prefixing: “ .P ” Action Prefixing: Can perform action, , after which it behaves like process, P Example(s): Match: Complex match .P strike.0 take.strike.0

32 Semantics Q Named Process: “ K ” Named Process: Behaves just like the (statically named) process, K Example(s): K Match = strike.0 SingleCokeDisp = coin.coke.0 def

33 Semantics Q Recursive Processes Recursive Processes (though naming) Example: Expanding the definition we get: » Clock = tick.Clock def Clock = tick.Clock = tick.tick.Clock = tick.tick.tick. ….tick.Clock … …

34 Semantics Q Non-deterministic Choice: “ P+Q ” Non-deterministic choice: Non-deterministic choice between processes P and Q »Initially has the capabilities of both P and Q ; but performing an action from P, say, will pre-empt further execution of Q. Example: P+Q Disp = coin.(coke.Disp + sprite.Disp) def coke sprite or

35 Semantics Q Parallel Composition: “ P|Q ” Parallel Composition: Any independent interleavings of processes P and Q »Also: may communicate (hand-shake): process P using input action, a; process Q corresponding output action, a (or vice versa) Example: Student: Coke Machine: P|Q Stud = read.coin.coke.Stud def CokeM = coin.coke.CokeM def CokeM | Stud

36 Semantics Q Parallel Composition (cont’d) Stud | CokeM (Stud | CokeM) | Stud (Stud | CokeM) | CokeM StudCokeM [ > ] read coke coin coke

37 Semantics Q Restriction: “ P\a ” Restriction (private name): Behaves just like P, except cannot make a or a actions (except within P ) »Reminiscent of local variables (in private scope) Example: P\a (Stud | CokeM) \ coin \ coke ((Stud | CokeM) \ coin \ coke) | Stud

38 Semantics Q Action Relabelling: “ P[f] ” Action Relabelling: Behaves like P, except that actions are renamed according to action renaming function, f »Permits parameterized reuse of processes Examples: P[f] VendingMachine = coin.item.VendingMachine CokeMachine = VendingMachine[coke/item] MarsMachine = VendingMachine[mars/item] def Note: relabel inputs to inputs (and corresponding outputs to outputs) def

39 Semantics Q S YNTAX FOR CCS

40 Semantics Q Input, output (and internal) action Actions: Set of Channel Names (input) Set of Channel Co-Names (output) Special silent (invisible/internal) action tau Note: inputs and outputs are complementary: »Communication: hand-shake on a and a only (no values) Metavariables: a  A  a = a a  L = A  A   Act = L  {  }

41 Semantics Q CCS Syntax CCS Syntax: “0”// inaction “ .P ”// action prefix,   Act “ P+P ”// non-deterministic choice “ P|P ”// parallel composition “ P\L ”// restriction (private name), L ⊆ L “ P[f] ”// action relabelling “ K ”// process variable, K  K P ::= 0 | .P | P+P | P|P | P\L | P[f] | K K 1 = P 1, K 2 = P 2, … def  a: f(a) = f(a)  f(  ) =  f:Act  Act … where Note: restrictions on f

42 Semantics Q Alternative Syntax Alternative Syntax (that we will also use): –Parameterized sum:  i  I P i for P 0 + P 1 + … + P n –Inactive process (as empty sum):  i  Ø P i for 0 –Restriction (by element): P \ a for P \ {a}

43 Semantics Q Algebraic Operator Precedence 1. Restriction and relabelling “ P\L ” “ P[f] ” 2. Action prefixing “ .P ” 3. Parallel composition “ P|Q ” 4. Summation “ P+Q ” –Q: How is “ R+a.P|b.Q\L ” then to be read ? A: “ R+((a.P)|(b.(Q\L))) ” ! tightest

44 Semantics Q SOS FOR CCS

45 Semantics Q SOS for CCS Structural Operational Semantics: Q: why  (tau) in communication “ P|Q ” (instead of propagating a or a ) ?  ~ “the unobservable hand-shake” [ RES ] [ REL ] [ COM 1 ] [ COM 2 ] [ COM 3 ] [ ACT ] [ SUM j ][ CON ]

46 Semantics Q D ESCRIBING PROCESSES WITH CCS

47 Semantics Q Transition Diagram Transition Diagram: A visualization of a Labelled Transition System: »Configurations annotated with processes (e.g. ) »Transitions annotated with actions (e.g. ) a.0 | a.0 0 | a.0a.0 | 0 0 | 0 a a a a  a.0 | 0 a

48 Semantics Q Traces Definition: A “trace”, ω=[α 1,…, α k ]  Act* (k ≥ 0), of a process P is a sequence of actions such that the following sequence of configurations can be derived from P: A trace can be the empty sequence [] We use the constant ε ≝ [] traces(P): The set of all traces of P. The set of traces, traces(P), of a process P is ”closed under prefix”, i.e. if ω  traces(P) then this is also the case for any prefix of ω. P → P 1 → … → P k α1α1 α2α2 αkαk

49 Semantics Q Example: Traces traces( ) = {ε,a,a, ,aa,aa} For more complex traces use regular expressions a.0 | a.0 0 | a.0a.0 | 0 0 | 0 a a a a  a.0 | a.0

50 Semantics Q Example Derivation Assume: Consider: A = a.A (b.0|(A|a.0))[c/a]  ? def (b.0 | (A | a.0)) [c/a]  (b.0 | (A | a.0))  [ REL ] (A | a.0)  [ COM 2 ] A  a.A  [ COM 1 ] [ CON ] [ ACT ] A = a.A def c a a a a [ RES ] [ REL ] [ COM 1 ] [ COM 2 ][ COM 3 ] [ ACT ] [ SUM j ][ CON ] c (b.0 | (A | a.0)) [c/a] (b.0 | (A | a.0)) (A | a.0) A A

51 Semantics Q Example: Lock ("Mutual Exclusion") Example: ("mutex") Lock Q: How are the critical enters and exits related ? »A: never two enters without exit in between Mutex = (User | Lock) \ {acq,rel} User = acq.enter.exit.rel.User Lock = acq.rel.Lock def System = (User | Lock | User’) \ {acq,rel} def User’ = User[enter’/enter,exit’/exit] def // critical region aka. a "semaphore" acq rel Sema = p.v.Sema "Probeer te verlagen" (Dutch: try to decrease) "Verhoog" (Dutch: increase) E. Dijkstra Historically: Lock def

52 Semantics Q CCS T OOLS

53 Semantics Q Concurrency Workbench [ Concurrency Workbench ]Concurrency Workbench P   testing (interactive simulation)  verification (via logic formulae)  dump transition graph (NFA) ... [ ] [ /users/courses/dSem/bin/cwb ]

54 Semantics Q The Concurrency Workbench CWB: Recommendation: try it out (before the exam)! Command: input “PandQ.ccs”; Command: sim(P); // run the built-in simulator Command: output “P.graph”; // name output file Command: graph(P); // output for CCS visualizer and simulator Command: strongeq(P,Q); // strong bisimilarity CWB’s answer Command: eq(P,Q); // weak bisimilarity CWB’s answer

55 Semantics Q CCS Visualizer and Simulator [ CCS Visualizer and Simulator ]CCS Visualizer and Simulator [ ] [ /users/courses/dSem/bin/cv ] [ /users/courses/dSem/bin/tbgg ]

56 Semantics Q "Three minutes paper" Please spend three minutes writing down the most important things that you have learned today (now). After 1 day After 1 week After 3 weeks After 2 weeks Right away

57 Semantics Q Next week: Equivalences, Bisimulation, and Games Any Questions?