Documentation

Cvc.Typed.Theory.Arith

Arithmetic, typed #

def Cvc.Typed.Term.toInt [Ω] {α : Type} [ToTyp α] [IsArith α] (arithTerm : Term α) :

Conversion to an integer, rounding towards negative infinity.

Equations
Instances For

    Arc cotangent.

    Equations
    Instances For

      Arc tangent.

      Equations
      Instances For
        def Cvc.Typed.Term.addN [Ω] {α : Type} [ToTyp α] [IsArith α] (terms : Terms α) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :
        Env (Term α)

        add over two or more terms.

        Equations
        Instances For
          def Cvc.Typed.Term.le [Ω] {α : Type} [ToTyp α] [IsArith α] (lft rgt : Term α) :

          Binary less-than-or-equal-to; leN chains, as ltN does.

          Equations
          Instances For
            def Cvc.Typed.Term.geN [Ω] {α : Type} [ToTyp α] [IsArith α] (terms : Terms α) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :

            ge over two or more terms.

            Equations
            Instances For

              Cosine.

              Equations
              Instances For
                def Cvc.Typed.Term.mulN' [Ω] {α : Type} [ToTyp α] [IsArith α] (terms : Terms α) :
                Env (Term α)

                mul over any number of terms: none gives 1, one gives that term.

                Equations
                Instances For

                  Cosecant.

                  Equations
                  Instances For
                    def Cvc.Typed.Term.subN [Ω] {α : Type} [ToTyp α] [IsArith α] (terms : Terms α) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :
                    Env (Term α)

                    sub over two or more terms.

                    Equations
                    Instances For
                      def Cvc.Typed.Term.ge [Ω] {α : Type} [ToTyp α] [IsArith α] (lft rgt : Term α) :

                      Binary greater-than-or-equal-to; geN chains, as ltN does.

                      Equations
                      Instances For

                        A real literal, read from a decimal ("1.5") or a fraction ("3/4").

                        Equations
                        Instances For

                          An integer literal.

                          Equations
                          Instances For

                            Arc cosine.

                            Equations
                            Instances For

                              Sine.

                              Equations
                              Instances For
                                def Cvc.Typed.Term.ltN [Ω] {α : Type} [ToTyp α] [IsArith α] (terms : Terms α) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :

                                lt over two or more terms.

                                Equations
                                Instances For

                                  Real division, left-associative; unspecified on a zero divisor.

                                  Equations
                                  Instances For
                                    def Cvc.Typed.Term.pow [Ω] {α : Type} [ToTyp α] [IsArith α] (base exponent : Term α) :
                                    Env (Term α)

                                    Exponentiation.

                                    Equations
                                    Instances For
                                      def Cvc.Typed.Term.add [Ω] {α : Type} [ToTyp α] [IsArith α] (lft rgt : Term α) :
                                      Env (Term α)

                                      Binary addition.

                                      Equations
                                      Instances For
                                        def Cvc.Typed.Term.pow2 [Ω] (exponent : Term Int) :

                                        Two raised to a non-negative exponent.

                                        Equations
                                        Instances For
                                          def Cvc.Typed.Term.piand [Ω] (size lft rgt : Term Int) :

                                          Bit-wise and of the low size bits of lft and rgt; zero when size ≤ 0.

                                          Equations
                                          Instances For
                                            def Cvc.Typed.Term.mul [Ω] {α : Type} [ToTyp α] [IsArith α] (lft rgt : Term α) :
                                            Env (Term α)

                                            Binary multiplication.

                                            Equations
                                            Instances For

                                              Euclidean integer division, left-associative; zero on a zero divisor.

                                              Equations
                                              Instances For
                                                def Cvc.Typed.Term.intDivTotalN [Ω] (terms : Terms Int) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :

                                                intDivTotal over two or more terms.

                                                Equations
                                                Instances For

                                                  A real literal.

                                                  Equations
                                                  Instances For

                                                    Arc cosecant.

                                                    Equations
                                                    Instances For
                                                      def Cvc.Typed.Term.gt [Ω] {α : Type} [ToTyp α] [IsArith α] (lft rgt : Term α) :

                                                      Binary greater-than; gtN chains, as ltN does.

                                                      Equations
                                                      Instances For

                                                        An integer literal, read from its decimal representation.

                                                        Equations
                                                        Instances For

                                                          Secant.

                                                          Equations
                                                          Instances For

                                                            Arc sine.

                                                            Equations
                                                            Instances For

                                                              Arc secant.

                                                              Equations
                                                              Instances For
                                                                def Cvc.Typed.Term.sub [Ω] {α : Type} [ToTyp α] [IsArith α] (lft rgt : Term α) :
                                                                Env (Term α)

                                                                Binary subtraction; subN is left-associative.

                                                                Equations
                                                                Instances For
                                                                  def Cvc.Typed.Term.intMod [Ω] (lft rgt : Term Int) :

                                                                  Euclidean integer modulus, never negative; unspecified on a zero divisor.

                                                                  Equations
                                                                  Instances For
                                                                    def Cvc.Typed.Term.leN [Ω] {α : Type} [ToTyp α] [IsArith α] (terms : Terms α) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :

                                                                    le over two or more terms.

                                                                    Equations
                                                                    Instances For
                                                                      def Cvc.Typed.Term.realDivTotalN [Ω] (terms : Terms Rat) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :

                                                                      realDivTotal over two or more terms.

                                                                      Equations
                                                                      Instances For
                                                                        def Cvc.Typed.Term.realDivN [Ω] (terms : Terms Rat) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :

                                                                        realDiv over two or more terms.

                                                                        Equations
                                                                        Instances For
                                                                          def Cvc.Typed.Term.addN' [Ω] {α : Type} [ToTyp α] [IsArith α] (terms : Terms α) :
                                                                          Env (Term α)

                                                                          add over any number of terms: none gives 0, one gives that term.

                                                                          Equations
                                                                          Instances For
                                                                            def Cvc.Typed.Term.divisible [Ω] (divisor : Nat) (arg : Term Int) :

                                                                            Whether arg is divisible by divisor.

                                                                            Equations
                                                                            Instances For
                                                                              def Cvc.Typed.Term.toReal [Ω] {α : Type} [ToTyp α] [IsArith α] (arithTerm : Term α) :

                                                                              Conversion to a real.

                                                                              Equations
                                                                              Instances For

                                                                                The exponential function.

                                                                                Equations
                                                                                Instances For

                                                                                  Euclidean integer modulus; the dividend on a zero divisor.

                                                                                  Equations
                                                                                  Instances For
                                                                                    def Cvc.Typed.Term.neg [Ω] {α : Type} [ToTyp α] [IsArith α] (arithTerm : Term α) :
                                                                                    Env (Term α)

                                                                                    Arithmetic negation.

                                                                                    Equations
                                                                                    Instances For

                                                                                      Square root.

                                                                                      Equations
                                                                                      Instances For

                                                                                        The constant π.

                                                                                        Equations
                                                                                        Instances For
                                                                                          def Cvc.Typed.Term.intDivN [Ω] (terms : Terms Int) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :

                                                                                          intDiv over two or more terms.

                                                                                          Equations
                                                                                          Instances For
                                                                                            def Cvc.Typed.Term.iand [Ω] (size : Nat) (lft rgt : Term Int) :

                                                                                            Bit-wise and of the low size bits of lft and rgt.

                                                                                            Equations
                                                                                            Instances For

                                                                                              Base-two logarithm.

                                                                                              Equations
                                                                                              Instances For
                                                                                                def Cvc.Typed.Term.mulN [Ω] {α : Type} [ToTyp α] [IsArith α] (terms : Terms α) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :
                                                                                                Env (Term α)

                                                                                                mul over two or more terms.

                                                                                                Equations
                                                                                                Instances For
                                                                                                  def Cvc.Typed.Term.isInt [Ω] {α : Type} [ToTyp α] [IsArith α] (arithTerm : Term α) :

                                                                                                  Whether an arithmetic term denotes an integer.

                                                                                                  Equations
                                                                                                  Instances For

                                                                                                    Cotangent.

                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      def Cvc.Typed.Term.abs [Ω] {α : Type} [ToTyp α] [IsArith α] (arithTerm : Term α) :
                                                                                                      Env (Term α)

                                                                                                      Absolute value.

                                                                                                      Equations
                                                                                                      Instances For
                                                                                                        def Cvc.Typed.Term.intDiv [Ω] (lft rgt : Term Int) :

                                                                                                        Euclidean integer division, left-associative; unspecified on a zero divisor.

                                                                                                        Equations
                                                                                                        Instances For
                                                                                                          def Cvc.Typed.Term.lt [Ω] {α : Type} [ToTyp α] [IsArith α] (lft rgt : Term α) :

                                                                                                          Binary less-than; ltN chains: ltN #[a, b, c] is a < b ∧ b < c.

                                                                                                          Equations
                                                                                                          Instances For

                                                                                                            Real division, left-associative; zero on a zero divisor.

                                                                                                            Equations
                                                                                                            Instances For

                                                                                                              Tangent.

                                                                                                              Equations
                                                                                                              Instances For
                                                                                                                def Cvc.Typed.Term.gtN [Ω] {α : Type} [ToTyp α] [IsArith α] (terms : Terms α) (atLeastTwoElements : 2 ≤ Array.size terms := by (try grind) <;> fail "failed to prove term array has at least two elements") :

                                                                                                                gt over two or more terms.

                                                                                                                Equations
                                                                                                                Instances For
                                                                                                                  inductive Cvc.Typed.View.Arith [Ω] :
                                                                                                                  Typ → Type

                                                                                                                  Arith's operators, taken apart one level, indexed by the sort each produces.

                                                                                                                  Instances For

                                                                                                                    Arith's operators with a result of sort Rat.

                                                                                                                    Instances For
                                                                                                                      inductive Cvc.Typed.View.Arith.OnAny [Ω] (β : Type) [ToTyp β] :

                                                                                                                      Arith's operators whose result's sort is a type variable.

                                                                                                                      Instances For

                                                                                                                        Arith's operators with a result of sort Int.

                                                                                                                        • intDiv [Ω] (kids : Kids Int) : OnInt

                                                                                                                          Euclidean integer division, left-associative; unspecified on a zero divisor.

                                                                                                                          kids holds every operand, two or more.

                                                                                                                        • intDivTotal [Ω] (kids : Kids Int) : OnInt

                                                                                                                          Euclidean integer division, left-associative; zero on a zero divisor.

                                                                                                                          kids holds every operand, two or more.

                                                                                                                        • intMod [Ω] (lft rgt : Term Int) : OnInt

                                                                                                                          Euclidean integer modulus, never negative; unspecified on a zero divisor.

                                                                                                                        • intModTotal [Ω] (lft rgt : Term Int) : OnInt

                                                                                                                          Euclidean integer modulus; the dividend on a zero divisor.

                                                                                                                        • pow2 [Ω] (exponent : Term Int) : OnInt

                                                                                                                          Two raised to a non-negative exponent.

                                                                                                                        • log2 [Ω] (arg : Term Int) : OnInt

                                                                                                                          Base-two logarithm.

                                                                                                                        • toInt [Ω] (α : Typ) {h0 : α.isArith = true} (arithTerm : Term α.Denote) : OnInt

                                                                                                                          Conversion to an integer, rounding towards negative infinity.

                                                                                                                        • piand [Ω] (size lft rgt : Term Int) : OnInt

                                                                                                                          Bit-wise and of the low size bits of lft and rgt; zero when size ≤ 0.

                                                                                                                        • iand [Ω] (size : Nat) (lft rgt : Term Int) : OnInt

                                                                                                                          Bit-wise and of the low size bits of lft and rgt.

                                                                                                                        Instances For

                                                                                                                          Takes a term apart one level, at its sort, if Arith owns its operator and the term's sort fits it.

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

                                                                                                                            Arith's operators with a result of sort Bool.

                                                                                                                            Instances For

                                                                                                                              Values #

                                                                                                                              def Cvc.Typed.Term.getSign [Ω] {α : Type} [ToTyp α] [IsArith α] (term : Term α) :

                                                                                                                              The sign of an arithmetic value: negative, zero or positive as -1, 0, 1.

                                                                                                                              Equations
                                                                                                                              Instances For

                                                                                                                                Machine-width views #

                                                                                                                                An SMT integer is unbounded, so these say whether a value happens to fit a machine word and hand it over if it does. They are views of getIntValue, not a different value.

                                                                                                                                Determine if this term is an Int32 value.

                                                                                                                                NB: this will return true for integer constants and real constants that have integer value.

                                                                                                                                Equations
                                                                                                                                Instances For

                                                                                                                                  Get the Int32 representation of this integral value.

                                                                                                                                  NB: requires that this term is an Int32 value (see isInt32Value).

                                                                                                                                  Equations
                                                                                                                                  Instances For

                                                                                                                                    Determine if this term is an Int64 value.

                                                                                                                                    NB: this will return true for integer constants and real constants that have integer value.

                                                                                                                                    Equations
                                                                                                                                    Instances For

                                                                                                                                      Get the Int64 representation of this integral value.

                                                                                                                                      NB: requires that this term is an Int64 value (see isInt64Value).

                                                                                                                                      Equations
                                                                                                                                      Instances For

                                                                                                                                        Determine if this term is an UInt32 value.

                                                                                                                                        NB: this will return true for integer constants and real constants that have integer value.

                                                                                                                                        Equations
                                                                                                                                        Instances For

                                                                                                                                          Get the UInt32 representation of this integral value.

                                                                                                                                          NB: requires that this term is an UInt32 value (see isUInt32Value).

                                                                                                                                          Equations
                                                                                                                                          Instances For

                                                                                                                                            Determine if this term is an UInt64 value.

                                                                                                                                            NB: this will return true for integer constants and real constants that have integer value.

                                                                                                                                            Equations
                                                                                                                                            Instances For

                                                                                                                                              Get the UInt64 representation of this integral value.

                                                                                                                                              NB: requires that this term is an UInt64 value (see isUInt64Value).

                                                                                                                                              Equations
                                                                                                                                              Instances For

                                                                                                                                                Whether a term denotes a real that fits a 32-bit numerator and denominator.

                                                                                                                                                Equations
                                                                                                                                                Instances For

                                                                                                                                                  The numerator and denominator of a real value, at 32 bits.

                                                                                                                                                  Equations
                                                                                                                                                  Instances For

                                                                                                                                                    Whether a term denotes a real that fits a 64-bit numerator and denominator.

                                                                                                                                                    Equations
                                                                                                                                                    Instances For

                                                                                                                                                      The numerator and denominator of a real value, at 64 bits.

                                                                                                                                                      Equations
                                                                                                                                                      Instances For

                                                                                                                                                        Real algebraic numbers #

                                                                                                                                                        A real algebraic number is not a rational, so it has no getRatValue. It is described instead by a polynomial it is a root of, together with an interval isolating that root.

                                                                                                                                                        Determine if this term is a real algebraic number.

                                                                                                                                                        Equations
                                                                                                                                                        Instances For

                                                                                                                                                          The polynomial a real algebraic number is a root of, written in the bound variable v.

                                                                                                                                                          Equations
                                                                                                                                                          Instances For

                                                                                                                                                            Get the lower bound for a real algebraic number value.

                                                                                                                                                            NB: asserts isRealAlgebraicNumber.

                                                                                                                                                            Equations
                                                                                                                                                            Instances For

                                                                                                                                                              Get the upper bound for a real algebraic number value.

                                                                                                                                                              NB: asserts isRealAlgebraicNumber.

                                                                                                                                                              Equations
                                                                                                                                                              Instances For

                                                                                                                                                                Determine if this real/integer constant term is an integral value.

                                                                                                                                                                Equations
                                                                                                                                                                Instances For

                                                                                                                                                                  The integer a term denotes, failing if it denotes none.

                                                                                                                                                                  Equations
                                                                                                                                                                  Instances For

                                                                                                                                                                    The integer a term denotes, failing if it denotes none.

                                                                                                                                                                    Equations
                                                                                                                                                                    Instances For

                                                                                                                                                                      Determine if this term is a rational value.

                                                                                                                                                                      NB: A term of kind Kind.PI is not considered to be a real value.

                                                                                                                                                                      Equations
                                                                                                                                                                      Instances For

                                                                                                                                                                        The real a term denotes as a string, failing if it denotes none.

                                                                                                                                                                        Equations
                                                                                                                                                                        Instances For

                                                                                                                                                                          The real a term denotes as a string, failing if it denotes none.

                                                                                                                                                                          Equations
                                                                                                                                                                          Instances For

                                                                                                                                                                            The real a term denotes as a Rat, failing if it denotes none.

                                                                                                                                                                            An irrational model value, which nonlinear real arithmetic can produce, is no Rat: read it as a term instead, and take it apart with the getRealAlgebraicNumber… functions.

                                                                                                                                                                            Equations
                                                                                                                                                                            Instances For

                                                                                                                                                                              The real a term denotes as a Rat, failing if it denotes none.

                                                                                                                                                                              An irrational model value, which nonlinear real arithmetic can produce, is no Rat: read it as a term instead, and take it apart with the getRealAlgebraicNumber… functions.

                                                                                                                                                                              Equations
                                                                                                                                                                              Instances For
                                                                                                                                                                                @[instance_reducible]
                                                                                                                                                                                Equations
                                                                                                                                                                                @[instance_reducible]
                                                                                                                                                                                Equations

                                                                                                                                                                                smt! literals of this theory #

                                                                                                                                                                                An integer literal is a Term Int and a decimal one a Term Rat (1.5, 1.5e-3): with r : Term Rat, write smt! r + 1.0, since smt! r + 1 does not typecheck.