This file contains the definition of well-formedness of TypeEnv
and related definitions. #
def
Cedar.Validation.ActionSchema.IsActionEntityType
(acts : ActionSchema)
(ety : Spec.EntityType)
:
Equations
Instances For
Either a non-action entity type in env.ets,
or an action entity type in env.acts.
Equations
- Cedar.Validation.EntityType.WellFormed env ety = (env.ets.contains ety = true ∨ env.acts.IsActionEntityType ety)
Instances For
- optional_wf {env : TypeEnv} {ty : CedarType} (h : CedarType.WellFormed env ty) : WellFormed env (Qualified.optional ty)
- required_wf {env : TypeEnv} {ty : CedarType} (h : CedarType.WellFormed env ty) : WellFormed env (Qualified.required ty)
Instances For
Defines when a CedarType is well-formed in an TypeEnv.
- bool_wf {env : TypeEnv} {bty : BoolType} : WellFormed env (bool bty)
- int_wf {env : TypeEnv} : WellFormed env int
- string_wf {env : TypeEnv} : WellFormed env string
- entity_wf {env : TypeEnv} {ety : Spec.EntityType} (h : EntityType.WellFormed env ety) : WellFormed env (entity ety)
- set_wf {env : TypeEnv} {ty : CedarType} (h : WellFormed env ty) : WellFormed env ty.set
- record_wf {env : TypeEnv} {rty : RecordType} (h₁ : Data.Map.WellFormed rty) (h₂ : ∀ (attr : Spec.Attr) (qty : QualifiedType), Data.Map.find? rty attr = some qty → QualifiedType.WellFormed env qty) : WellFormed env (record rty)
- ext_wf {env : TypeEnv} {xty : ExtType} : WellFormed env (ext xty)
Instances For
- optional_lifted {ty : CedarType} (h : ty.IsLifted) : IsLifted (Qualified.optional ty)
- required_lifted {ty : CedarType} (h : ty.IsLifted) : IsLifted (Qualified.required ty)
Instances For
Defines when a CedarType does not have any singleton Bool types.
- bool_lifted : (bool BoolType.anyBool).IsLifted
- int_lifted : int.IsLifted
- string_lifted : string.IsLifted
- entity_lifted {ety : Spec.EntityType} : (entity ety).IsLifted
- set_lifted {ty : CedarType} (h : ty.IsLifted) : ty.set.IsLifted
- record_lifted {rty : RecordType} (h₂ : ∀ (attr : Spec.Attr) (qty : QualifiedType), (attr, qty) ∈ Data.Map.toList rty → QualifiedType.IsLifted qty) : (record rty).IsLifted
- ext_lifted {xty : ExtType} : (ext xty).IsLifted
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- acts.AcyclicActionHierarchy = ∀ (uid : Cedar.Spec.EntityUID) (entry : Cedar.Validation.ActionSchemaEntry), Cedar.Data.Map.find? acts uid = some entry → ¬uid ∈ entry.ancestors
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- env.WellFormed = (Cedar.Validation.EntitySchema.WellFormed env env.ets ∧ Cedar.Validation.ActionSchema.WellFormed env env.acts ∧ Cedar.Validation.RequestType.WellFormed env env.reqty)
Instances For
theorem
Cedar.Validation.qty_wf_implies_type_of_wf
{env : TypeEnv}
{qty : Qualified CedarType}
(h : QualifiedType.WellFormed env qty)
:
CedarType.WellFormed env qty.getType
theorem
Cedar.Validation.wf_record_type_cons
{env : TypeEnv}
{hd : Spec.Attr × Qualified CedarType}
{tl : List (Spec.Attr × Qualified CedarType)}
(hwf : CedarType.WellFormed env (CedarType.record (Data.Map.mk (hd :: tl))))
:
CedarType.WellFormed env hd.snd.getType ∧ CedarType.WellFormed env (CedarType.record (Data.Map.mk tl))
theorem
Cedar.Validation.wf_record_implies_wf_attr
{env : TypeEnv}
{rty : RecordType}
{attr : Spec.Attr}
{qty : QualifiedType}
(hwf : CedarType.WellFormed env (CedarType.record rty))
(hqty : Data.Map.find? rty attr = some qty)
:
QualifiedType.WellFormed env qty
theorem
Cedar.Validation.wf_env_implies_wf_entity_schema_entry
{env : TypeEnv}
{ety : Spec.EntityType}
{entry : EntitySchemaEntry}
(hwf : env.WellFormed)
(hets : Data.Map.find? env.ets ety = some entry)
:
EntitySchemaEntry.WellFormed env entry
theorem
Cedar.Validation.wf_env_implies_wf_tag_type
{env : TypeEnv}
{ety : Spec.EntityType}
{ty : CedarType}
(hwf : env.WellFormed)
(hety : env.ets.tags? ety = some (some ty))
:
CedarType.WellFormed env ty
theorem
Cedar.Validation.wf_env_implies_tag_type_lifted
{env : TypeEnv}
{ety : Spec.EntityType}
{ty : CedarType}
(hwf : env.WellFormed)
(hety : env.ets.tags? ety = some (some ty))
:
ty.IsLifted
theorem
Cedar.Validation.wf_env_implies_wf_attrs
{env : TypeEnv}
{ety : Spec.EntityType}
{attrs : RecordType}
(hwf : env.WellFormed)
(hattrs : env.ets.attrs? ety = some attrs)
:
CedarType.WellFormed env (CedarType.record attrs)
theorem
Cedar.Validation.wf_env_implies_attrs_lifted
{env : TypeEnv}
{ety : Spec.EntityType}
{attrs : RecordType}
(hwf : env.WellFormed)
(hattrs : env.ets.attrs? ety = some attrs)
:
(CedarType.record attrs).IsLifted
theorem
Cedar.Validation.wf_env_implies_action_wf
{env : TypeEnv}
(hwf : env.WellFormed)
:
EntityUID.WellFormed env env.reqty.action
theorem
Cedar.Validation.wf_env_disjoint_ets_acts
{env : TypeEnv}
{uid : Spec.EntityUID}
{ets_entry : EntitySchemaEntry}
{acts_entry : ActionSchemaEntry}
(hwf : env.WellFormed)
(hets : Data.Map.find? env.ets uid.ty = some ets_entry)
(hacts : Data.Map.find? env.acts uid = some acts_entry)
:
theorem
Cedar.Validation.wf_env_implies_wf_request
{env : TypeEnv}
(hwf : env.WellFormed)
:
EntityType.WellFormed env env.reqty.principal ∧ env.acts.contains env.reqty.action = true ∧ EntityType.WellFormed env env.reqty.resource ∧ CedarType.WellFormed env (CedarType.record env.reqty.context)
More well-formedness properties of env.reqty.
theorem
Cedar.Validation.wf_env_implies_ctx_lifted
{env : TypeEnv}
(hwf : env.WellFormed)
:
(CedarType.record env.reqty.context).IsLifted
More well-formedness properties of env.reqty.
theorem
Cedar.Validation.wf_env_implies_wf_entity_entry
{env : TypeEnv}
{ety : Spec.EntityType}
{entry : EntitySchemaEntry}
(hwf : env.WellFormed)
(hfind : Data.Map.find? env.ets ety = some entry)
:
EntitySchemaEntry.WellFormed env entry
theorem
Cedar.Validation.wf_env_implies_wf_action_entity_entry
{env : TypeEnv}
{uid : Spec.EntityUID}
{entry : ActionSchemaEntry}
(hwf : env.WellFormed)
(hfind : Data.Map.find? env.acts uid = some entry)
:
ActionSchemaEntry.WellFormed env entry
theorem
Cedar.Validation.wf_env_implies_wf_action_entity_ancestor
{env : TypeEnv}
{uid anc : Spec.EntityUID}
{entry : ActionSchemaEntry}
(hwf : env.WellFormed)
(hfind : Data.Map.find? env.acts uid = some entry)
(hanc : anc ∈ entry.ancestors)
:
∃ (anc_entry : ActionSchemaEntry), Data.Map.find? env.acts anc = some anc_entry ∧ ActionSchemaEntry.WellFormed env anc_entry
Ancestor of an action entity should also be an action entity
theorem
Cedar.Validation.wf_env_implies_wf_ancestor
{env : TypeEnv}
{entry : EntitySchemaEntry}
{ety anc : Spec.EntityType}
(hwf : env.WellFormed)
(hfind : Data.Map.find? env.ets ety = some entry)
(hanc : anc ∈ entry.ancestors)
:
EntityType.WellFormed env anc
theorem
Cedar.Validation.wf_env_implies_wf_ancestor_set
{env : TypeEnv}
{entry : EntitySchemaEntry}
{ety : Spec.EntityType}
(hwf : env.WellFormed)
(hfind : Data.Map.find? env.ets ety = some entry)
:
entry.ancestors.WellFormed
theorem
Cedar.Validation.wf_env_implies_wf_action_ancestor_set
{env : TypeEnv}
{entry : ActionSchemaEntry}
{uid : Spec.EntityUID}
(hwf : env.WellFormed)
(hfind : Data.Map.find? env.acts uid = some entry)
:
entry.ancestors.WellFormed
theorem
Cedar.Validation.wf_env_implies_acyclic_action_hierarchy
{env : TypeEnv}
(hwf : env.WellFormed)
:
theorem
Cedar.Validation.wf_env_implies_transitive_action_hierarchy
{env : TypeEnv}
(hwf : env.WellFormed)
:
theorem
Cedar.Validation.wf_env_implies_ancestors_of_standard_ety_is_standard
{env : TypeEnv}
{ety : Spec.EntityType}
{entry : StandardSchemaEntry}
(hwf : env.WellFormed)
(hfind : Data.Map.find? env.ets ety = some (EntitySchemaEntry.standard entry))
(anc : Spec.EntityType)
:
theorem
Cedar.Validation.wf_env_implies_ancestors_of_action_is_action
{env : TypeEnv}
{uid : Spec.EntityUID}
{entry : ActionSchemaEntry}
(hwf : env.WellFormed)
(hfind : Data.Map.find? env.acts uid = some entry)
(uid✝ : Spec.EntityUID)
: