Abstract
We consider the problem of automatically inferring properties of programs. Our approach is to explore the application of familiar type inference principles to a “type system∝ sufficiently expressive that the typing problem is effectively the checking of program specifications. We use familiar syntax-directed type inference rules to give a polynomialtime procedure for inferring type theorems in this rich type system. We discuss examples of simple functional programs and the specification information this procedure automatically infers. The enriched notion of type allows the definition of any recursively enumerable set as a type, and includes argument-dependent output types for functions. The inference procedure is capable for example of automatically inferring that an insertion sort program always returns a sorted permutation of its input.
Preview
Unable to display preview. Download preview PDF.
References
A. Aiken and E. Wimmers. Soft typing with conditional types. In ACM Symposium on Principles of Programming Languges, pages 163–173, 1994.
Alexander Aiken and Edward Wimmers. Type inference with set constraints. Research Report 8956, IBM, 1992.
J. A. Brzozowski and E. Leiss. On equations for regular languages, finite automata, and sequential networks. Theoretical Computer Science, 10:19–35, 1980.
R. L. Constable et. al. Implementing Mathematics with the Nuprl Development system. Prentice-Hall, 1986.
Robert Givan. Automatically Inferring Properties of Computer Programs. PhD thesis, Massachusetts Institute of Technology, 1996. http://www.ai.mit.edu-/people/rlg/papers/thesis.ps.
P. Jouvelot and D. Gifford. Algebraic reconstruction of types and effects. In Proceedings of ACM Conference on Principles of Programming Languages, 1991.
D. McAllester and K. Arkoudas. Walther recursion. Submitted to CADE-13, available at http://www.ai.mit.edu/people/dam/termination.html, 1996.
D. McAllester and R. Givan. Taxonomic syntax for first order inference. JACM, 40(2):246–283, April 1993. internet file ftp.ai.mit.edu:/pub/users/dam/jacml.ps.
J. McCarthy. A basis for a math. theory of computation. P. Braffort & D. Hirschberg, eds., Computer Programing & Formal Systems. North-Holland, 1967.
Robin Milner. Type polymorphism in programming. JCSS, 17:348–375, 1978.
John C. Mitchell. A type inference appproach to reduction properties and semantics of polymorphic expressions. In Proceedings 1986 ACM Symposium on Lisp and Functional Programming, pages 308–319, 1986.
P. Mishra and U. S. Reddy. Declaration-free type checking. In Proceedings of the Twelfth Annual ACM Symposium on Principles of Programming Languages, pages 7–21. ACM, 1985.
John C. Reynolds. Towards a theory of type structure. In Proceedings Colloque sur la Programmation. Springer-Verlag, 1974.
J.W. Thatcher. Tree automata: an informal survey. In A. V. Aho, editor, Currents in Theory of Computation, pages 143–172. Prentice-Hall, 1973.
W. Thomas. Automata on infinite objects. In Handbook of Theoretical Computer Science, Volume B, Formal Methods and Semantics, pp. 133–164. MIT Press, 1990.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Givan, R. (1996). Inferring program specifications in polynomial-time. In: Cousot, R., Schmidt, D.A. (eds) Static Analysis. SAS 1996. Lecture Notes in Computer Science, vol 1145. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61739-6_43
Download citation
DOI: https://doi.org/10.1007/3-540-61739-6_43
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61739-6
Online ISBN: 978-3-540-70674-8
eBook Packages: Springer Book Archive