Strategies for Solving Constraints in Type and Effect Systems

Turning type and effect deduction systems into an algorithm is a tedious and error-prone job, and usually results in an implementation that leaves no room to modify the solving strategy, without actually changing it. We employ constraints to declaratively specify the rules of a type system. Starting from a constraint based formulation of a type system, we introduce special combinators in the type rules to specify in which order constraints may be solved. A solving strategy can then be chosen by giving a particular interpretation to these combinators, and the resulting list of constraints can be fed into a constraint solver; thus the gap between the declarative specification and the deterministic implementation is bridged. This design makes the solver simpler and easier to reuse. Our combinators have been used in the development of a real-life compiler.

[1]  Benjamin C. Pierce,et al.  Types and programming languages: the next generation , 2003, 18th Annual IEEE Symposium of Logic in Computer Science, 2003. Proceedings..

[2]  Martin Odersky,et al.  Type Inference with Constrained Types , 1999, Theory Pract. Object Syst..

[3]  Kwangkeun Yi,et al.  Proofs about a folklore let-polymorphic type inference algorithm , 1998, TOPL.

[4]  Bastiaan Heeren,et al.  Top quality type error Messages , 2005 .

[5]  Robin Milner,et al.  A Theory of Type Polymorphism in Programming , 1978, J. Comput. Syst. Sci..

[6]  Jurriaan Hage,et al.  Ordering Type Constraints: A Structured Approach , 2005 .

[7]  Robin Milner,et al.  Principal type-schemes for functional programs , 1982, POPL '82.

[8]  Martin Sulzmann A General Type Inference Framework for Hindley/Milner Style Systems , 2001, FLOPS.

[9]  Benjamin C. Pierce,et al.  TinkerType: a language for playing with formal systems , 2003, Journal of Functional Programming.

[10]  Bruce J. McAdam On the Unification of Substitutions in Type Interfaces , 1998, IFL.

[11]  LeeOukseh,et al.  Proofs about a folklore let-polymorphic type inference algorithm , 1998 .

[12]  Barry O'Sullivan,et al.  Generating Corrective Explanations for Interactive Constraint Satisfaction , 2005, CP.

[13]  J. A. Robinson,et al.  A Machine-Oriented Logic Based on the Resolution Principle , 1965, JACM.

[14]  Flemming Nielson,et al.  Principles of Program Analysis , 1999, Springer Berlin Heidelberg.

[15]  Jun Yang Explaining Type Errors by Finding the Source of a Type Conflict , 1999, Scottish Functional Programming Workshop.

[16]  Kwangkeun Yi,et al.  A Generalized Let-Polymorphic Type Inference Algorithm , 2000 .

[17]  Daan Leijen,et al.  Helium, for learning Haskell , 2003, Haskell '03.

[18]  S. Doaitse Swierstra,et al.  Ruler: Programming Type Rules , 2006, FLOPS.

[19]  Geoffrey Smith,et al.  A Type-Based Approach to Program Security , 1997, TAPSOFT.

[20]  Kwangkeun Yi,et al.  A Generalization of Hybrid Let-Polymorphic Type Inference Algorithms , 2000, APLAS.

[21]  Bruce James McAdam On the unification of substitutions in type inference , 1999 .

[22]  Benjamin C. Pierce,et al.  Advanced Topics In Types And Programming Languages , 2004 .

[23]  Jurriaan Hage,et al.  Heuristics for Type Error Discovery and Recovery , 2006, IFL.