Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds end-to-end support for CST record literals (Primary.rInits) by extending the CST definition, implementing translation to AST records, defining CST evaluation semantics for records, and proving translation/evaluation agreement lemmas used by the existing translation correctness theorems.
Changes:
- Extend
Cedar.Spec.Cst.PrimarywithrInitsand introduceCst.RecInit. - Translate record literals to
Expr.recordviarInitsToMap?and add record-key validation (ExprOrSpecial.toValidAttr?). - Define CST-side record-key extraction (
*.toAttr?) and record evaluation semantics, plus agreement proofs bridging CST evaluation and translated AST evaluation.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
cedar-lean/Cedar/Thm/Translation/ExprTranslation.lean |
Adds the rInits proof case for toAExpr?_evaluate, using the new record evaluation agreement lemma. |
cedar-lean/Cedar/Thm/Translation/Aux.lean |
Adds record-key consistency lemmas and evaluation-bridge theorems needed to prove the rInits translation/evaluation agreement. |
cedar-lean/Cedar/Spec/CstToAst.lean |
Implements record literal translation (rInitsToMap?) and record-key validation (ExprOrSpecial.toValidAttr?). |
cedar-lean/Cedar/Spec/CstSemantics.lean |
Defines structural record-key extraction (Ident/Primary/Expr.toAttr?) and CST evaluation semantics for record literals. |
cedar-lean/Cedar/Spec/Cst.lean |
Adds Primary.rInits and the RecInit structure to represent record initializers in the CST. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
victornicolet
approved these changes
Jun 9, 2026
| (o.bind (fun a => some (ExprOrSpecial.expr (g a)))).bind ExprOrSpecial.toValidAttr? = none := by | ||
| cases o <;> simp [ExprOrSpecial.toValidAttr?] | ||
|
|
||
| set_option linter.unusedSimpArgs false in |
Collaborator
There was a problem hiding this comment.
Do you need this option in the final proof?
Owner
Author
There was a problem hiding this comment.
I don't plan to. I wanted to delete it but then forgot. I'll remove it in the next pull request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.