1 / 38

A Mystery

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!. Motivation. Esterel

lalasa
Download Presentation

A Mystery

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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!

  2. 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:

  3. 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

  4. 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

  5. Outline • Esterel • Synchronous Reactive Language • Syntax and Formal Semantics • Causality and Instantaneous Loops • Schizophrenia • Conclusion

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

  7. Asynchronous Synchronous Synchronous Concurrency • Parallel composition • Master clock • Instantaneous • broadcast of signals • reaction to presence and absence of signals ) deterministic concurrency

  8. Example • pause • local signal declaration • signal emission • test • loop • parallel composition • sequence

  9. Syntax wait for the next tick (in the document)

  10. Non-Reactive Programs • signals • loops INCORRECT INCORRECT

  11. Operational Semantics

  12. Inputs and Outputs

  13. Sequence and Concurrency

  14. Deduction Trees

  15. Loops and Local Signals

  16. Example: Present Signal

  17. Outline • Esterel • Causality and Instantaneous Loops • Deterministic Semantics • Instantaneous Loop Detection • Schizophrenia • Conclusion

  18. Instantaneous Loops - Causality

  19. Instantaneous Loops - Causality [Gonthier88] Instantaneous Loop Causality

  20. Non-Determinism INCORRECT

  21. A Deterministic Semantics [Berry96] Logical Semantics Deterministic Semantics Constructive Semantics 1 1 1 0 0 0 2 2 0 0 1 1 0

  22. Determinism + Explicit Errors

  23. Determinism + Explicit Errors

  24. Determinism + Explicit Errors A better semantics • correct programs: unchanged • incorrect programs: more easily handled • distinguishes causality errors and instantaneous loops + error propagation

  25. Instantaneous Loop Detection

  26. Outline • Esterel • Causality and Instantaneous Loops • Schizophrenia • Example and Definition • Diagnosis and Cure • Conclusion

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

  28. Defining Schizophrenia * * * 2 1

  29. Diagnosing Schizophrenia

  30. Curing Schizophrenia ) Recursively replicate loop bodies [Mignard94]

  31. Curing Schizophrenia )

  32. Curing Schizophrenia ) Unfolding using non-instantaneous gotopause

  33. 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

  34. Implementation

  35. 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) Conclusion (SAS’03) (MEMOCODE’04) (SOS’04) (SLAP’04) PROOFS IMPLEMENTATION

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

More Related