argumentcomputer / yatima

A zero-knowledge Lean4 compiler and kernel
MIT License
114 stars 8 forks source link

debugging the typechecker + lambda inference refactor #207

Closed rish987 closed 1 year ago

rish987 commented 1 year ago

We're almost there! We can use this PR to finish up work on getting all of the prelude to typecheck, as well as to do any finishing touches (refactors etc.). So far:

  1. Adds primitive Nat.decLt and Nat.decLe operations.
  2. Adds support for typechecking partial definitions (including those within mutual blocks).
  3. Refactors the original NbE bidirectional checking system to be more like the typechecker that Lean itself uses, in particular check now simply infers and checks, and infer handles every case (including lambdas). This ensures that we correctly handle the case of applied lambdas (i.e. redexes), which are infrequent but do indeed occur throughout the Lean stdlib.
  4. Bug fixes and necessary refactors related to (3).