Debugging and Structural Analysis of Declarative Equation-Based Languages

A significant part of the software development effort is spent on detecting deviations between software implementations and specifications, and subsequently locating the sources of such errors. This thesis illustrates that is possible to identify a significant number of errors during static analysis of declarative object-oriented equation-based modeling languages that are typically used for system modeling and simulation. Detecting anomalies in the source code without actually solving the underlying system of equations provides a significant advantage: a modeling error can be corrected before trying to get the model compiled or embarking on a computationally expensive symbolic or numerical solution process. The overall objective of this work is to demonstrate that debugging based on static analysis techniques can considerably improve the error location and error correcting process when modeling with equation-based languages. A new method is proposed for debugging of over- and under-constrained systems of equations. The improved approach described in this thesis is to perform the debugging process on the flattened intermediate form of the source code and to use filtering criteria generated from program annotations and from the translation rules. Each time when an error is detected in the intermediate code and the error fixing solution is elaborated, the debugger queries for the original source code before presenting any information to the user. In this way, the user is exposed to the original language source code and not burdened with additional information from the translation process or required to inspect the intermediate code. We present the design and implementation of debugging kernel prototypes, tightly integrated with the core of the optimizer module of a Modelica compiler, including details of the novel framework required for automatic debugging of equation-based languages. This thesis establishes that structural static analysis performed on the underlying system of equations from object-oriented mathematical models can effectively be used to statically debug real Modelica programs. Most of our conclusions developed in this thesis are also valid for other equation-based modeling languages.

[1]  Jonas S. Karlsson A Scalable Data Structure for A Parallel Data Server , 1997 .

[2]  Peter Fritzson,et al.  GENERATING A MODELICA COMPILER FROM NATURAL SEMANTICS SPECIFICATIONS , 1998 .

[3]  Peter Fritzson,et al.  Extending Modelica for Partial Differential Equations , 2002 .

[4]  Per-Arne Persson Toward a grounded theory for support of command and control in military coalitions , 1997 .

[5]  Peter Fritzson,et al.  Generalized algorithmic debugging and testing , 1991, LOPL.

[6]  Paul Pop,et al.  Scheduling and Communication Synthesis for Distributed Real-Time Systems , 2000, DAC 2000.

[7]  Ernst Christen,et al.  Vhdl-ams---a hardware description language for analog and mixed-signal applications , 1999 .

[8]  Alan Borning,et al.  Classes versus Prototypes in Object-Oriented Languages , 1986, FJCC.

[9]  Eljas Soisalon-Soininen,et al.  On Finding the Strongly Connected Components in a Directed Graph , 1994, Inf. Process. Lett..

[10]  Vicente Rico-Ramirez Representation,analysis And Solution Of Conditional Models In An Equation-Based Environment , 1998 .

[11]  Peter Fritzson,et al.  Usability Criteria for Automated Debugging Systems , 1993, AADEBUG.

[12]  Joakim Eriksson Specifying and Managing Rules in an Active Real-Time Database System , 1998 .

[13]  Peter Frey,et al.  SEAMS: simulation environment for VHDL-AMS , 1998, 1998 Winter Simulation Conference. Proceedings (Cat. No.98CH36274).

[14]  Peter D. Holmes Using connectivity graphs to support map-related reasoning , 1991 .

[15]  Mariam Kamkar,et al.  Interprocedural dynamic slicing with applications to debugging and testing , 1993, Linköping studies in science and technology dissertations.

[16]  Takeaki Uno A Fast Algorithm for Enumerating Bipartite Perfect Matchings , 2001, ISAAC.

[17]  Iain S. Duff,et al.  Computing the structural index , 1986 .

[18]  Henrik Nilsson,et al.  A Declarative Approach to Debugging for Lazy Functional Languages , 1994 .

[19]  K. Fukuda,et al.  Finding All The Perfect Matchings in Bipartite Graphs , 1989 .

[20]  Peter Jonsson Complexity of state-variable planning under structural restrictions , 1995 .

[21]  Avelino J. Gonzalez,et al.  Detecting anomalies in constraint-based systems , 1997 .

[22]  Henry Lieberman,et al.  The Debugging Scandal and What to Do About It (Introduction to the Special Section) , 1997, Commun. ACM.

[23]  Tobias Müller Practical Investigation of Constraints with Graph Views , 2000, CP.

[24]  Martín Abadi,et al.  A Theory of Objects , 1996, Monographs in Computer Science.

[25]  Kannan Govindarajan,et al.  Optimization and relaxation in constraint logic languages , 1996, POPL '96.

[26]  Bjørn N. Freeman-Benson,et al.  Integrating Constraints with an Object-Oriented Language , 1992, ECOOP.

[27]  G Georgina Fabian,et al.  A language and simulator for hybrid systems , 1999 .

[28]  Juha Takkinen,et al.  CAFE: Towards a Conceptual Model for Information Management in Electronic Mail , 1997 .

[29]  Carlos Delgado Kloos,et al.  Reasoning about VHD3L and VHDL-AMS using denotational semantics , 1999, Design, Automation and Test in Europe Conference and Exhibition, 1999. Proceedings (Cat. No. PR00078).

[30]  Standard Glossary of Software Engineering Terminology , 1990 .

[31]  M. Otter,et al.  Modelica - A Unified Object-Oriented Language for Physical Systems Modeling - Language Specification , 2000 .

[32]  Mikael Pettersson,et al.  Compiling Natural Semantics , 1999, Lecture Notes in Computer Science.

[33]  Henrik Nordin On the use of typical cases for knowledge-based consultation and teaching , 1985 .

[34]  David P. Hale,et al.  An evaluation of the cognitive processes of programmers engaged in software debugging , 1999 .

[35]  Rajiv Gupta,et al.  FULLDOC: A Full Reporting Debugger for Optimized Code , 2000, SAS.

[36]  Roland H. C. Yap,et al.  The CLP( R ) language and system , 1992, TOPL.

[37]  Peter Fritzson,et al.  Modelica - A Unified Object-Oriented Language for System Modelling and Simulation , 1998, ECOOP.

[38]  Andreas Zeller,et al.  Finding Failure Causes through Automated Testing , 2000, AADEBUG.

[39]  Alan Borning,et al.  ThingLab: a constraint-oriented simulation laboratory , 1979 .

[40]  L. Petzold A description of dassl: a differential/algebraic system solver , 1982 .

[41]  Miquel Angel Piera Eroles,et al.  The use of physical knowledge to guide formula manipulation in system modelling , 1998, Simul. Pract. Theory.

[42]  Peter Fritzson,et al.  The Open Source Modelica Project , 2002 .

[43]  Bharat Jayaraman,et al.  Modeling Engineering Structures with Constrained Objects , 2002, PADL.

[44]  David P. Hale,et al.  Towards a model of programmers' cognitive processes in software maintenance: A structural learning theory approach for debugging , 1991, J. Softw. Maintenance Res. Pract..

[45]  P. M. Wognum,et al.  Diagnosing and Solving Over-Determined Constraint Satisfaction Problems , 1993, IJCAI.

[46]  K. Pettersson Informationssystemstrukturering, ansvarsfördelning och användarinflytande : en komparativ studie med utgångspunkt i två informationssystemstrategier , 1994 .

[47]  Joan Aldous,et al.  Networks and algorithms - an introductory approach , 1993 .

[48]  Peter Fritzson,et al.  Usability criteria for automated debugging systems , 1995, J. Syst. Softw..

[49]  T Groth,et al.  Object-oriented biomedical system modelling--the language. , 1999, Computer methods and programs in biomedicine.

[50]  Peter Fritzson,et al.  Incremental declaration handling in Open Source Modelica , 2002 .

[51]  C. Pantelides The consistent intialization of differential-algebraic systems , 1988 .

[52]  W. Marquardt,et al.  Structural analysis of differential-algebraic equation systems—theory and applications , 1995 .

[53]  Mikael Lind Affärsprocessinriktad förändringsanalys : utveckling och tillämpning av synsätt och metod , 1996 .

[54]  David P. Hale,et al.  An evaluation of the cognitive processes of programmers engaged in software debugging , 1999, J. Softw. Maintenance Res. Pract..

[55]  Peter Fritzson,et al.  MathModelica - An Extensible Modeling and Simulation Environment with Integrated Graphics and Literate Programming , 2002 .

[56]  C. C. Pantelides,et al.  A modelling and simulation language for combined lumped and distributed parameter systems , 1996 .

[57]  Manfred Glesner,et al.  An open VHDL-AMS simulation framework , 2000, Proceedings 2000 IEEE/ACM International Workshop on Behavioral Modeling and Simulation.

[58]  Markus Stumptner,et al.  Model-Based Debugging of Java Programs , 2000, AADEBUG.

[59]  Peter Fritzson,et al.  The Need for Debugging Tools for Declarative Equation Based Simulation Languages , 2000 .

[60]  Gregg Rothermel,et al.  A Coherent Family of Analyzable Graphical Representations for Object-Oriented Software , 1996 .

[61]  Frank Tip,et al.  Understanding class hierarchies using concept analysis , 2000, TOPL.

[62]  Kurt Mehlhorn,et al.  LEDA: a platform for combinatorial and geometric computing , 1997, CACM.

[63]  Tibor Gyimóthy,et al.  Static and Dynamic Slicing of Constraint Logic Programs , 2004, Automated Software Engineering.

[64]  Vojin Plavsic Interleaved processing of non-numerical data stored on a cyclic memory. , 1983 .

[65]  P. I. Barton,et al.  DAEPACK: An Open Modeling Environment for Legacy Models , 2000 .

[66]  Dan Lawesson Towards Behavioral Model Fault Isolation for Object Oriented Control Systems , 2001 .

[67]  Sven Erik Mattsson,et al.  Index Reduction in Differential-Algebraic Equations Using Dummy Derivatives , 1993, SIAM J. Sci. Comput..

[68]  Mireille Ducassé,et al.  Logic Programming Environments: Dynamic Program Analysis and Debugging , 1994, J. Log. Program..

[69]  Katalin M. Hangos,et al.  Effect of steady state assumption on the structural solvability of dynamic process models , 2002 .

[70]  Charlotte Björkegren,et al.  Learning for the next project : bearers and barriers in knowledge transfer within an organisation , 1999 .

[71]  Stefan Cronholm Varför CASE-verktyg i systemutveckling? : en motiv- och konsekvensstudie avseende arbetssätt och arbetsformer , 1994 .

[72]  P. I. Barton,et al.  Dynamic optimization with state variable path constraints , 1998 .

[73]  H. W. Carter,et al.  A VHDL-AMS mixed-signal, mixed-technology design tool , 1998, Proceedings of the IEEE 1998 National Aerospace and Electronics Conference. NAECON 1998. Celebrating 50 Years (Cat. No.98CH36185).

[74]  Magnus Lindahl Bankens villkor i låneavtal vid kreditgivning till högt belånade företagsförvärv : en studie ur ett agentteoretiskt perspektiv , 2000 .

[75]  James R. Larus,et al.  Mining specifications , 2002, POPL '02.

[76]  Rajiv Gupta,et al.  Comparison checking: an approach to avoid debugging of optimized code , 1999, ESEC/FSE-7.

[77]  Alan Pope,et al.  The CORBA reference guide - understanding the common object request broker architecture , 1998 .

[78]  Ling Lin,et al.  A Value-Based Indexing Technique for Time Sequences , 1997 .

[79]  van Da Bert Beek VARIABLES AND EQUATIONS IN HYBRID SYSTEMS WITH STRUCTURAL CHANGES , 2001 .

[80]  Ehud Shapiro,et al.  Algorithmic Program Debugging , 1983 .

[81]  Mikael Hakman Methods and tools for object-oriented modelling and knowledge-based simulation of complex biomedical systems , 2000 .

[82]  Malin Bergvall Systemförvaltning i Praktiken : en kvalitativ studie avseende centrala begrepp, aktiviteter och ansvarsroller , 1995 .

[83]  I. Duff,et al.  Direct Methods for Sparse Matrices , 1987 .

[84]  Jean Paul Meynard Control of industrial robots through high-level task programming , 2000 .

[85]  Richard M. Karp,et al.  A n^5/2 Algorithm for Maximum Matchings in Bipartite Graphs , 1971, SWAT.

[86]  Manfred Gilli,et al.  Matchings, covers, and Jacobian matrices☆ , 1996 .

[87]  Katalin M. Hangos,et al.  Structural solvability analysis of dynamic process models , 2001 .

[88]  室田 一雄 Systems analysis by graphs and matroids : structural solvability and controllability , 1987 .

[89]  正顯 杉原 Kazuo Murota(室田一雄), Matrices and Matroids for Systems Analysis, Springer-Verlag, 2000年 , 2001 .

[90]  Bharat Jayaraman,et al.  Semantics and Applications of Constrained Objects , 2001 .

[91]  Christos Levcopoulos New results about the approximation behavior of the greedy triangulation , 1986 .

[92]  Peter Fritzson,et al.  Modelica - a general object-oriented language for continuous and discrete-event system modeling and simulation , 2002, Proceedings 35th Annual Simulation Symposium. SS 2002.

[93]  Torbjörn Näslund SLDFA-resolution : computing answers for negative queries , 1990 .

[94]  Robert E. Tarjan,et al.  Depth-First Search and Linear Graph Algorithms , 1972, SIAM J. Comput..

[95]  Per Sahlin Modelling and Simulation Methods for Modular Continuous Systems in Buildings , 1996 .

[96]  Joakim Gustafsson Extending temporal action logic for ramification and concurrency , 1998 .

[97]  Peter Fritzson,et al.  DEVS-Based Multi-Formalism Modeling and Simulation in Modelica , 2000 .

[98]  Paul I. Barton,et al.  The modelling and simulation of combined discrete/continuous processes , 1992 .

[99]  Hilding Elmqvist,et al.  Methods for Tearing Systems of Equations in Object-Oriented Modeling , 1994 .

[100]  Stephen Wolfram,et al.  The Mathematica Book , 1996 .

[101]  Peter Carlsson Separation av företagsledning och finansiering : fallstudier av företagsledarutköp ur ett agentteoretiskt perspektiv ... , 1994 .

[102]  Mireille Ducassé,et al.  A Pragmatic Survey of Automated Debugging , 1993, AADEBUG.

[103]  Kristina Larsen Förutsättningar och begränsningar för arbete på distans : erfarenheter från fyra svenska företag , 1996 .

[104]  Claudio Maffezzoni,et al.  Generating efficient computational procedures from declarative models , 1996, Simul. Pract. Theory.

[105]  Henrik Nilsson,et al.  Declarative debugging for lazy functional languages , 1998 .

[106]  Anna Moberg Satellitkontor : en studie av kommunikationsmönster vid arbete på distans , 1993 .

[107]  Jonathan B. Rosenberg How Debuggers Work: Algorithms, Data Structures, and Architecture , 1996 .

[108]  R. Häggkvist,et al.  Bipartite graphs and their applications , 1998 .

[109]  Mattias Krysander,et al.  Structural Analysis for Fault Diagnosis of DAE Systems Utilizing Graph Theory and MSS Sets , 2002 .

[110]  M. F. Wani,et al.  Diagnosability evaluation of systems using bipartite graph and matrix approach , 2000, Artificial Intelligence for Engineering Design, Analysis and Manufacturing.

[111]  Sriram K. Rajamani,et al.  The SLAM project: debugging system software via static analysis , 2002, POPL '02.

[112]  Owen Eriksson Informationssystem med verksamhetskvalitet : utvärdering baserat på ett verksamhetsinriktat och samskapande perspektiv , 1994 .

[113]  James A. McHugh,et al.  Algorithmic Graph Theory , 1986 .

[114]  Sriram K. Rajamani,et al.  Automatically validating temporal safety properties of interfaces , 2001, SPIN '01.

[115]  Johan Petersson Lokala elektroniska marknadsplatser : informationssystem för platsbundna affärer , 2002 .

[116]  Shamsul I. Chowdhury,et al.  Statistical expert systems : a special application area for knowledge-based computer methodology , 1987 .

[117]  Takeaki Uno,et al.  Algorithms for Enumerating All Perfect, Maximum and Maximal Matchings in Bipartite Graphs , 1997, ISAAC.

