Presentation is loading. Please wait.

Presentation is loading. Please wait.

Temporal Logic Model- checking with SPIN COMP6004 Stéphane Lo Presti Part 3: The PROMELA Semantics.

Similar presentations


Presentation on theme: "Temporal Logic Model- checking with SPIN COMP6004 Stéphane Lo Presti Part 3: The PROMELA Semantics."— Presentation transcript:

1 Temporal Logic Model- checking with SPIN COMP6004 Stéphane Lo Presti splp@ecs.soton.ac.uk Part 3: The PROMELA Semantics

2 Last Lecture PROMELA Syntax  Process  Variables  Channels  Statements/Conditions

3 Semantics of PROMELA http://www.spinroot.com/spin/Man/Intro.html Operational model based on: Processes (Labelled transition Systems) Variables Channels Semantics engine

4 What is a semantics? FOLDOC: The meaning of a string in some language, as opposed to syntax which describes how symbols may be combined independent of their meaning. SPIN semantics is operational (i.e. execution) and not denotational (i.e. mathematical)

5 Semantics engine Derive from the PROMELA model a labelled transition system (LTS) “Executes” step by step the model  Check the executability of statements  select an executable statement  Apply the statement effects Until no statements (either no processes, or end-state)

6 Variables Defined by  Name  Scope  Domain  Initial value  Current value

7 Channels Defined by  ID  Number of slots  Contents, i.e. ordered set of messages (ordered set of variables)

8 Processes Defined by  ID  Local variables  Local states  Initial state  Current state  Transition relation

9 LTS (1) Transition  ID  Source and target local states  Boolean condition  Effect function  (special: unless statement, synchronous communication)

10 LTS (2) System state  Global variables  Local variables  Set of channels  Execution variables Exclusive Handshake Timeout Else Stutter

11 LTS (3) Initial system state  Processes in their initial state  Global variables at their initial values  Channels with empty contents  Execution variables are zero/ false

12 Overview of the SPIN algorithm (1) while ((E = executable(s)) != {}) {for some {p,t} from E {s’ = apply(t.effect,s) if (handshake == 0) {p.curstate = t.target s=s’ } else { E’= executable(s’) for some {p’,t’} from E’ {p.curstate = t.target s = apply(t’.effect,s’) p’.curstate = t’.target} handshake = 0 }}} while (stutter) {s = s }

13 Overview of the SPIN algorithm (2) Set executable(State s) { new Set E = {}; new Set e; timeout = False AllProcs: for each active process p {if (exclusive == 0 or exclusive == p.pid) {for u from high to low { e = {}; else = False OneProc:for each transition t in p.trans {if (t.source == p.curstate and t.prty == u and (handshake == 0 or handshake == t.rv) and eval(t.cond) == True) { add {p,t} to set e} } if (e != {}){break add all elements of e to E} else if (else == False) {else = True goto OneProc} } } } if (E == {} and exclusive != 0){exclusive = True goto AllProcs} if (E == {} and timeout == False){timeout = True goto AllProcs} return E}


Download ppt "Temporal Logic Model- checking with SPIN COMP6004 Stéphane Lo Presti Part 3: The PROMELA Semantics."

Similar presentations


Ads by Google