Presentation is loading. Please wait.

Presentation is loading. Please wait.

A Mystery Esterel –small no type inference, subtyping, … no recursion, functions, … no pointers, malloc, GC, … no complex data structures, libraries,

Similar presentations


Presentation on theme: "A Mystery Esterel –small no type inference, subtyping, … no recursion, functions, … no pointers, malloc, GC, … no complex data structures, libraries,"— Presentation transcript:

1

2 A Mystery Esterel –small no type inference, subtyping, … no recursion, functions, … no pointers, malloc, GC, … no complex data structures, libraries, … … –formal semantics [Berry&Cosserat84,Gonthier88] ) compiling Esterel is easy well…no!

3 Motivation Esterel –small kernel language + formal semantics –for embedded/real-time/safety-critical designs –compiled into C code, automata, digital circuits, VHDL… Mathematically certified compiler? –YES [Schneider04] for correct programs for circuit synthesis for non-optimized circuits let’s check correctness let’s think generic let’s aim at performance ) but:

4 Why Loops? Synchronous loops impact –correctness:instantaneous loops –performance:schizophrenia  Specify code generation for loops –check correctness –achieve performance –generic (independent from target language) –amenable to certification

5 A Key to Many Improvements Compiler Semantics –better understanding of determinism + errors Language –new construct: higher expressivity + lower complexity Proofs –easier proofs + collection of proof techniques

6 Outline Esterel –Synchronous Reactive Language –Syntax and Formal Semantics Causality and Instantaneous Loops Schizophrenia Conclusion

7 Reactive Approach 0-delay abstraction ) reactions Clock-triggered ) instants time input output input Event-driven tick time inputs outputs Reactive

8 Synchronous Concurrency Parallel composition Master clock Instantaneous –broadcast of signals –reaction to presence and absence of signals ) deterministic concurrency Asynchronous Synchronous

9 Example pause local signal declaration signal emission test loop parallel composition sequence

10 Syntax (in the document) wait for the next tick

11 Non-Reactive Programs signals loops INCORRECT

12 Operational Semantics

13 Inputs and Outputs

14 Sequence and Concurrency

15 Deduction Trees

16 Loops and Local Signals

17 Example: Present Signal

18 Outline Esterel Causality and Instantaneous Loops –Deterministic Semantics –Instantaneous Loop Detection Schizophrenia Conclusion

19 Instantaneous Loops - Causality

20 Causality Instantaneous Loop [Gonthier88]

21 Non-Determinism INCORRECT

22 22 A Deterministic Semantics Deterministic Semantics Logical Semantics 1 0 1 1 0 0 1 Constructive Semantics 0 1 0 0 [Berry96]

23 Determinism + Explicit Errors

24

25 + error propagation A better semantics –correct programs: unchanged –incorrect programs: more easily handled –distinguishes causality errors and instantaneous loops

26 Instantaneous Loop Detection

27 Outline Esterel Causality and Instantaneous Loops Schizophrenia –Example and Definition –Diagnosis and Cure Conclusion

28 Schizophrenia Are these programs equivalent? NO How shall we define, diagnose, and cure schizophrenia? YES [Berry92]

29 Defining Schizophrenia 1 2 * * *

30 Diagnosing Schizophrenia

31 Curing Schizophrenia ) Recursively replicate loop bodies [Mignard94]

32 Curing Schizophrenia )

33 ) Unfolding using non-instantaneous gotopause

34 And then… Extend Esterel with “gotopause” Specify the cure –proving it preserves the semantics –proving it cures schizophrenia Combine diagnosis and cure –to achieve performance Extend the algorithm to full Esterel

35 Implementation initial size (statements) quadratic rewriting quasi-linear rewriting abro141814 P18288658 tcint403725418 wristwatch432833439 atds1008901372990 cabine7644676808020 globalopt1028656658516867

36 Conclusion Loops –Instantaneous Loop Detection –Schizophrenia generic + efficient Better Language –Deterministic Semantics –gotopause makes compiling Esterel much easier (because of schizophrenia) makes compiling to Esterel much easier (ex: SyncCharts [And95]) makes optimizations much easier (source-to-source transformation) (SAS’03) (MEMOCODE’04) (SOS’04) (SLAP’04) PROOFSIMPLEMENTATION

37 Future Work Mechanize proofs Consider constructive causality Apply gotopause to more optimizations… Make gotopause available Dynamic well-formedness? Semantics of signals?

38


Download ppt "A Mystery Esterel –small no type inference, subtyping, … no recursion, functions, … no pointers, malloc, GC, … no complex data structures, libraries,"

Similar presentations


Ads by Google