skip to main content
10.1145/1134650.1134670acmconferencesArticle/Chapter ViewAbstractPublication PagescpsweekConference Proceedingsconference-collections
Article

Generating optimized code from SCR specifications

Published:14 June 2006Publication History

ABSTRACT

A promising trend in software development is the increasing adoption of model-driven design. In this approach, a developer first constructs an abstract model of the required program behavior in a language, such as Statecharts or Stateflow, and then uses a code generator to automatically transform the model into an executable program. This approach has many advantages---typically, a model is not only more concise than code and hence more understandable, it is also more amenable to mechanized analysis. Moreover, automatic generation of code from a model usually produces code with fewer errors than hand-crafted code.One serious problem, however, is that a code generator may produce inefficient code. To address this problem, this paper describes a method for generating efficient code from SCR (Software Cost Reduction) specifications. While the SCR tabular notation and tools have been used successfully to specify, simulate, and verify numerous embedded systems, until now SCR has lacked an automated method for generating optimized code. This paper describes an efficient method for automatic code generation from SCR specifications, together with an implementation and an experimental evaluation. The method first synthesizes an execution-flow graph from the specification, then applies three optimizations to the graph, namely, input slicing, simplification, and output slicing, and then automatically generates code from the optimized graph. Experiments on seven benchmarks demonstrate that the method produces significant performance improvements in code generated from large specifications. Moreover, code generation is relatively fast, and the code produced is relatively compact.

