Results 11 - 20
of
34
Dependency Analysis for Standard ML
- ACM Transactions on Programming Languages and Systems
, 1998
"... Automatic dependency analysis is a useful addition to a system like CM, our compilation manager for Standard ML of New Jersey. It relieves the programmer from the tedious and error-prone task of having to specify compilation dependencies by hand and thereby makes its usage more user-friendly. But de ..."
Abstract
-
Cited by 7 (2 self)
- Add to MetaCart
Automatic dependency analysis is a useful addition to a system like CM, our compilation manager for Standard ML of New Jersey. It relieves the programmer from the tedious and error-prone task of having to specify compilation dependencies by hand and thereby makes its usage more user-friendly. But dependency analysis is not easy as the general problem for Standard ML is NP-complete. Therefore, CM has to impose certain restrictions on the programming language to recover tractability. We prove the NP-completeness result, discuss the restrictions on ML that are used by CM, and provide the resulting analysis algorithms. 1 Introduction For programs written in Standard ML [MTH90, MTHM97], the order of compilation matters. But the task of maintaining order within collections of sources can be tedious. Therefore, CM [Blu95], the compilation manager for Standard ML of New Jersey [AM91], o#ers automatic dependency analysis. CM provides a language for specifying the semantic structure of large pr...
Calculi of Generalised β-Reduction and Explicit Substitutions: The Type-Free and Simply Typed Versions
, 1998
"... Extending the λ-calculus with either explicit substitution or generalized reduction has been the subject of extensive research recently, and still has many open problems. This paper is the first investigation into the properties of a calculus combining both generalized reduction and explicit substit ..."
Abstract
-
Cited by 7 (4 self)
- Add to MetaCart
Extending the λ-calculus with either explicit substitution or generalized reduction has been the subject of extensive research recently, and still has many open problems. This paper is the first investigation into the properties of a calculus combining both generalized reduction and explicit substitutions. We present a calculus, gs, that combines a calculus of explicit substitution, s, and a calculus with generalized reduction, g. We believe that gs is a useful extension of the - calculus, because it allows postponement of work in two different but complementary ways. Moreover, gs (and also s) satisfies properties desirable for calculi of explicit substitutions and generalized reductions. In particular, we show that gs preserves strong normalization, is a conservative extension of g, and simulates fi-reduction of g and the classical -calculus. Furthermore, we study the simply typed versions of s and gs, and show that well-typed terms are strongly normalizing and that other properties,...
An Analysis of the Core-ML Language: Expressive Power and Type Reconstruction
- In Proc. 21st Int'l Coll. Automata, Languages, and Programming
, 1994
"... Core-ML is a basic subset of most functional programming languages. It consists of the simply typed (or monomorphic) -calculus, simply typed equality over atomic constants, and let as the only polymorphic construct. We present a synthesis of recent results which characterize this "toy" language' ..."
Abstract
-
Cited by 5 (3 self)
- Add to MetaCart
Core-ML is a basic subset of most functional programming languages. It consists of the simply typed (or monomorphic) -calculus, simply typed equality over atomic constants, and let as the only polymorphic construct. We present a synthesis of recent results which characterize this "toy" language's expressive power as well as its type reconstruction (or type inference) problem. More specifically: (1) Core-ML can express exactly the ELEMENTARY queries, where a program input is a database encoded as a -term and a query program is a -term whose application to the input normalizes to the output database. In addition, it is possible to express all the PTIME queries so that this normalization process is polynomial in the input size. (2) The polymorphism of let can be explained using a simple algorithmic reduction to monomorphism, and provides flexibility, without affecting expressibility. Algorithms for type reconstruction offer the additional convenience of static typing without type declarations. Given polymorphism, the price of this convenience is an increase in complexity from linear-time in the size of the program typed (without let) to completeness in exponential-time (with let).
Type Inference for First-Class Messages with Feature Constraints
- International Journal of Foundations of Computer Science
, 1998
"... We present a constraint system OF of feature trees that is appropriate to specify and implement type inference for first-class messages. OF extends traditional systems of feature constraints by a selection constraint xhyiz "by first-class feature tree" y, in contrast to the standard selection con ..."
Abstract
-
Cited by 4 (0 self)
- Add to MetaCart
We present a constraint system OF of feature trees that is appropriate to specify and implement type inference for first-class messages. OF extends traditional systems of feature constraints by a selection constraint xhyiz "by first-class feature tree" y, in contrast to the standard selection constraint x[ f ]y "by fixed feature" f . We investigate the satisfiability problem of OF and show that it can be solved in polynomial time, and even in quadratic time in an important special case. We compare OF with Treinen's constraint system EF of feature constraints with first-class features, which has an NP-complete satisfiability problem. This comparison yields that the satisfiability problem for OF with negation is NP-hard. Based on OF we give a simple account of type inference for first-class messages in the spirit of Nishimura's recent proposal, and we show that it has polynomial time complexity: We also highlight an immediate extension that is desirable but makes type inference NP-hard.
Type Inference for Recursive Definitions
- In Proc. 14th Ann. IEEE Symp. Logic in Comput. Sci
, 2000
"... We consider type systems that combine universal types, recursive types, and object types. We study type inference in these systems under a rank restriction, following Leivant's notion of rank. To motivate our work, we present several examples showing how our systems can be used to type programs enco ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
We consider type systems that combine universal types, recursive types, and object types. We study type inference in these systems under a rank restriction, following Leivant's notion of rank. To motivate our work, we present several examples showing how our systems can be used to type programs encountered in practice. We show that type inference in the rank-k system is decidable for k # 2 and undecidable for k # 3. (Similar results based on different techniques are known to hold for System F, without recursive types and object types.) Our undecidability result is obtained by a reduction from a particular adaptation (which we call "regular") of the semi-unification problem and whose undecidability is, interestingly, obtained by methods totally different from those used in the case of standard (or finite) semi-unification. Keywords: type systems, type inference, lambda calculus, unification, software specification. 1 Introduction 1.1 Background and Motivation Type inference, the ...
Principal Typing and Mutual Recursion
, 2001
"... As pointed out by Damas[Dam84], the Damas-Milner system (ML) has principal types, but not principal typings. Damas also dened in his thesis a slightly modied version of ML, that we call ML 0 , which, given a typing context and an expression, derives exactly the same types, and provided an algorith ..."
Abstract
-
Cited by 2 (2 self)
- Add to MetaCart
As pointed out by Damas[Dam84], the Damas-Milner system (ML) has principal types, but not principal typings. Damas also dened in his thesis a slightly modied version of ML, that we call ML 0 , which, given a typing context and an expression, derives exactly the same types, and provided an algorithm (named as T) that infers principal typings for ML 0 . This work extends each of ML 0 and T with a new rule for typing mutually recursive let-bindings. The proposed rule can type more expressions than the corresponding rule used in ML, by allowing mutually recursive denitions to be used polymorphically by other denitions. 1
Haskell-style Overloading is NP-hard
- In Proceedings of the 1994 International Conference on Computer Languages
, 1994
"... Extensions of the ML type system, based on constrained type schemes, have been proposed for languages with overloading. Type inference in these systems requires solving the following satisfiability problem. Given a set of type assumptions C over finite types and a type basis A, is there is a substit ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
Extensions of the ML type system, based on constrained type schemes, have been proposed for languages with overloading. Type inference in these systems requires solving the following satisfiability problem. Given a set of type assumptions C over finite types and a type basis A, is there is a substitution S that satisfies C in that A ` CS is derivable? Under arbitrary overloading, the problem is undecidable. Haskell limits overloading to a form similar to that proposed by Kaes called parametric overloading. We formally characterize parametric overloading in terms of a regular tree language and prove that although decidable, satisfiability is NP-hard when overloading is parametric. 1 Introduction A practical limitation of the ML type system is that it prohibits global overloading in a programming language by restricting to at most one the number of assumptions per identifier in a type context, a limitation noted by Milner himself [Mil78]. Suppose we wish to assert that a free identifier...
Natural semantics as a static program analysis framework
- ACM TRANSACTIONS ON PROGRAMMING LANGUAGES AND SYSTEMS (TOPLAS
, 2004
"... Natural semantics specifications have become mainstream in the formal specification of programming language semantics during the last ten years. In this paper, we set up sorted natural semantics as a specification framework which is able to express static semantic information of programming language ..."
Abstract
-
Cited by 2 (0 self)
- Add to MetaCart
Natural semantics specifications have become mainstream in the formal specification of programming language semantics during the last ten years. In this paper, we set up sorted natural semantics as a specification framework which is able to express static semantic information of programming languages declaratively in a uniform way and allows at the same time to generate corresponding analyses. Such static semantic information comprises context-sensitive properties which are checked in the semantic analysis phase of compilers as well as further static program analyses such as e.g. classical data and control flow analyses or type and effect systems. The latter require fixed point analyses to determine their solutions. We show that, given a sorted natural semantics specification, we can generate the corresponding analysis. Therefore, we classify the solution of such an analysis by the notion of a proof tree. We show that a proof tree can be computed by solving an equivalent residuation problem. In case of the semantic analysis, this solution can be found by a basic algorithm. We show that its efficiency can be enhanced using solution strategies. We also demonstrate our prototype implementation of the basic algorithm which proves its applicability in practical situations. With the results of this paper, we have established natural semantics as a framework which closes the gap between declarative and
A more direct algorithm for type inference in the rank-2 fragment of the second-order λ-calculus
, 2006
"... We present an algorithm for rank-2 type inference in the second-order λ-calculus. Our algorithm differs from the well-known algorithm of Kfoury and Wells in that it employs only a quadratically fewer type variables and inequalities. Our algorithm consists of a translation from a λ-term to an instanc ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
We present an algorithm for rank-2 type inference in the second-order λ-calculus. Our algorithm differs from the well-known algorithm of Kfoury and Wells in that it employs only a quadratically fewer type variables and inequalities. Our algorithm consists of a translation from a λ-term to an instance of R-ASUP (a decidable superset of ASUP) in which the variables correspond more directly to features in the original term. We claim that our construction, being simpler and more direct, is more amenable to proof and extension. 1.
Reflections on complexity of ML type reconstruction
, 1997
"... This is a collection of some more or less chaotic remarks on the ML type system, definitely not sufficient to fill a research paper of reasonable quality, but perhaps interesting enough to be written down as a note. At the beginning the idea was to investigate the complexity of type reconstruction a ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
This is a collection of some more or less chaotic remarks on the ML type system, definitely not sufficient to fill a research paper of reasonable quality, but perhaps interesting enough to be written down as a note. At the beginning the idea was to investigate the complexity of type reconstruction and typability in bounded order fragments of ML. Unexpectedly the problem turned out to be hard, and finally I obtained only partial results. I do not feel like spending more time on this topic, so the text is not polished, the proofs --- if included at all --- are only sketched and of rather poor mathematical quality. I believe however, that some remarks, especially those of "philosophical" nature, shed some light on the ML type system and may be of some value to the reader interested especially in the interaction between theory and practice of ML type reconstruction. 1 Introduction The ML type system was developed by Robin Milner in the late seventies [26, 3], but was influenced by much ol...

