SLIDE 1
Introducing Safe Jumps in Esterel
Olivier Tardieu
SLIDE 2
- Schizophrenia and Reincarnation
- ;
Schizophrenia and Reincarnation
SLIDE 3 Efficient Reincarnation?
SLIDE 4 Non-instantaneous Goto Goto
SLIDE 5 Outline
– formal semantics – restrictions
– Automata – Schizophrenia
SLIDE 6 Syntax
- nothing
- pause
- p; q
- p || q
- loop p end
- signal S in p end
- – emit S
– present S then p else q end
SLIDE 7 Logical Semantics
p, E → p’, E’
p ⇒ p’ ⇒ • iff
- p = program
- E = inputs + outputs
- b = terminates?
- p’ = residual
- E’ = outputs
- p, I∪O → p’, O
- p’, I’∪O’ → p’’, O’
b O O’ I I’
SLIDE 8 →
false
Rules – 1/2
→
true
→
false
→
false
→ ∪
b
→
true
→
b
→ → ∪
b∧b’ b
→
b’
→
false
→
false
→
true
∈
SLIDE 9 Rules – 2/2
→
b
∪ →
b
∈ ∈ ∈ ∈ →
b
→
b
∉ ∉ ∉ ∉ →
b
→
b
∉ ∉ ∉ ∉ →
b
→
b
∈ ∈ ∈ ∈
SLIDE 10 → → → → → ∈
∈
→ → →
∈
SLIDE 11 Goto?
– gotolabel – pauselabel (pairwise distinct labels)
– Collect labels reached by the reaction – Compute residual by combining:
- initial statement
- with labels
p’ ≡ < p | L >
SLIDE 12 →
false
Labeled Logical Semantics
→
true
→
false
→
false
→ ∪
b
→ !
true
→
b
→ → ∪!∪!
b∧b’ b
→
b’
→
false
→
false
→
true
∈
Labeled Logical Semantics
→ →
true
→
false
→ !
false
→ !
false
→ ∪!∪!
b
→ !
true
→ !
b
→ ∪!∪!
b∧b’
→ !
b
→ !
b’
→ !
false
→ !
false
→
true
∈ →
false
SLIDE 13
Example – Part 1
"# # $ #→ # $ #"→ ## $ %&' $ ())*'+
SLIDE 14 State Semantics
– p, I∪O → p’, O – p’, I’∪O’ → p’’, O’
– p, I∪O → p’, O, L and p’ ≡ < p | L > – p’, I’∪O’ → p’’, O’, L’ and p’’ ≡ < p | L’ >
I I’ O O’
I’ O O’
SLIDE 15
Example – Part 2
"# # $ #→ #
,"# #- .,"# -# .,"# -# ., -# ."# #
SLIDE 16
Example – Part 3
" # # $ #→ # ,#-.# $ #"→ ## ,##-.,# #-.
SLIDE 17
State Expansion
$ ,-. $ , -. $ ,!-.,!- $ ,!-.,!∩!/0-,!∩!/0- $ ,!-.,!- $ ,!-.,!- !⊂!/0 $ ,!-.,!- !⊂!/0 $ ,!-.,!- !⊂!/0 $ ,!-.,!- !⊂!/0
SLIDE 18
Well-formedness – Part 1
'& '' $ 1 #2 1 #2 $ 1 #2 '& 3 $ 1 #2 # $ 1 #2 # $ 1 #2
SLIDE 19 Exclusive or Compatible Statements?
2 ; 3 4 || 5 6
EXCLUSIVE EXCLUSIVE COMPATIBLE
SLIDE 20 Well-formedness – Part 2
$ "*'&' 34' $ " 5*'& '34'&
6 77# ⇒ 77#
SLIDE 21 Summary
- A sound semantics of goto in Esterel
- Constraints
– non-instantaneity ⇒ no (causality) cycles – well-formedness ⇒ preserve Esterel semantics
SLIDE 22 Automata
#
#
1 2 A B
':
SLIDE 23
- Schizophrenia and Reincarnation
- ;
SLIDE 24 To jump or not to jump?
;
SLIDE 25
Algorithms
$
6 */ 0. */0*/0
$
6 */ 0. '/0*/0 6 '/0. 6 '/ 0.'/0 6 '/0.'/0'4 6 '/0.'/0'/0)
SLIDE 27 Multiple Reincarnation – No Goto
<
<
<
<
;
2n !!!
; <
SLIDE 28 Multiple Reincarnation – Goto
<
<
<
<
;
n2 !!!
SLIDE 29 Conclusion
- Introduction of safe jumps in Esterel
- A preprocessor for schizophrenia
– get rid of schizophrenia using ‘‘goto’’ – simple, efficient, extends to full Esterel
If you do not understand schizophrenia, that is OK, because you no longer have to!