#EE382V/379K: Multicore Computing
##Agenda 0. Communicating Sequencer Processes 0. Temporal Logic
##Backus-Naur Form
- Developed to describe the Syntax of ALGOL
- Context-free grammar used describe the syntax of programming langauages.
- Example of a rule
<symbol> ::= __expression__
- Anything in
<
>
is a non-terminal, anything without angle brackets is terminal - Rules are complete when everything ends in a terminal command
- Tools like YACC (Yet Another Compiler Compiler) can produce a parser when you describe a language in a Analytical Grammar (similar to BNF)
This is not a comlete list of rules. Just a few rules
<command> ::= <simple command> | <structure command>
<simple command> ::= <null command> | <assignment command> | <input command> | <output command>
<structure command> ::= <alternative command> | <repetitive command> | <parallel command>
<null command> ::= skip
s(i : 1..100)::
*[
n: integer; s(i-1)? has(n) → s(0)! false
▯
[
n: integer;
s(i-1)? insert(n) →
*[
m: integer;
s(i-1)? has(m) →
[
m ≤ n → s(0)! (m=n)
▯
m > n → s(i+1)! has(m)
]
▯
m: integer; s(i-1)? insert(m) →
[
m < n → s(i+1)? insert(n);n := m;
▯
m = n → skip;
▯
m > n → s(i+1)! has(m)
]
]
]
]
x:: buffer(0..9) portion;
in,out:: integer;
in:= 0;
out:= 10;
// 0 ≤ out ≤ in ≤ out+10
*[
(in < out +10); producer ? buffer (in mod 10) → in := in + 1;
▯
out < in; consumemr? more () →
consumer ! buffer (out mod 10); out := out +1;
]
- Every atomic prop
p ∈ AP
is a CTL formula - If f1 and f2 are CTL formulas then so are
- ¬f1
- f1 ^ f2
- A x f1
- E x f1
- A[f1 ʋ f2]
- E[f1 ʋ f2]
Defined using M = (S, R, P)
- S: finite set of sets
- R: binary relation in S (R ⊆ S × S)
- P: S → 2AP