https://github.com/andreasabel/constraint-based-type-inference
Agda formalization of constraint-based type inference for the simply-typed lambda-calculus
https://github.com/andreasabel/constraint-based-type-inference
Last synced: 3 months ago
JSON representation
Agda formalization of constraint-based type inference for the simply-typed lambda-calculus
- Host: GitHub
- URL: https://github.com/andreasabel/constraint-based-type-inference
- Owner: andreasabel
- License: bsd-3-clause
- Created: 2024-02-06T20:10:07.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-06T20:37:00.000Z (over 2 years ago)
- Last Synced: 2025-10-10T19:20:38.202Z (9 months ago)
- Language: Agda
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# constraint-based-type-inference
An Agda formalization of constraint-based type inference for the simply-typed lambda-calculus.
Uses a de Bruijn representation of type variables.
The implementation of the occurs-check follows:
> Conor McBride, First-Order Unification by Structural Recursion, Journal of Functional Programming, 2003.
Type inference is split into a first pass extracting constraints between types,
and a second pass solving the constraints by first-order unification.
Constraint-based type inference has been systematically described by:
> Francois Pottier and Didier Rémy, The Essence of ML Type Inference.
> In B. C. Pierce, Advanced Topics in Types and Programming Languages, The MIT Press, 2004.
So do not expect any new ideas here. Just enjoy the Agda code!
Limitations (as of 2024-02-06):
- Just specification (judgements), no algorithm (functions).
- Only soundness, no completeness.
- No `let`-generalization / ML-polymorphism.
Tested with:
- Agda 2.6.4.1 and agda-stdlib 2.0
Related work:
- https://github.com/wenkokke/FirstOrderUnificationInAgda