-
Notifications
You must be signed in to change notification settings - Fork 23
Add mutually recursive types to Lambda #333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
Also includes tests
Remove topological ordering, require TypeContext for order Adds tests for mutually recursive SMT encoding and for Boogie verif
So, so nice! |
shigoel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Partial review for now.
MikaelMayer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR adds mutually recursive types to Lambda, which is a significant and well-implemented feature. The implementation is thorough with comprehensive tests covering eliminators, testers, destructors, and error cases. The SMT encoding has been simplified by maintaining topological order in the TypeFactory. Overall, this is solid work that extends the type system in a principled way.
Critical issue: There is a bug in validateMutualBlock that prevents duplicate name detection. This should be fixed before merging.
shigoel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some questions/comments. Looks great, thanks!
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 inTypeFactoryTests.leanfor eliminators, other derived functions, and typechecking and inSMTEncoderDatatypeTest.leanandDatatypeVerificationTest.leanfor SMT output and verification.Some key changes:
ProgramWF.lean, which now have more structure but also more repetition. They can/should be improved in a future PR.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.