Skip to content
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

Add Expr.ext to contain extension values #546

Closed
wants to merge 6 commits into from

Conversation

shaobo-he-aws
Copy link
Contributor

Issue #, if available:

Description of changes:

Signed-off-by: Shaobo He <shaobohe@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
Signed-off-by: Shaobo He <shaobohe@amazon.com>
@@ -181,4 +186,108 @@ theorem policy_produces_bool_or_error (p : Policy) (request : Request) (entities
unfold Policy.toExpr
apply and_produces_bool_or_error

def Value.toExpr : Value → Expr
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's move these definitions into Cedar/Thm/PE/Basic.lean, and then move all proofs related to them to modules in Cedar/Thm/PE/.

Basically, we want to keep definitions and theorems related to PE in its own folder, similar to the definitions and proofs for validation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can avoid the termination proof if you rewrite the definition as follows:

def Value.toExpr : Value → Expr
  | .prim p => .lit p
  | .ext e => .ext e
  | .set (.mk vs) => .set (vs.map₁ λ ⟨v, _⟩ => Value.toExpr v)
  | .record (.mk avs) => .record (avs.attach₃.map λ ⟨(k, v), _⟩ => (k, Value.toExpr v))

Signed-off-by: Shaobo He <shaobohe@amazon.com>
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.

2 participants