Documentation

Cedar.SymCC.Encoder

This file defines the Cedar encoder, which translates a list of boolean Terms into a list of SMT assertions. Term encoding is trusted.

We will use the following type representations for primitive types:

We will represent non-primitive types as SMT algebraic datypes:

Similarly to types and attributes, all uninterpreted functions, variables, and Terms are mapped to their SMT encoding that conforms to the SMTLib syntax. We keep track of these mappings to ensure that each Term construct is translated to its SMT encoding exactly once. This translation invariant is necessary for correctness in the case of record type declarations, UF names, and variable names; and it is neccessary for compactness in the case of terms. In particular, the resulting SMT encoding will be in A-normal form (ANF): the body of every s-expression in the encoding consists of atomic subterms (identifiers or literals).

Equations
  • One or more equations did not get rendered due to their size.
Instances For
    def Cedar.SymCC.Encoder.encode (ts : List Term) (εnv : SymEnv) (produceModels : Bool := false) :

    Once you've generated Asserts with one of the functions in Verifier.lean, you can use this function to encode them as SMTLib assertions.

    To actually solve these SMTLib assertions, you want to combine this encode action with other SolverM actions, such as Solver.check-sat at a minimum.

    Then you can run any SolverM action act with act |>.run solver, where solver is a Solver instance you can construct using functions in Solver.lean.

    Note that encode itself first resets the solver in order to define datatypes etc.

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