Documentation

Cedar.SymCC.Enforcer

This file defines the algorithm for emitting well-formedness assumptions about Cedar hierarchies. A valid Cedar hierarchy graph is the irreflexive transitive closure of a DAG. (Note that the in operator is reflexive, but this is enforced separately by the semantics, and it's not needed in the hierarchy.)

The generated assumptions are expressed as Terms that enforce the acyclicty and transitivity constraints on the symbolic store, for a given Cedar expression.

The grounding relies on the fact that a Cedar expression can reference only a finite number of entities (so the domain of the quantification is finite), and we can compute an overapproximation of that set by statically analyzing the expression. We call this set the footprint of the expression x, and it consists of all subexpressions of x that could have an Entity type. The grounding procedure computes the footprint, and grounds the acyclicity and transitivity constraints on the set of entity terms in the footprint.

@[irreducible]

Returns the terms corresponding to subexpressions of x of the following form:

  • A variable term with an entity type
  • An entity reference literal
  • An attribute access expression with an entity type
  • A binary (getTag) expression with an entity type

These are the only basic expressions in Cedar that may evaluate to an entity. All other expressions that evaluate to an entity are build up from the above basic expresions.

All returned terms are of type TermType.option .entity.

Equations
Instances For
    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Cedar.SymCC.footprint.ofBranch (εnv : SymEnv) (x₁ : Spec.Expr) (ft₁ ft₂ ft₃ : Data.Set Term) :
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For

        Returns the set of Terms corresponding to the footprints of xs.

        Equations
        Instances For

          Returns the acyclicity constraint for the given term.

          Equations
          • One or more equations did not get rendered due to their size.
          Instances For
            def Cedar.SymCC.transitivity (t₁ t₂ : Term) (εs : SymEntities) :

            Returns the transitivity constraint for the given term.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def Cedar.SymCC.transitivity.isAncestor (t₁ t₂ t₂' t₁' : Term) (f₁₂ : UnaryFunction) :
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                def Cedar.SymCC.transitivity.areAncestorsOfType (εs : SymEntities) (t₂' : Term) (f₂₃ : UnaryFunction) (ety₃ : Spec.EntityType) (t₁' : Term) (ety₁ : Spec.EntityType) :
                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

                    Returns the ground acyclicity and transitivity assumptions for xs and env.

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