Abstract
We present the design and implementation of the type system for Ptolemy II, which is a tool for component-based heterogeneous modeling and design. This type system combines static typing with run-time type checking. It supports polymorphic typing of components, and allows automatic lossless type conversion at run-time. To achieve this, we use a lattice to model the lossless type conversion relation among types, and use inequalities defined over the type lattice to specify type constraints in components and across components. The system of inequalities can be solved efficiently, with existence and uniqueness of a solution guaranteed by fixed-point theorems. This type system increases the safety and flexibility of the design environment, promotes component reuse, and helps simplify component development and optimization. The infrastructure we have built is generic in that it is not bound to one particular type lattice. The type system can be extended in two ways: by adding more types to the lattice, or by using different lattices to model different system properties. Higher-order function types and extended types can be accommodated in this way.
Chapter PDF
References
H. Abelson and G. J. Sussman, Structure and Interpretation of Computer Programs, The MIT Press, 1985.
F. Arbab, MANIFOLD Version 2.0, CWI, Software Engineering Cluster, Kruislaan 413, 1098 SJ Amsterdam, The Netherlands, June, 1998.
L. Cardelli and P. Wegner, “On Understanding Types, Data Abstraction, and Polymorphism,” ACM Computing Surveys, Vol.17, No.4, Dec. 1985.
B. A. Davey and H. A. Priestly, Introduction to Lattices and Order, Cambridge University Press, 1990.
J. Davis II, M. Goel, C. Hylands, B. Kienhuis, E. A. Lee, J. Liu, X. Liu, L. Muliadi, S. Neuendorffer, J. Reekie, N. Smyth, J. Tsay and Y. Xiong, Overview of the Ptolemy Project, ERL Technical Report UCB/ERL No. M99/37, Dept. EECS, University of California, Berkeley, CA 94720, July 1999. (http://ptolemy.eecs.berkeley.edu/publications/papers/99/HMAD/)
Y-C. Fuh and P. Mishra, “Type Inference with Subtypes,” Second European Symposium on Programming, Nancy, France, 1988.
A. Girault, B. Lee, and E. A. Lee, “Hierarchical Finite State Machines with Multiple Concurrency Models,” IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, Vol.18, No.6, June 1999.
C. V. Hall, K. Hammond, S.L. Peyton Jones, and P. L. Wadler, “Type Classes in Haskell,” ACM Transactions on Programming Languages, Vol.18, No.2, Mar. 1996.
J. B. Hext, “Compile-Time Type-Matching,” Computer Journal, 9, 1967.
E. A. Lee and D. G. Messerschmitt, “Static Scheduling of Synchronous Data Flow Programs for Digital Signal Processing,” IEEE Transaction on Computer, Jan. 1987.
J. Liu, B. Wu, X. Liu, and E. A. Lee, “Interoperation of Heterogeneous CAD Tools in Ptolemy II,” Symposium on Design, Test, and Microfabrication of MEMS/MOEMS, Paris, France, Mar. 1999.
R. Milner, “A Theory of Type Polymorphism in Programming,” Journal of Computer and System Sciences, 17, pp. 384–375, 1978.
J. C. Mitchell, Foundations for Programming Languages, The MIT Press, 1998.
M. Odersky, “Challenges in Type Systems Research,” ACM Computing Surveys, Vol.28, No.4es, 1996.
J. Rehof and T. Mogensen, “Tractable Constraints in Finite Semilattices,” Third International Static Analysis Symposium, LNCS 1145, Springer, Sept., 1996.
J. D. Ullman, Elements of ML Programming, Prentice Hall, 1998.
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2000 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Xiong, Y., Lee, E.A. (2000). An Extensible Type System for Component-Based Design. In: Graf, S., Schwartzbach, M. (eds) Tools and Algorithms for the Construction and Analysis of Systems. TACAS 2000. Lecture Notes in Computer Science, vol 1785. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-46419-0_2
Download citation
DOI: https://doi.org/10.1007/3-540-46419-0_2
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-67282-1
Online ISBN: 978-3-540-46419-8
eBook Packages: Springer Book Archive