A Debugging Scheme for Declarative Equation Based Modeling Languages

  • Peter Bunus
  • Peter Fritzson
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2257)


This paper concerns the static analysis for debugging purposes of programs written in declarative equation based modeling languages. We first give an introduction to declarative equation based languages and the consequences equation based programming has for debugging. At the same time, we examine the particular debugging problems posed by Modelica, a declarative equation based modeling language. A brief overview of the Modelica language is also given. We also present our view of the issues and solutions based on a proposed framework for debugging declarative equation based languages. Program analysis solutions for program understanding and for static debugging of declarative equation based languages, based on bipartite graph decomposition, are presented in the paper. We also present an efficient way to annotate the underlying equations in order to help the implemented debugger to eliminate the heuristics involved in choosing the right error fixing solution. This also provides means to report the location of an error caught by the static analyzer or by the numeric solver, consistent with the user’s perception of the source code and simulation model.


Declarative equation based language modeling languages bipartite graphs graph decomposition techniques static analysis debugging Modelica 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Abadi M., and Cardelli: A Theory of Objects. Springer Verlag, ISBN 0-387-94775-2, 1996.Google Scholar
  2. 2.
    Ait-Aoudia, S.; Jegou, R. and Michelucci, D. “Reduction of Constraint Systems.” In Compugraphic, pages 83–92, Alvor, Portugal, 1993.Google Scholar
  3. 3.
    Asratian A. S.; Denley T. and Häggkvist R. Bipartite Graphs and their Applications. Cambridge University Press 1998.Google Scholar
  4. 4.
    Bliek, C.; Neveu, B. and Trombettoni G. “Using Graph Decomposition for Solving Continuous CSPs”, Priciples and Practice of Constraint Programming, CP’98, Springer LNCS 1520, pages 102–116, Pisa, Italy, November 1998.Google Scholar
  5. 5.
    Dolan A. and Aldous J. Networks and algorithms-An introductory approach. John Wiley and Sons 1993En gland.Google Scholar
  6. 6.
    Dulmage, A. L., Mendelsohn, N. S. Coverings of bipartite graphs, Canadian J. Math., 10, 517–534.Google Scholar
  7. 7.
    Elmqvist, H.; Mattsson S.E and Otter, M. “Modelica-A Language for Physical System Modeling, Visualization and Interaction.” In Proceedings of the 1999 IEEE Symposium on Computer-Aided Control System Design (Hawaii, Aug. 22-27) 1999.Google Scholar
  8. 8.
    Elmqvist, H. A Structured Model Language for Large Continuous Systems. PhD thesis TFRT-1015, Department of Automatic Control, Lund Institute of Technology, Lund, Sweden. 1978.Google Scholar
  9. 9.
    Flannery, L. M. and Gonzalez, A. J. DetectingA nomalies in Constraint-based Systems, Engineering Applications of Artificial Intelligence, Vol. 10, No. 3, June 1997, pages. 257–268.CrossRefGoogle Scholar
  10. 10.
    Fritzson, P. and Engelson, V. “Modelica-A Unified Object-Oriented Language for System Modeling and Simulation.” In Proceedings of the 12th European Conference on Object-Oriented Programming (ECOOP’98, Brussels, Belgium, Jul. 20-24), 1998.Google Scholar
  11. 11.
    Fritzson, P.; Shahmehri, N.; Kamkar, M. and Gyimothy, T. Generalized algorithmic debugging and testing. ACM Letters on Programming Languages and Systems, 1(4):303–322, December 1992.CrossRefGoogle Scholar
  12. 12.
    Harrold, M.J and Rothermel, G. “A Coherent Family of Analyzable Graphical Representations for Object-Oriented Software.” Technical Report OSU-CISRC-11/96-TR60, November, 1996, Department of Computer and Information Science Ohio State UniversityGoogle Scholar
  13. 13.
    Hopcroft, J. E. and Karp, R. M. An n 5/2 algorithm for maximum matchings in bipartite graphs. SIAM Journal of Computing, 2(4):225–231, December 1973.zbMATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    Jirstrand, M. “MathModelica-A Full System Simulation Tool”. In Proceedings of Modelica Workshop 2000 (Lund, Sweden, Oct. 23-24), 2000.Google Scholar
  15. 15.
    Jirstrand, M.; Gunnarsson J. and Fritzson P. “MathModelica-a new modeling and simulation environment for Modelica. ” In Proceedings of the Third International Mathematica Symposium (IMS’99, Linz, Austria, Aug), 1999.Google Scholar
  16. 16.
    Maffezzoni C.; Girelli R. and Lluka P. Generatinge. cient computational procedures from declarative models. Simulation Practice and Theory 4 (1996) pages 303–317.CrossRefGoogle Scholar
  17. 17.
    Modelica Association. Modelica-A Unified Object-Oriented Language for Physical Systems Modeling-Tutorial and Design Rationale Version 1.4 (December 15, 2000).Google Scholar
  18. 18.
    Modelica Association. Modelica-A Unified Object-Oriented Language for Physical Systems Modeling-Language Specification Version 1.4. (December 15, 2000).Google Scholar
  19. 19.
    Pantelides, C. The consistent initialization of differentialalgebraic systems. SIAM Journal on Scientific and Statistical Computing, 9(2):213–231, March 1988.zbMATHCrossRefMathSciNetGoogle Scholar
  20. 20.
    Saldamli, L.; Fritzson, P. “Object-oriented Modeling With Partial Differential Equations”. In Proceedings of Modelica Workshop 2000 (Lund, Sweden, Oct. 23-24), 2000.Google Scholar
  21. 21.
    Shapiro Ehud Y. Algorithmic Program Debugging. MIT Press (May). 1982.Google Scholar
  22. 22.
    Tiller M. Michael. Introduction to Physical Modelingwi th Modelica. Kluwer Academic Publisher 2001.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2002

Authors and Affiliations

  • Peter Bunus
    • 1
  • Peter Fritzson
    • 1
  1. 1.Department of Computer and Information ScienceLinköping UniversityLinköpingSweden

Personalised recommendations