Skip to content

Conversation

@joscoh
Copy link
Contributor

@joscoh joscoh commented Jan 17, 2026

Description of changes:
Adds mutually recursive types to Lambda and its corresponding SMT generation (declare-datatypes). In particular, mutually recursive types generate multiple eliminators, which still have the expected computational behavior. This PR includes tests in TypeFactoryTests.lean for eliminators, other derived functions, and typechecking and in SMTEncoderDatatypeTest.lean and DatatypeVerificationTest.lean for SMT output and verification.
Some key changes:

  1. Core declarations can now have multiple declarations (and likewise multiple names)
  2. The SMT output becomes simpler. We no longer need dependency analysis to rule out mutually recursive types, instead checking type references when a mutual block is created and therefore maintaining a topological order.

Right now, the proofs in ProgramWF.lean are broken; they will be fixed.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Josh Cohen added 6 commits January 16, 2026 11:58
Generate eliminators for mutual recursive types
Change Boogie TypeDecl to take in List
Leave ProgramWF proofs as sorry for now
Change strict positivity+uniformity checks for mutually recursive types
Remove topological ordering, require TypeContext for order
Adds tests for mutually recursive SMT encoding and for Boogie verif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant