Type Of preserves valid refs
Cedar.Thm.typeOf_preserves_valid_refs
Plain-language statement
typeOf preserves Entities.ValidRefsFor. The converse is not true, due to policies with invalid UID literals, such as // entity User enum ["alice"]; permit(principal, action, resource) when { if true then User::"alice" else User::"bob" };
Exact Lean statement
theorem typeOf_preserves_valid_refs
{Γ : TypeEnv} (entities : Entities)
{expr : Expr} {tx : TypedExpr} {c₁ c₂ : Capabilities}
(hty : typeOf expr c₁ Γ = Except.ok (tx, c₂))
(hrefs : entities.ValidRefsFor expr) :
entities.ValidRefsFor tx.toExprFormal artifact
Lean source
theorem typeOf_preserves_valid_refs {Γ : TypeEnv} (entities : Entities) {expr : Expr} {tx : TypedExpr} {c₁ c₂ : Capabilities} (hty : typeOf expr c₁ Γ = Except.ok (tx, c₂)) (hrefs : entities.ValidRefsFor expr) : entities.ValidRefsFor tx.toExpr:= by cases expr with | lit p => exact typeOf_preserves_valid_refs_lit entities hty hrefs | var v => exact typeOf_preserves_valid_refs_var entities hty hrefs | and e₁ e₂ => apply typeOf_preserves_valid_refs_and entities hty hrefs · intros tx c c'; apply typeOf_preserves_valid_refs · intros tx c c'; apply typeOf_preserves_valid_refs | or e₁ e₂ => apply typeOf_preserves_valid_refs_or entities hty hrefs · intros tx c c'; apply typeOf_preserves_valid_refs · intros tx c c'; apply typeOf_preserves_valid_refs | ite e₁ e₂ e₃ => apply typeOf_preserves_valid_refs_ite entities hty hrefs · intros tx c c'; apply typeOf_preserves_valid_refs · intros tx c c'; apply typeOf_preserves_valid_refs · intros tx c c'; apply typeOf_preserves_valid_refs | unaryApp _ e => apply typeOf_preserves_valid_refs_unaryApp entities hty hrefs intros tx c c'; apply typeOf_preserves_valid_refs | binaryApp _ e₁ e₂ => apply typeOf_preserves_valid_refs_binaryApp entities hty hrefs · intros tx c c'; apply typeOf_preserves_valid_refs · intros tx c c'; apply typeOf_preserves_valid_refs | getAttr e _ => apply typeOf_preserves_valid_refs_getAttr entities hty hrefs intros tx c c'; apply typeOf_preserves_valid_refs | hasAttr e _ => apply typeOf_preserves_valid_refs_hasAttr entities hty hrefs intros tx c c'; apply typeOf_preserves_valid_refs | set s => apply typeOf_preserves_valid_refs_set entities hty hrefs intros x hmem_x tx c c' apply typeOf_preserves_valid_refs | call _ args => apply typeOf_preserves_valid_refs_call entities hty hrefs intros arg hmem_arg tx c c' apply typeOf_preserves_valid_refs | record rec => apply typeOf_preserves_valid_refs_record entities hty hrefs intros attr hmem_attr tx c c' apply typeOf_preserves_valid_refs- Project
- Cedar Specification
- License
- Apache-2.0
- Commit
- 3f093947b8ae
- Source
- cedar-lean/Cedar/Thm/SymCC/ValidRefs.lean:517-564
Reuse this declaration
Bring the exact result into your workflow
The import identifies the source module. Your project still needs the pinned package dependency shown on this page.
What this badge means
This completion status comes from the project or community source. It has not yet been represented here as an independent rebuild and axiom audit.
Continue in this project
Related declarations
Find? ext
Cedar.Data.Map.find?_ext
Plain-language statement
Two well-formed maps are equal if they have the same find? for every key.
Source project: Cedar Specification
Person-level attribution pending.
Find? notmem keys
Cedar.Data.Map.find?_notmem_keys
Plain-language statement
Inverse of find?_mem_toList, except that this requires wf
Source project: Cedar Specification
Person-level attribution pending.
Find? some iff in values
Cedar.Data.Map.find?_some_iff_in_values
Plain-language statement
The mp direction of this does not need the wf precondition and, in fact, is available separately as find?_some_implies_in_values above
Source project: Cedar Specification
Person-level attribution pending.