Static Balance Checking for First-Class Modular Systems of Equations

  • John Capper
  • Henrik Nilsson
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6546)


Characterising a problem in terms of a system of equations is common to many branches of science and engineering. Due to their size, such systems are often described in a modular fashion by composition of individual equation system fragments. Checking the balance between the number of variables (unknowns) and equations is a common approach to early detection of mistakes that might render such a system unsolvable. However, current approaches to modular balance checking have a number of limitations. This paper investigates a more flexible approach that in particular makes it possible to treat equation system fragments as true first-class entities. The central idea is to record balance information in the type of an equation fragment. This information can then be used to determine if individual fragments are well formed, and if composing fragments preserves this property. The type system presented in this paper is developed in the context of Functional Hybrid Modelling (FHM). However, the key ideas are in no way specific to FHM, but should be applicable to any language featuring a notion of modular systems of equations.


Systems of equations equation-based non-causal modelling first-class components equation-variable balance structural analysis linear constraints refinement types 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Broman, D., Nyström, K., Fritzson, P.: Determining Over- and Under-Constrained Systems of Equations using Structural Constraint Delta. In: GPCE. ACM, New York (2006)Google Scholar
  2. 2.
    Bunus, P., Fritzson, P.: A debugging scheme for declarative equation based modeling languages. In: Adsul, B., Ramakrishnan, C.R. (eds.) PADL 2002. LNCS, vol. 2257, p. 280. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  3. 3.
    Conkwright, N.B.: Introduction to the Theory of Equations. Ginn, Boston (1957)zbMATHGoogle Scholar
  4. 4.
    Freeman, T., Pfenning, F.: Refinement Types for ML. In: PLDI (1991)Google Scholar
  5. 5.
    Giorgidze, G., Nilsson, H.: Higher-Order Non-Causal Modelling and Simulation of Structurally Dynamic Systems. In: Casella, F. (ed.) Proceedings of the 7th International Modelica Conference. Linköping Electronic Conference Proceedings (2009)Google Scholar
  6. 6.
    Jones, S.: Haskell 98 Language and Libraries: the Revised Report (2003)Google Scholar
  7. 7.
    Kuhn, H.: Solvability and Consistency for Linear Equations and Inequalities. American Mathematical Monthly 63 (1956)Google Scholar
  8. 8.
    McKinna, J., Altenkirch, T., McBride, C.: Why Dependent Types Matter. ACM SIGPLAN Notices 41(1) (2006)Google Scholar
  9. 9.
    The Modelica Association. Modelica – A Unified Object-Oriented Language for Physical Systems Modeling: Language Specification Version 3.2 (2010)Google Scholar
  10. 10.
    Nilsson, H.: Type-Based Structural Analysis for Modular Systems of Equations. In: Proceedings of the 2nd International Workshop on Equation-Based Object-Oriented Languages and Tools. Linköping Electronic Conference Proceedings (2008)Google Scholar
  11. 11.
    Nilsson, H., Peterson, J., Hudak, P.: Functional hybrid modeling. In: Dahl, V. (ed.) PADL 2003. LNCS, vol. 2562, pp. 376–390. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  12. 12.
    Nilsson, H., Peterson, J., Hudak, P.: Functional Hybrid Modeling from an Object-Oriented Perspective. In: Simulation News Europe (2007)Google Scholar
  13. 13.
    Norell, U.: Towards a Practical Programming Language Based on Dependent Type Theory. PhD thesis, Department of Computer Science and Engineering, Chalmers University of Technology, Göteborg, Sweden (2007)Google Scholar
  14. 14.
    Pierce, B.: Types and Programming Languages. The MIT Press, Cambridge (2002)zbMATHGoogle Scholar
  15. 15.
    Pugh, W.: The Omega Test: a Fast and Practical Integer Programming Algorithm for Dependence Analysis. In: Supercomputing 1991 (1991)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • John Capper
    • 1
  • Henrik Nilsson
    • 1
  1. 1.Functional Programming Laboratory, School of Computer ScienceUniversity of NottinghamUnited Kingdom

Personalised recommendations