References

  1. R. Alur, F. Ivancic, J. Kim, I. Lee, and O. Sokolsky. Generating embedded software from hierarchical hybrid models. SIGPLAN Not., 38(7):171--182, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. M. Archer. TAME: Using PVS strategies for special-purpose theorem proving. Annals of Mathematics and Artificial Intelligence, 29(1-4), February 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Archer. Basing a modeling environment on a general purpose theorem prover. In Proc. Monterey Workshop on Software Engineering Tools: Compatibility and Integration, Baden, Austria, October 4-6 2004.]]Google ScholarGoogle Scholar
  4. R. Bharadwaj and S. Sims. Salsa: Combining constraint solvers with BDDs for automatic invariant checking. In Proc. Tools and Algorithms for the Construction and Analysis of Systems (TACAS 2000), Berlin, Mar. 2000.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. S. Easterbrook, R. Lutz, R. Covington, Y. Ampo, and D. Hamilton. Experiences using lightweight formal methods for requirements modeling. IEEE Trans. on Software Engineering, 24(1), Jan. 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. A. Edwards. An Esterel compiler for large control-dominated systems. Transactions on Computer-Aided Design of Integrated Circuits and Systems, 21(2):169--183, February 2002.]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. R. Faulk, L. Finneran, J. Kirby, Jr., S. Shah, and J. Sutton. Experience applying the CoRE method to the Lockheed C-130J. In Proc. 9th Annual Conf. on Computer Assurance (COMPASS '94), Gaithersburg, MD, June 1994.]]Google ScholarGoogle Scholar
  8. F. Gaucher. Slicing LUSTRE programs. Technical report, VERIMAG, Grenoble, February 2003.]]Google ScholarGoogle Scholar
  9. N. Halbwachs, P. Raymond, and C. Ratel. Generating efficient code from data-flow programs. In Third International Symposium on Programming Language Implementation and Logic Programming, Passau (Germany), August 1991.]]Google ScholarGoogle ScholarCross RefCross Ref
  10. C. Heitmeyer, M. Archer, R. Bharadwaj, and R. Jeffords. Tools for constructing requirements specifications: The SCR toolset at the age of ten. International Journal of Computer Systems Science and Engineering, 20(1):19--35, Jan. 2005.]]Google ScholarGoogle Scholar
  11. C. Heitmeyer, J. Kirby, B. Labaw, M. Archer, and R. Bharadwaj. Using abstraction and model checking to detect safety violations in requirements specifications. IEEE Trans. on Softw. Eng., 24(11), Nov. 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Heitmeyer, J. Kirby, Jr., B. Labaw, and R. Bharadwaj. SCR*: A toolset for specifying and analyzing software requirements. In Proc. Computer-Aided Verification, 10th Annual Conf. (CAV'98), Vancouver, Canada, 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. C. L. Heitmeyer, R. D. Jeffords, and B. G. Labaw. Automated consistency checking of requirements specifications. ACM Trans. on Software Eng. and Methodology, 5(3):231--261, April--June 1996.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. K. Heninger, D. L. Parnas, J. E. Shore, and J. W. Kallander. Software requirements for the A-7E aircraft. Technical Report 3876, NRL, Wash., DC, 1978.]]Google ScholarGoogle Scholar
  15. R. Jeffords and C. Heitmeyer. Automatic generation of state invariants from requirements specifications. In Proc. Sixth ACM SIGSOFT Symp. on Foundations of Software Engineering, Nov. 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. R. Jeffords and E. Leonard. Using invariants to optimize formal specifications before code synthesis. In Proc. Second ACM and IEEE International Conference on Formal Methods and Models for Co-Design (MEMOCODE 2004), June 2004.]]Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. R. D. Jeffords and C. L. Heitmeyer. An algorithm for strengthening state invariants generated from requirements specifications. In Proc. of the Fifth IEEE Int'l Symp. on Requirements Eng., Aug. 2001.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. J. Kirby, Jr., M. Archer, and C. Heitmeyer. SCR: A practical approach to building a high assurance COMSEC system. In Proceedings of the 15th Annual Computer Security Applications Conference (ACSAC '99). IEEE Computer Society Press, Dec. 1999.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. A. R. Kulkarni and S. Ramesh. Static slicing of reactive programs. In SCAM, pages 98--107, 2003.]]Google ScholarGoogle ScholarCross RefCross Ref
  20. L. Lafave and J. P. Gallagher. Constraint-based partial evaluation of rewriting-based functional logic programs. In LOPSTR '97: Proc. of the 7th International Workshop on Logic Programming Synthesis and Transformation, pages 168--188, London, UK, 1998. Springer-Verlag.]]Google ScholarGoogle ScholarCross RefCross Ref
  21. E. I. Leonard and C. L. Heitmeyer. Program synthesis from formal requirements specifications using APTS. Higher Order Symbol. Comput., 16(1-2):63--92, 2003.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. S. Miller. Specifying the mode logic of a flight guidance system in CoRE and SCR. In Proc. 2nd ACM Workshop on Formal Methods in Software Practice (FMSP'98), 1998.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. L. Parnas, G. Asmis, and J. Madey. Assessment of safety-critical software in nuclear power plants. Nuclear Safety, 32(2), 1991.]]Google ScholarGoogle Scholar
  24. G. Ramalingam and T. Reps. A categorized bibliography on incremental computation. In POPL '93: Proc. of the 20th ACM SIGPLAN-SIGACT symposium on Principles of Programming Languages, pages 502--510, New York, NY, USA, 1993. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. T. W. Reps and T. Turnidge. Program specialization via program slicing. In Selected Papers from the International Seminar on Partial Evaluation, pages 409--429, London, UK, 1996. Springer-Verlag.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. J. A. Tauber, N. A. Lynch, and M. J. Tsai. Compiling IOA without global synchronization. In NCA '04: Proc. of the Network Computing and Applications, Third IEEE Int'l Symp. on (NCA'04), pages 121--130, Washington, DC, USA, 2004. IEEE Computer Society.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. F. Tip. A survey of program slicing techniques. Technical report, Amsterdam, The Netherlands, The Netherlands, 1994.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. M. W. Whalen. High-integrity code generation for state-based formalisms. In ICSE '00: Proc. of the 22nd Int'l Conf. on Software Eng., pages 725--727, New York, NY, USA, 2000. ACM Press.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Recommendations

Comments

Login options

Check if you have access through your login credentials or your institution to get full access on this article.

Sign in
  • Published in

    cover image ACM Conferences
    LCTES '06: Proceedings of the 2006 ACM SIGPLAN/SIGBED conference on Language, compilers, and tool support for embedded systems
    June 2006
    220 pages
    ISBN:159593362X
    DOI:10.1145/1134650
    • cover image ACM SIGPLAN Notices
      ACM SIGPLAN Notices  Volume 41, Issue 7
      Proceedings of the 2006 LCTES Conference
      July 2006
      208 pages
      ISSN:0362-1340
      EISSN:1558-1160
      DOI:10.1145/1159974
      Issue’s Table of Contents

    Copyright © 2006 ACM

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 14 June 2006

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • Article

    Acceptance Rates

    Overall Acceptance Rate116of438submissions,26%

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader
About Cookies On This Site

We use cookies to ensure that we give you the best experience on our website.

Learn more

Got it!