A Rewriting Semantics for Type Inference
نویسندگان
چکیده
When students first learn programming, they often rely on a simple operational model of a program’s behavior to explain how particular features work. Because such models build on their earlier training in algebra, students find them intuitive, even obvious. Students learning type systems, however, have to confront an entirely different notation with a different semantics that many find difficult to understand. In this work, we begin to build the theoretical underpinnings for treating typechecking in a manner like the operational semantics of execution. Intuitively, each term is incrementally rewritten to its type. For example, each basic constant rewrites directly to its type and each lambda expression rewrites to an arrow type whose domain is the type of the lambda’s formal parameter and whose range is the body of the lambda expression which, in turn, rewrites to the range type.
منابع مشابه
Is the Java Type System Sound?
We argue that the Java type system is sound, by proving a subject reduction theorem. We deene a subset of Java, a language which is safe and which reeects the most essential features of Java, a term rewriting system for the operational semantics and a type inference system to describe compile time type checking. We prove that program execution preserves the types, up to the subclass/subinterfac...
متن کاملCollected Size Semantics for Functional Programs ?
This work introduces collected size semantics of strict functional programs over lists. It is presented via non-deterministic numerical functions annotating types. These functions are defined by conditional rewriting rules generated during type inference. We focus on the connection between the size rewriting rules and lower and upper bounds on size dependencies, where the bounds are given by po...
متن کاملSubject Reduction and Minimal Types for Higher Order Subtyping
We define the typed lambda calculus Fω ∧ , a natural generalization of Girard’s system F with intersection types and bounded polymorphism. A novel aspect of our presentation is the use of term rewriting techniques to present intersection types, which clearly splits the computational semantics (reduction rules) from the syntax (inference rules) of the system. We establish properties such as Chur...
متن کاملCollected Size Semantics for Functional Programs over Lists
This work introduces collected size semantics of strict functional programs over lists. The collected size semantics of a function definition is a multivalued size function that collects the dependencies between every possible output size and the corresponding input sizes. Such functions annotate standard types and are defined by conditional rewriting rules generated during type inference. We f...
متن کاملA Functional View of Join
Join calculus, usually presented as a process calculus, is suitable as a foundation of both sequential and concurrent programming. We give a new operational semantics of join calculus, expressed as a reduction system with a single reduction rule similar to β reduction in lambda calculus. We also introduce a new Hindley/Milner style type system for join calculus. Compared to previous work, the t...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2007