Documentation

Cedar.Thm.External.PartialSchema

Every ancestor set is transitively closed. TODO: it is a bit suprising how this does not already exists. Maybe define it for complete schema and see if it is useful for proving some nice facts about schema.

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    No external entity type declaration lists an enum entity type as a parent: a definition of the external must list the parent, so only a declaration of the parent, which an enum definition cannot be, can supply it.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For

      A partial schema is well-formed when its definitions satisfy the existing schema conditions, its externals satisfy those conditions using only their known ancestors, and no external lists an enum entity type as a parent.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        The environment in which PartialSchema.WellFormed checks a partial schema and PartialSchema.validateEntities validates entities: the validation view with the default request type.

        Equations
        Instances For

          t keeps every declaration of s: its entity types with their definitions, standard entity types, and listed ancestors, and its actions with their ancestors and definitions.

          Instances For

            z keeps the definition, the standard kind, and the ancestors of the entity entry x.

            Instances For

              The definition that completes an entity entry: its definition, or a standard entity type with its ancestors, the attributes attrs, and no tags.

              Equations
              Instances For

                The schema that completes p: it defines each external entity type of p with the attributes attrs, and each external action by its validation view.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  theorem Cedar.Validation.toPartialSchema_asSchema? (schema : Schema) :
                  (↑schema).asSchema? = some schema

                  Coercing a schema to a partial schema and back preserves it.

                  Coercing a schema to a partial schema preserves its validation view.

                  Coercing a schema to a partial schema defines each of its entity types.

                  Coercing a schema to a partial schema defines each of its actions.

                  theorem Cedar.Validation.toPartialSchema_wfEnv (schema : Schema) :
                  (↑schema).wfEnv = { ets := schema.ets, acts := schema.acts, reqty := default }

                  A coerced schema is checked in the environment with its own maps.

                  A partial schema converts to a schema exactly when it is complete.

                  The entity validation view maps the entry found in the partial schema.

                  The action validation view maps the entry found in the partial schema.

                  A completed partial schema agrees with its validation view.

                  The validation view keeps whether an entity type is standard or external.

                  A standard or external entity type accepts every entity id in the validation view.

                  Replacing ancestors keeps an entry standard or external.

                  A well-formed partial schema has a well-formed entity map.

                  A well-formed partial schema has a well-formed action map.

                  Each entity entry of wfEnv is the view of an entry of the partial schema.

                  Each action entry of wfEnv is the view of an entry of the partial schema.

                  wfEnv declares the entity types of the partial schema.

                  wfEnv declares the actions of the partial schema.

                  In a well-formed partial schema, the view of each entity entry is well-formed.

                  In a well-formed partial schema, the view of each action is well-formed.

                  In a well-formed partial schema, no parent of an external entity type is an enum.

                  theorem Cedar.Validation.PartialSchema.WellFormed.ancestor_declared {schema : PartialSchema} {ety ancestor : Spec.EntityType} {entry : PartialEntitySchemaEntry} (h : schema.WellFormed) (hfind : Data.Map.find? schema.ets ety = some entry) (hmem : ancestor ∈ entry.ancestors) :
                  ∃ (entry' : PartialEntitySchemaEntry), Data.Map.find? schema.ets ancestor = some entry'

                  In a well-formed partial schema, every ancestor of an entity type is declared.

                  theorem Cedar.Validation.PartialSchema.WellFormed.action_ancestor {schema : PartialSchema} {uid ancestor : Spec.EntityUID} {entry : PartialActionSchemaEntry} (h : schema.WellFormed) (hfind : Data.Map.find? schema.acts uid = some entry) (hmem : ancestor ∈ entry.ancestors) :
                  Data.Map.contains schema.acts ancestor = true

                  In a well-formed partial schema, every ancestor of an action is an action.

                  theorem Cedar.Validation.PartialSchema.WellFormed.acyclic {schema : PartialSchema} {uid : Spec.EntityUID} {entry : PartialActionSchemaEntry} (h : schema.WellFormed) (hfind : Data.Map.find? schema.acts uid = some entry) :
                  ¬uid ∈ entry.ancestors

                  A well-formed partial schema has no action among its own ancestors.

                  theorem Cedar.Validation.PartialSchema.WellFormed.transitive {schema : PartialSchema} {uid₁ uid₂ : Spec.EntityUID} {entry₁ entry₂ : PartialActionSchemaEntry} (h : schema.WellFormed) (hfind₁ : Data.Map.find? schema.acts uid₁ = some entry₁) (hfind₂ : Data.Map.find? schema.acts uid₂ = some entry₂) (hmem : uid₂ ∈ entry₁.ancestors) :
                  entry₂.ancestors ⊆ entry₁.ancestors

                  A well-formed partial schema has transitively closed action ancestors.

                  A well-formed partial schema declares no action type as an entity type.

                  In a well-formed partial schema, every entity entry has well-formed ancestors.

                  With closed ancestors, every entity type reachable through listed ancestors is listed.

                  An external action's view is well-formed when its ancestors are a well-formed set of actions.

                  An entity type well-formed for s is well-formed for t.

                  A type well-formed for s is well-formed for t.

                  theorem Cedar.Validation.DeclarationsKept.ancestor_declared {s t : PartialSchema} (h : DeclarationsKept s t) (hs : s.WellFormed) {ety ancestor : Spec.EntityType} {entry : PartialEntitySchemaEntry} (hfind : Data.Map.find? s.ets ety = some entry) (hmem : ancestor ∈ entry.ancestors) :

                  An ancestor listed in a well-formed s is declared in t.

                  A definition of a well-formed s is well-formed in t.

                  An action of a well-formed s is well-formed in t.

                  theorem Cedar.Validation.DeclarationsKept.transitive {s t : PartialSchema} (h : DeclarationsKept s t) (hs : s.WellFormed) {uid₁ uid₂ : Spec.EntityUID} {entry₁ entry₂ : PartialActionSchemaEntry} (hfind₁ : Data.Map.find? s.acts uid₁ = some entry₁) (hfind₂ : Data.Map.find? t.acts uid₂ = some entry₂) (hmem : uid₂ ∈ entry₁.ancestors) :
                  entry₂.ancestors ⊆ entry₁.ancestors

                  In t, the ancestors of an ancestor of an action of a well-formed s are ancestors of that action.

                  Keeping declarations is transitive.

                  The entry of t for an entity type of s keeps the entry of s.

                  Well-formed partial schemas that keep each other's declarations are equal.

                  theorem Cedar.Validation.DeclarationsKept.eq_toPartialSchema {t : PartialSchema} {schema : Schema} (hets : Data.Map.WellFormed t.ets) (hacts : Data.Map.WellFormed t.acts) (hschema : (↑schema).WellFormed) (hts : DeclarationsKept t ↑schema) (hst : DeclarationsKept (↑schema) t) :
                  t = ↑schema

                  A partial schema with well-formed maps is a schema that it keeps and that keeps it.

                  Completing a partial schema completes each of its entity entries.

                  Completing with no attributes gives the validation view.

                  Completing an entry keeps its ancestors.

                  Completing an entry keeps whether it is standard or external.

                  The partial schema of a completion defines each entity type of p by its completion.

                  The partial schema of a completion defines each action of p by its validation view.

                  Completing p keeps the declarations of p.

                  Completing a well-formed partial schema with well-formed lifted attributes is well-formed.