Documentation

Cedar.SymCC.Compiler

This file defines the Cedar symbolic compiler.

The symbolic compiler takes as input a Cedar expression and a symbolic environment. Given these inputs, it produces a Term encoding of the expression.

If the compiler returns a Term, this Term represents a sound and complete encoding of the input expression's semantics with respect to the given environment: using this Term for verification will neither miss bugs (soundness) nor produce false positives (completeness).

def Cedar.SymCC.compileApp₂ (op₂ : Spec.BinaryOp) (t₁ t₂ : Term) (εs : SymEntities) :
Equations
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
          def Cedar.SymCC.compileIf (t₁ : Term) (r₂ r₃ : Result Term) :
          Equations
          Instances For

            This is an iterative implementation of the compilation of extended has. We also define a proved equivalent recursive implementation in Cedar.Thm.SymCC.Compiler.ExtHasAttrRec that is easier to use in proofs.

            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              Equations
              Instances For
                Equations
                Instances For
                  def Cedar.SymCC.compileCall₀ {α : Type u_1} [Coe α Spec.Ext] (mk : String → Option α) :
                  Equations
                  Instances For
                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For
                      Equations
                      Instances For
                        def Cedar.SymCC.compileCallWithError₂ (xty₁ xty₂ : Validation.ExtType) (enc : Term → Term → Term) (t₁ t₂ : Term) :
                        Equations
                        • One or more equations did not get rendered due to their size.
                        Instances For
                          def Cedar.SymCC.compileCall₂ (xty : Validation.ExtType) (enc : Term → Term → Term) (t₁ t₂ : Term) :
                          Equations
                          Instances For

                            Variadic version of compileCall₂ for a non-erroring call whose target t and all arguments ts share extension type xty. Errors (.typeError) unless every term has type .option (.ext xty); otherwise encodes enc under nested ifSome guards so that a .none in any position propagates as .none, mirroring the concrete evaluator's error propagation.

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

                                Given an expression x that has type τ with respect to a type environment Γ, and given a well-formed symbolic environment εnv that conforms to Γ, compile x εnv succeeds and produces a well-formed term of type .option τ.toTermType.

                                Equations
                                Instances For