Documentation

Cedar.SymCC.Solver

This file defines a simple interface to an SMT solver running in a separate process. Callers communicate with the solver by issuing commands with s-expressions encoded as strings. The interface is based on lean-smt.

Currently, we support only CVC5. The function cvc5 creates a fresh CVC5 solver process. This function assumes that the environment variable CVC5 contains the absolute path to the CVC5 executable.

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

      A Solver is an interpreter for SMTLib scripts, which are passed to the solver via its smtLibInput stream. Solvers optionally have an smtLibOutput stream to which they print the results of executing the commands received on the input stream. We assume that both the input and output streams conform to the SMTLib standard: the inputs are SMTLib script commands encoded as s-expressions, and the outputs are the s-expressions whose shape is determined by the standard for each command. We don't have an error stream here, since we configure solvers to run in quiet mode and not print anything to the error stream.

      Instances For
        @[reducible, inline]
        Equations
        Instances For
          def Cedar.SymCC.SolverM.run {α : Type} (solver : Solver) (x : SolverM α) :
          IO α
          Equations
          Instances For

            Returns a Solver for the given path and arguments. This function expects path to point to an SMT solver executable, and args to specify valid arguments to that solver.

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

              Returns an instance of the CVC5 solver that is backed by the executable specified in the environment variable "CVC5".

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

                Returns a solver that writes all issued commands to the given stream s. Commands that produce output, such as checkSat, write the command to s and return values that are sound according to the SMTLib spec (but generally not useful). For example, Solver.checkSat returns Decision.unknown. This function expects s to be write-enabled.

                Equations
                Instances For

                  Returns a solver that writes all issued commands to the given file handle h. Commands that produce output, such as checkSat, write the command to h and return values that are sound according to the SMTLib spec (but generally not useful). For example, Solver.checkSat returns Decision.unknown. This function expects h to be write-enabled.

                  Equations
                  Instances For

                    Returns a solver that writes all issued commands to the given buffer b. Commands that produce output, such as checkSat, write the command to b and return values that are sound according to the SMTLib spec (but generally not useful). For example, Solver.checkSat returns Decision.unknown.

                    Equations
                    Instances For

                      Returns a solver that drops/ignores all issued commands. Commands that produce output, such as checkSat, return values that are sound according to the SMTLib spec (but generally not useful). For example, Solver.checkSat returns Decision.unknown.

                      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
                            def Cedar.SymCC.Solver.declareDatatype (id : String) (params constructors : List String) :
                            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 model from the SMT solver, assuming that checkSat produced a .sat decision. Note that this model extraction procedure assumes that the model strings follow the CVC5 format, where the model is enclosed in parentheses that are on a single line by themselves, i.e., opens with the line (\n and closes with the line )\n.

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