[118]  T Groth,et al.  Object-oriented biomedical system modeling--the rationale. , 1999, Computer methods and programs in biomedicine.

[119]  Hans Olsson,et al.  Dynamic Selection of States in Dymola , 2000 .

[120]  Keith H. Bennett,et al.  Approaches to program comprehension , 1991, J. Syst. Softw..

[121]  Raimondas Lencevicius Advanced Debugging Methods , 2000 .

[122]  Peter Fritzson,et al.  MathModelica – A New Modeling and Simulation Environment for Modelica , 1999 .

[123]  Mark Weiser,et al.  Programmers use slices when debugging , 1982, CACM.

[124]  Glenford J. Myers,et al.  Art of Software Testing , 1979 .

[125]  Mats Andersson,et al.  Combined Object-Oriented Modelling in Omola , 1992 .

[126]  Gilles Kahn,et al.  Natural Semantics , 1987, STACS.

[127]  Eva L. Ragnemalm Towards student modelling through collaborative dialogue with a learning companion , 1995 .

[128]  Christer Hansson A prototype system for logical reasoning about time and action , 1990 .

[129]  Pär J. Ågerfalk,et al.  Pragmatization of Information Systems - A Theoretical and Methodological Outline , 1999 .

[130]  Hilding Elmqvist,et al.  Modelica — A unified object-oriented language for physical systems modeling , 1997 .

[131]  Aaron Marcus,et al.  Software visualization for debugging , 1997, CACM.

[132]  Frank Tip,et al.  Change impact analysis for object-oriented programs , 2001, PASTE '01.

[133]  Jan Maluszynski,et al.  CP debugging needs and tools , 1997 .

[134]  Emma Hansson Optionsprogram för anställda : en studie av svenska börsföretag , 2001 .

[135]  Hilding Elmqvist,et al.  DYMOLA - A Structured Model Language for Large Continuous Systems , 1978 .

[136]  Andreas Zeller,et al.  Simplifying and Isolating Failure-Inducing Input , 2002, IEEE Trans. Software Eng..

[137]  Kazuo Murota,et al.  Matrices and Matroids for Systems Analysis , 2000 .

[138]  Fredrik Elg,et al.  Ett dynamiskt perspektiv på individuella skillnader av heuristisk kompetens, intelligens, mentala modeller, mål och konfidens i kontroll av mikrovärlden Moro , 2002 .

[139]  MathCore AB Teknikringen MathModelica-A Full System Simulation Tool , 2000 .

[140]  Martin Otter,et al.  Modelica-a language for physical system modeling, visualization and interaction , 1999, Proceedings of the 1999 IEEE International Symposium on Computer Aided Control System Design (Cat. No.99TH8404).

[141]  Gilles Trombettoni,et al.  Using Graph Decomposition for Solving Continuous CSPs , 1998, CP.

[142]  N. S. Mendelsohn,et al.  Coverings of Bipartite Graphs , 1958, Canadian Journal of Mathematics.

[143]  Alan Borning,et al.  Hierarchical Constraint Logic Programming , 1994, J. Log. Program..

[144]  Kurt Mehlhorn,et al.  The LEDA Platform of Combinatorial and Geometric Computing , 1997, ICALP.

[145]  Richard M. Karp,et al.  A n^5/2 Algorithm for Maximum Matchings in Bipartite Graphs , 1971, SWAT.

[146]  T. E. Hull,et al.  Numerical solution of initial value problems , 1966 .

[147]  S. E. Mattsson,et al.  The ideas behind Omola , 1992, IEEE Symposium on Computer-Aided Control System Design.

[148]  M. Günther,et al.  The DAE-index in electric circuit simulation , 1995 .

[149]  Bharat Jayaraman,et al.  Compositional Semantics for Diagrams Using Constrained Objects , 2002, Diagrams.

[150]  Anders Bäckström,et al.  Värdeskapande kreditgivning : kreditriskhantering ur ett agentteoretiskt perspektiv , 1998 .

[151]  Michael Tiller,et al.  Introduction to Physical Modeling with Modelica , 2001 .