A Relational Solver for Constraint-based Type Inference
summary
A miniKanren-based type inferencer for the Lama educational language is implemented: it infers constraints from terms, solves them relationally, and applies substitutions to produce types; the system supports polymorphic and explicit recursive types by adding non-relational primitives like occurs-check hooks and a bind-hook primitive to register solutions on demand. The prototype typechecks the majority of compiler tests but shows exponential blowup for S-expression containment constraints (one test hits ~20s) and emits verbose recursive types; results are preliminary and optimizations partially mitigate the cost.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:05Relational programming approach
- 2:27Lama language type system
- 3:11Constraint syntax and satisfaction
- 4:42Relational optimizations
- 6:06Logic variables and substitutions
- 7:56Constraints and constructor forms
- 8:58Hook-based recursive types
- 10:45Recursive type handling
- 11:28Constraint ordering and performance
- 12:30Evaluation with L compiler
- 14:17Results and future research
- 15:03Q&A
