Documentation

Cvc.Srt.Defs

inductive Cvc.Srt.Kind :

A sort kind.

Instances For
    inductive Cvc.Srt :

    A cvc sort, Sort-coercion realized by Srt.toType.

    • abstract (kind : Kind) : Srt

      An abstract sort.

    • array (idx elm : Srt) : Srt

      Total map from an index sort to an element sort.

      Called array in SMT-LIB/cvc.

    • bag (elm : Srt) : Srt

      A multi-set/bag of elements.

    • bool : Srt

      Boolean sort.

    • bitVec (size : Nat) : Srt

      Sort of bit-vectors of length size.

    • finiteField (size : Nat) : Srt

      Finite field sort.

    • float (exp sig : UInt32) : Srt

      Floating-point sort.

    • function (dom cod : Srt) : Srt

      Function sort.

      Cvc5 actually takes an array of domains, and I think, does not allow the codomain to be a function sort. We're trying to adapt cvc5 sorts for a lean world by pretending they behave as lean function types.

    • int : Srt

      Integer sort.

    • prod (lft rgt : Srt) : Srt

      Product sort.

      Cvc5 has a notion of tuple or arity [0, ∞[, but that maps terribly to lean types. The goal with this constructor is to limit Srt creation to only (binary) products.

    • real : Srt

      Real sort.

    • regex : Srt

      Regular expression sort.

    • roundingMode : Srt

      Rounding mode sort.

    • seq (elm : Srt) : Srt

      Array sort, called sequence in SMT-LIB/cvc.

    • set (elm : Srt) : Srt

      Set sort.

    • string : Srt

      String sort.

    • unit : Srt

      Unit sort.

    • uninterpreted (name : String) : Srt

      An uninterpreted sort.

    Instances For
      Equations

      Turns a sort into a sort kind.

      Equations
      Instances For

        DecidableEq instance #

        Equations
        • One or more equations did not get rendered due to their size.
        Equations
        • One or more equations did not get rendered due to their size.
        def Cvc.Srt.beq :
        SrtSrtBool

        Boolean equality.

        TODO #

        • Probably should not use instDecidableEq for boolean equality; I'm not sure how efficient the code generated is.
        Equations
        Instances For

          Specifies how to paren the string representation of a sort.

          This only impacts the sort's top-level, paren for sub-sorts are decided by their super-sorts.

          • none : Paren

            Don't paren the sort at all.

          • ifFunction : Paren

            Only paren if it's a function.

          • ifArgs : Paren

            Only paren argument-having type constructors such as (Array Bool).

          • composite : Paren

            Always paren composite sorts (Array Bool) but not leaf-sorts Bool.

          Instances For

            Maximum paren-ing.

            NB: leaf-sorts such as Srt.bool are never paren-ed.

            Equations
            Instances For
              Equations
              Instances For

                String representation.

                Equations
                def Cvc.Srt.ofSort (sort : cvc5.Sort) (maxDepth : Nat := 100000) :

                Constructor from unsafe sorts.

                This function recurses on sub-sorts retrieved by FFI: there is no chance to prove it terminates. Hence the maxDepth optional parameter that sets an upper-bound on the recursion depth, causing this function to crash if maxDepth is reached.

                Equations
                • One or more equations did not get rendered due to their size.
                Instances For
                  Equations
                  Instances For
                    def Cvc.Srt.ofSort.aux (maxDepth : Nat := 100000) (sort : cvc5.Sort) :
                    NatRes Srt
                    Equations
                    Instances For
                      @[irreducible]
                      def Cvc.Srt.ofSort.aux.doit (acc : SrtSrt) :
                      Equations
                      Instances For
                        @[reducible, inline]
                        Equations
                        Instances For
                          @[reducible, inline]
                          abbrev Cvc.Srt.is_function (srt : Srt) :
                          Equations
                          Instances For
                            @[reducible, inline]
                            Equations
                            Instances For
                              @[reducible, inline]
                              abbrev Cvc.Srt.is_arith (srt : Srt) :
                              Equations
                              Instances For
                                theorem Cvc.Srt.is_arith_def (srt : Srt) :
                                srt.is_arith srt = int srt = real