Typed intermediate languages for shape analysis

  • Gianna Bellè
  • Eugenio Moggi
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1210)


We introduce S2, a typed intermediate language for vectors, based on a 2-level type-theory, which distinguishes between compile-time and run-time. The paper shows how S2 can be used to extract useful information from programs written in the Nested Sequence Calculus NSC, an idealized high-level parallel calculus for nested sequences. We study two translations from NSC to S2. The most interesting shows that shape analysis (in the sense of Jay) can be handled at compile-time.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    L. Birkedal, M. Tofte, and M. Vejlstrup. From Region Inference to von Neumann Machines via Region Representation Inference. In Proceedings from the 23rd annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 1996.Google Scholar
  2. 2.
    G.E. Blelloch, S. Chatterjee, J.C. Hardwick, J. Sipelstein, and M. Zagha. Implementation of a portable nested data-parallel language. Journal of Parallel and Distributed Computing, 21(1), April 1994.Google Scholar
  3. 3.
    G.E. Blelloch and J. Greiner. A provable time and space efficient implementation of NESL. In ACM SIGPLAN International Conference on Functional Programming, pages 213–225, May 1996.Google Scholar
  4. 4.
    A. Carboni, S. Lack, and R.F.C. Walters. Introduction to extensive and distributive categories. Journal of Pure and Applied Algebra, 84:145–158, 1993.Google Scholar
  5. 5.
    T. Coquand and C. Paulin-Mohring. Inductively defined types. volume 389, LNCS, 1989.Google Scholar
  6. 6.
    R. Davies. A temporal-logic approach to binding-time analysis. In E. Clarke, editor, Proceedings of the Elenventh Annual Symposium on Logic in Computer Science, New Brunswick, New Jersey, July 1996. IEEE Computer Society Press.Google Scholar
  7. 7.
    H. Goguen. A Typed Operational Semantics for Type Theory. PhD thesis, University of Edinburgh, 1994.Google Scholar
  8. 8.
    R. Harper, J. Mitchell, and E. Moggi. Higher-order modules and the phase distinction. In 17th POPL. ACM, 1990.Google Scholar
  9. 9.
    R. Harper and G. Morrisett. Compiling polymorphism using intensional type analysis. In Conference Record of POPL '95: 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 130–141, San Francisco, California, January 1995.Google Scholar
  10. 10.
    M. Hofmann. Dependent types: Syntax, semantics, and applications. Summer School on Semantics and Logics of Computation, University of Cambridge, Newton Institute for Mathematical Sciences, September 1995.Google Scholar
  11. 11.
    B. Jacobs, E. Moggi, and T. Streicher. Relating models of impredicative type theories. In Proceedings of the Conference on Category Theory and Computer Science, Manchester, UK, Sept. 1991, volume 389 of LNCS. Springer Verlag, 1991.Google Scholar
  12. 12.
    B.P.F. Jacobs. Categorical Type Theory. PhD thesis, University of Nijmegen, 1991.Google Scholar
  13. 13.
    C.B. Jay. Matrices, monads and the fast fourier transform. In Proceedings of the Massey Functional Programming Workshop 1994, pages 71–80, 1994.Google Scholar
  14. 14.
    C.B. Jay. A semantics for shape. Science of Computer Programming, 25:251–283, 1995.Google Scholar
  15. 15.
    C.B. Jay. Shape in computing. ACM Computing Surveys, 28(2):355–357, 1996.Google Scholar
  16. 16.
    C.B. Jay and M. Sekanina. Shape checking of array programs. In Computing: the Australasian Theory Seminar, Proceedings, 1997, 1997. accepted for publication.Google Scholar
  17. 17.
    E. Moggi. A category-theoretic account of program modules. Math. Struct. in Computer Science, 1:103–139, 1991.Google Scholar
  18. 18.
    F. Nielson and H.R. Nielson. Two-Level Functional Languages. Number 34 in Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, 1992.Google Scholar
  19. 19.
    B. Nordström, K. Petersson, and J.M. Smith. Programming in Martin-Löf's type theory:an introduction. Number 7 in International series of monographs on computer science. Oxford University Press, New York, 1990.Google Scholar
  20. 20.
    S. Peyton Jones. Unboxed values as first-class citizens. In Functional Programming and Computer Architecture, volume 523 of LNCS, 1991.Google Scholar
  21. 21.
    A.M. Pitts. Notes on categorical logic. University of Cambridge, Computer Laboratory, Lent Term 1989.Google Scholar
  22. 22.
    D. Suciu and V. Tannen. Efficient compilation of high-level data parallel al-gorithms. In Proc. ACM Symposium on Parallel Algorithms and Architectures, June 1994.Google Scholar
  23. 23.
    J.-P. Talpin and P. Jouvelot. The type and effect discipline. Information and Computation, 111(2):245–296, June 1994.Google Scholar
  24. 24.
    M. Tofte and J.-P. Talpin. Implementation of the typed call-by-value lambdacalculus using a stack of regions. In Proceedings from the 21st annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, 1994.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1997

Authors and Affiliations

  • Gianna Bellè
    • 1
  • Eugenio Moggi
    • 1
  1. 1.DISI - Univ. di GenovaGenovaItaly

Personalised recommendations