Documentation

Cvc.Basic.Error

Errors #

Cvc.Error is what every failing operation of this library throws, Res/ResT the result types carrying one, and throwUser and friends the ways to throw one.

inductive Cvc.Error :

The error type of this library.

  • internal (msg : String) : Error

    A failure inside this library.

  • unsupported (msg : String) : Error

    Unsupported feature.

  • user (msg : String) : Error

    A misuse of the library or of cvc5, including every error cvc5 reports.

  • io (msg : String) : Error

    Input/output error.

Instances For
    def Cvc.Error.append (self : Error) (txt : String) (newline : Bool := true) :

    Appends some text to an error's internal message.

    Equations
    Instances For

      String representation.

      Equations
      Instances For
        @[instance_reducible]
        Equations
        def Cvc.Error.throwUser {m : Type u_1 → Type u_2} [MonadExcept Error m] (msg : String) {α : Type u_1} :
        m α

        Throws an Error.user.

        Equations
        Instances For
          def Cvc.Error.someOrThrowUser {m : Type u_1 → Type u_2} [Monad m] [MonadExcept Error m] (msg : String) {α : Type u_1} :
          Option α → m α

          Unwraps an Option, throwing an Error.user on none.

          Equations
          Instances For
            def Cvc.Error.throwInternal {m : Type u_1 → Type u_2} [MonadExcept Error m] (msg : String) {α : Type u_1} :
            m α

            Throws an Error.internal.

            Equations
            Instances For
              def Cvc.Error.throwTodo {m : Type u_1 → Type u_2} [MonadExcept Error m] (msg : String) {α : Type u_1} :
              m α

              Throws an Error.internal with an unsupported-feature message.

              Equations
              Instances For
                def Cvc.Error.throwUnreachable {m : Type u_1 → Type u_2} [MonadExcept Error m] {α : Type u_1} (msg : String := "") :
                m α

                Throws an Error.internal reporting that unreachable code was reached.

                Equations
                Instances For
                  def Cvc.Error.throwIO {m : Type u_1 → Type u_2} [MonadExcept Error m] {α : Type u_1} (e : IO.Error) :
                  m α

                  Throws an Error.io.

                  Equations
                  Instances For
                    def Cvc.Error.explainError {m : Type u_1 → Type u_2} [MonadExcept Error m] {α : Type u_1} (code : m α) (explain : Unit → Option String) :
                    m α

                    code, failing with the user error explain gives, if it gives one, when code fails.

                    Equations
                    Instances For
                      def Cvc.errorContext {m : Type u_1 → Type u_2} {α : Type u_1} [Monad m] [MonadExcept Error m] (s : Unit → String) (code : m α) :
                      m α

                      Sets an error context as a lazy string to newline-append after code's error, if any.

                      Equations
                      Instances For
                        @[reducible, inline]
                        abbrev Cvc.ResT (m : Type → Type) (α : Type) :

                        Error-result monad transformer.

                        Equations
                        Instances For
                          @[reducible, inline]
                          abbrev Cvc.Res (α : Type) :

                          Error monad.

                          Equations
                          Instances For
                            @[reducible, inline]
                            abbrev Cvc.Res.ok {α : Type} (a : α) :
                            Res α

                            A success value of type α

                            Equations
                            Instances For
                              @[reducible, inline]
                              abbrev Cvc.Res.error {α : Type} (e : Error) :
                              Res α

                              A failure value of type ε

                              Equations
                              Instances For
                                @[instance_reducible]
                                Equations