On efficient program synthesis from statecharts

  • Authors:
  • Andrzej Wasowski

  • Affiliations:
  • IT University of Copenhagen, Copenhagen NV, Denmark

  • Venue:
  • Proceedings of the 2003 ACM SIGPLAN conference on Language, compiler, and tool for embedded systems
  • Year:
  • 2003

Quantified Score

Hi-index 0.00

Visualization

Abstract

Program synthesis from hierarchical state diagrams has for long been discussed in various communities. My aim is to provide an efficient, lightweight code generation scheme suitable for resource constrained microcontrollers.I describe an initial implementation of SCOPE---a hierarchical code generator for a variant of the statechart language. I shall discuss several techniques implemented in the tool, namely imposing and exploiting a regular hierarchy structure, labeling schemes for fast ancestor queries, improvements in exiting states, compile-time scope resolution for transitions, and various details of compact runtime representation.The resulting algorithm avoids the exponential code growth exhibited by tools based on flattening of hierarchical state machine. At the same time it demonstrates that it is possible to maintain reasonable speed and size results even for small models, while preserving the hierarchy at runtime. SCOPE currently produces code that is comparable with that of industrial tools (IAR visualSTATE) for small models and clearly wins for bigger ones.