Documentation

Cvc.Types.FiniteField

Finite-field elements #

The Lean type denoting a value of SMT sort (_ FiniteField size), held as the integer representing it. cvc5 answers in the symmetric representation, so an element of GF(5) comes back in [-2, 2] rather than [0, 4]: 3 reads back as -2.

Converting an element to a term and back is done by Cvc.Untyped.Theory.FiniteField and Cvc.Typed.Theory.FiniteField.

structure Cvc.FiniteField (size : Nat) :

An element of a finite field of size size, held as an integer representing it.

Any integer congruent to it modulo size represents the same element, but equality, order and hashing compare the integers: ⟨6⟩ : FiniteField 7 and ⟨-1⟩ are the same element yet not equal. Values read from cvc5 come in its symmetric representation, 6 reading back as -1.

  • repr : Int

    Element representation.

Instances For
    def Cvc.instDecidableEqFiniteField.decEq {size✝ : Nat} (x✝ x✝¹ : FiniteField size✝) :
    Decidable (x✝ = x✝¹)
    Equations
    Instances For
      Equations
      Instances For
        @[instance_reducible]
        instance Cvc.instHashableFiniteField {size✝ : Nat} :
        Equations
        def Cvc.instOrdFiniteField.ord {size✝ : Nat} :
        FiniteField size✝ → FiniteField size✝ → Ordering
        Equations
        Instances For
          @[instance_reducible]
          instance Cvc.instOrdFiniteField {size✝ : Nat} :
          Ord (FiniteField size✝)
          Equations
          @[instance_reducible]
          Equations

          Erased version of FiniteField.

          Instances For
            def Cvc.FiniteField.erase {size : Nat} (elem : FiniteField size) :

            Erases a finite-field-element's size.

            Equations
            • elem.erase = { size := size, get := elem }
            Instances For

              String representation.

              Equations
              Instances For
                @[instance_reducible]
                Equations

                String representation.

                Equations
                Instances For