Documentation

Cvc.Defs

Sorts and their Lean descriptions #

Srt is an SMT-LIB sort of the current scope, Typ a pure Lean description of one, and ToTyp the class mapping a Lean type to the Typ it denotes. The sort constructors are in Cvc.Srt.

structure Cvc.TypeGen :
Instances For
    def Cvc.TypeGen.mk (doc? : Option (Lean.TSyntax `Lean.Parser.Command.docComment)) (mainId subId : Lean.Ident) (tParam? ofSubId? toSubId? : Option Lean.Ident) :
    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
          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
                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

                    Re-exported from lean-cvc5 #

                    The enums Kind, SortKind, ProofRule and ProofRewriteRule, and the type Op, are lean-cvc5's own, re-exported so that naming one does not mean reaching into cvc5.

                    Equality operator.

                    Equations
                    Instances For

                      The string cvc5 prints for this value.

                      Equations
                      Instances For

                        cvc5's hash of this value.

                        Equations
                        Instances For

                          A datatype declaration being built, which Srt.datatype turns into a sort.

                          Equations
                          Instances For

                            cvc5's hash of this value.

                            Equations
                            Instances For

                              The string cvc5 prints for this value.

                              Equations
                              Instances For

                                A declared datatype, as read back from its sort.

                                Equations
                                Instances For

                                  Equality operator.

                                  Equations
                                  Instances For

                                    A constructor declaration being built, added to a Datatype.Decl.

                                    Equations
                                    Instances For

                                      The string cvc5 prints for this value.

                                      Equations
                                      Instances For

                                        Equality operator.

                                        Equations
                                        Instances For

                                          A constructor of a declared datatype.

                                          Equations
                                          Instances For

                                            cvc5's hash of this value.

                                            Equations
                                            Instances For

                                              A field selector of a datatype constructor.

                                              Equations
                                              Instances For

                                                The string cvc5 prints for this value.

                                                Equations
                                                Instances For
                                                  def Cvc.Srt.ble [Ω] :
                                                  Srt → Srt → Bool

                                                  Less than or equal comparison.

                                                  Equations
                                                  Instances For
                                                    def Cvc.Srt [Ω] :

                                                    An SMT-LIB sort of the current scope.

                                                    Built with Srt.int, Srt.set and the other constructors, or from a Lean type with Srt.of.

                                                    Equations
                                                    Instances For
                                                      @[instance_reducible]
                                                      Equations
                                                      @[instance_reducible]
                                                      Equations
                                                      def Cvc.Srt.bge [Ω] :
                                                      Srt → Srt → Bool

                                                      Greater than or equal comparison.

                                                      Equations
                                                      Instances For
                                                        def Cvc.Srt.beq [Ω] :
                                                        Srt → Srt → Bool

                                                        Comparison for structural equality.

                                                        Equations
                                                        Instances For
                                                          @[instance_reducible]
                                                          instance Cvc.Srt.instLE [Ω] :
                                                          Equations

                                                          Comparison of two sorts.

                                                          Equations
                                                          Instances For

                                                            cvc5's hash of this value.

                                                            Equations
                                                            Instances For
                                                              def Cvc.Srt.bgt [Ω] :
                                                              Srt → Srt → Bool

                                                              Greater than comparison.

                                                              Equations
                                                              Instances For
                                                                def Cvc.Srt.blt [Ω] :
                                                                Srt → Srt → Bool

                                                                Less than comparison.

                                                                Equations
                                                                Instances For

                                                                  The string cvc5 prints for this value.

                                                                  Equations
                                                                  Instances For
                                                                    @[instance_reducible]
                                                                    Equations
                                                                    @[instance_reducible]
                                                                    instance Cvc.Srt.instLT [Ω] :
                                                                    Equations

                                                                    The kinds of abstract sort: a sort of a known family, its parameters left unspecified.

                                                                    Instances For
                                                                      @[instance_reducible]
                                                                      Equations
                                                                      Equations
                                                                      Instances For
                                                                        @[instance_reducible]
                                                                        Equations
                                                                        Equations
                                                                        Instances For
                                                                          Equations
                                                                          Instances For
                                                                            @[instance_reducible]
                                                                            Equations
                                                                            @[instance_reducible]
                                                                            Equations
                                                                            @[instance_reducible]
                                                                            Equations
                                                                            @[instance_reducible]
                                                                            Equations
                                                                            @[reducible, inline]
                                                                            abbrev Cvc.Srts [Ω] :

                                                                            An array of Srts.

                                                                            Equations
                                                                            Instances For

                                                                              Sort descriptions #

                                                                              Typ describes a sort Lean-side, and Typ? adds the sorts cvc5 calls abstract: the fully abstract ?, and ?BITVECTOR_TYPE, ?FLOATINGPOINT_TYPE, ?FINITE_FIELD_TYPE and ?->. cvc5 accepts an abstract sort only as a set, bag or sequence element, as an array's index or element, and as a function's codomain. Those positions take a Typ? and every other takes a Typ, so no Typ describes a sort cvc5 would reject.

                                                                              inductive Cvc.Typ :

                                                                              A sort, described Lean-side; never an abstract sort.

                                                                              • bool : Typ
                                                                              • int : Typ
                                                                              • real : Typ
                                                                              • string : Typ
                                                                              • regex : Typ
                                                                              • roundingMode : Typ
                                                                              • bitVec (size : Nat) : Typ
                                                                              • float (exp sig : Nat) : Typ
                                                                              • finiteField (size : Nat) : Typ
                                                                              • arrayTo (idx elm : Typ?) : Typ
                                                                              • bag (elm : Typ?) : Typ
                                                                              • set (elm : Typ?) : Typ
                                                                              • seq (elm : Typ?) : Typ
                                                                              • nullable (elm : Typ) : Typ

                                                                                cvc5's Nullable, denoted Lean-side by Option.

                                                                              • prod (args : List Typ) : Typ

                                                                                A tuple, of the given components.

                                                                              • record (fields : List (String × Typ)) : Typ

                                                                                A record, of named fields.

                                                                                The order is part of the sort: {a : Int, b : Bool} and {b : Bool, a : Int} are different.

                                                                              • datatype (name : String) : Typ

                                                                                A datatype, by the name it was declared under.

                                                                                Typ.toSrt fails unless a datatype of that name has been declared in the current scope, with Srt.datatype, Srt.datatypes or Solver.declareDatatype.

                                                                              • function (dom : Typ) (cod : Typ?) : Typ

                                                                                A function sort, its codomain possibly abstract.

                                                                              • uninterpreted (name : String) : Typ

                                                                                An uninterpreted sort, by name; like datatype, it must be declared (Srt.uninterpreted).

                                                                              Instances For
                                                                                inductive Cvc.Typ? :

                                                                                A Typ, or one of the sorts cvc5 calls abstract, for the positions that accept one.

                                                                                • typ (t : Typ) : Typ?

                                                                                  An ordinary, first-class sort.

                                                                                • any : Typ?

                                                                                  cvc5's fully abstract sort ?.

                                                                                • abstract (a : Srt.Abstract) : Typ?

                                                                                  An abstract sort of a known kind, ?BITVECTOR_TYPE and friends.

                                                                                Instances For
                                                                                  @[instance_reducible]
                                                                                  def Cvc.instOrdProd_cvc {α : Type u_1} {β : Type u_2} [Ord α] [Ord β] :
                                                                                  Ord (α × β)
                                                                                  Equations
                                                                                  • One or more equations did not get rendered due to their size.
                                                                                  Instances For
                                                                                    @[instance_reducible]
                                                                                    Equations
                                                                                    @[instance_reducible]
                                                                                    Equations
                                                                                    @[instance_reducible]

                                                                                    Every Typ is a Typ?, so the wrapping is implicit.

                                                                                    Equations

                                                                                    Typ's constructors, mirrored #

                                                                                    Dot notation resolves against the expected type, so .set .int would look for Typ?.int and fail. These restore it, and @[match_pattern] makes them usable in patterns as well as in terms.

                                                                                    @[reducible, match_pattern, inline]
                                                                                    Equations
                                                                                    Instances For
                                                                                      @[reducible, match_pattern, inline]
                                                                                      Equations
                                                                                      Instances For
                                                                                        @[reducible, match_pattern, inline]
                                                                                        Equations
                                                                                        Instances For
                                                                                          @[reducible, match_pattern, inline]
                                                                                          Equations
                                                                                          Instances For
                                                                                            @[reducible, match_pattern, inline]
                                                                                            Equations
                                                                                            Instances For
                                                                                              @[reducible, match_pattern, inline]
                                                                                              Equations
                                                                                              Instances For
                                                                                                @[reducible, match_pattern, inline]
                                                                                                abbrev Cvc.Typ?.bitVec (size : Nat) :
                                                                                                Equations
                                                                                                Instances For
                                                                                                  @[reducible, match_pattern, inline]
                                                                                                  abbrev Cvc.Typ?.float (exp sig : Nat) :
                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    @[reducible, match_pattern, inline]
                                                                                                    abbrev Cvc.Typ?.finiteField (size : Nat) :
                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      @[reducible, match_pattern, inline]
                                                                                                      abbrev Cvc.Typ?.arrayTo (idx elm : Typ?) :
                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        @[reducible, match_pattern, inline]
                                                                                                        abbrev Cvc.Typ?.bag (elm : Typ?) :
                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          @[reducible, match_pattern, inline]
                                                                                                          abbrev Cvc.Typ?.set (elm : Typ?) :
                                                                                                          Equations
                                                                                                          Instances For
                                                                                                            @[reducible, match_pattern, inline]
                                                                                                            abbrev Cvc.Typ?.seq (elm : Typ?) :
                                                                                                            Equations
                                                                                                            Instances For
                                                                                                              @[reducible, match_pattern, inline]
                                                                                                              abbrev Cvc.Typ?.nullable (elm : Typ) :
                                                                                                              Equations
                                                                                                              Instances For
                                                                                                                @[reducible, match_pattern, inline]
                                                                                                                abbrev Cvc.Typ?.prod (args : List Typ) :
                                                                                                                Equations
                                                                                                                Instances For
                                                                                                                  @[reducible, match_pattern, inline]
                                                                                                                  abbrev Cvc.Typ?.record (fields : List (String × Typ)) :
                                                                                                                  Equations
                                                                                                                  Instances For
                                                                                                                    @[reducible, match_pattern, inline]
                                                                                                                    abbrev Cvc.Typ?.datatype (name : String) :
                                                                                                                    Equations
                                                                                                                    Instances For
                                                                                                                      @[reducible, match_pattern, inline]
                                                                                                                      abbrev Cvc.Typ?.function (dom : Typ) (cod : Typ?) :
                                                                                                                      Equations
                                                                                                                      Instances For
                                                                                                                        @[reducible, match_pattern, inline]
                                                                                                                        Equations
                                                                                                                        Instances For
                                                                                                                          def Cvc.Typ.beq :
                                                                                                                          Typ → Typ → Bool

                                                                                                                          Structural equality.

                                                                                                                          Equations
                                                                                                                          Instances For

                                                                                                                            Structural equality.

                                                                                                                            Equations
                                                                                                                            Instances For

                                                                                                                              Structural equality.

                                                                                                                              Equations
                                                                                                                              Instances For
                                                                                                                                def Cvc.Typ?.beq :
                                                                                                                                Typ? → Typ? → Bool

                                                                                                                                Structural equality.

                                                                                                                                Equations
                                                                                                                                Instances For
                                                                                                                                  theorem Cvc.Typ.beq_refl (t : Typ) :
                                                                                                                                  t.beq t = true

                                                                                                                                  Cvc.Typ.beq is reflexive.

                                                                                                                                  Cvc.Typ.beq is reflexive.

                                                                                                                                  theorem Cvc.Typ?.beq_refl (t : Typ?) :
                                                                                                                                  t.beq t = true

                                                                                                                                  Cvc.Typ.beq is reflexive.

                                                                                                                                  theorem Cvc.Typ.eq_of_beq (t₁ t₂ : Typ) :
                                                                                                                                  t₁.beq t₂ = true → t₁ = t₂

                                                                                                                                  Cvc.Typ.beq holds only of equals.

                                                                                                                                  theorem Cvc.Typ.eq_of_beqList (ts₁ ts₂ : List Typ) :
                                                                                                                                  Typ.beqList ts₁ ts₂ = true → ts₁ = ts₂

                                                                                                                                  Cvc.Typ.beq holds only of equals.

                                                                                                                                  theorem Cvc.Typ.eq_of_beqFields (fs₁ fs₂ : List (String × Typ)) :
                                                                                                                                  Typ.beqFields fs₁ fs₂ = true → fs₁ = fs₂

                                                                                                                                  Cvc.Typ.beq holds only of equals.

                                                                                                                                  theorem Cvc.Typ?.eq_of_beq (t₁ t₂ : Typ?) :
                                                                                                                                  t₁.beq t₂ = true → t₁ = t₂

                                                                                                                                  Cvc.Typ.beq holds only of equals.

                                                                                                                                  @[instance_reducible]
                                                                                                                                  Equations
                                                                                                                                  @[instance_reducible]
                                                                                                                                  Equations
                                                                                                                                  def Cvc.Typ.toString (t : Typ) (paren : Bool := false) :

                                                                                                                                  String representation.

                                                                                                                                  Equations
                                                                                                                                  Instances For
                                                                                                                                    def Cvc.Typ?.toString (t : Typ?) (paren : Bool := false) :

                                                                                                                                    String representation.

                                                                                                                                    Equations
                                                                                                                                    Instances For
                                                                                                                                      def Cvc.Typ.fieldsFold (fields : List (String × Typ)) (acc : String) :

                                                                                                                                      Renders a record's fields, for Typ.toString.

                                                                                                                                      Equations
                                                                                                                                      Instances For

                                                                                                                                        Renders a tuple's components, for Typ.toString.

                                                                                                                                        Equations
                                                                                                                                        Instances For
                                                                                                                                          @[instance_reducible]
                                                                                                                                          Equations
                                                                                                                                          @[instance_reducible]
                                                                                                                                          Equations
                                                                                                                                          class Cvc.ToTyp (α : Type) :

                                                                                                                                          The sort a Lean type denotes, which lets it index terms.

                                                                                                                                          For a declared datatype, name it and declare it in the scope before use: instance : ToTyp Pair := ⟨.datatype "Pair"⟩.

                                                                                                                                          Instances