Arithmetic, typed #
Arc cotangent.
Equations
Instances For
add over two or more terms.
Equations
- Cvc.Typed.Term.addN terms atLeastTwoElements = Cvc.Untyped.Term.addN terms atLeastTwoElements
Instances For
ge over two or more terms.
Equations
- Cvc.Typed.Term.geN terms atLeastTwoElements = Cvc.Untyped.Term.geN terms atLeastTwoElements
Instances For
mul over any number of terms: none gives 1, one gives that term.
Equations
- Cvc.Typed.Term.mulN' terms = Cvc.Untyped.Term.mulN' terms (match Cvc.Typ.of α with | Cvc.Typ.real => Cvc.Untyped.Term.mkReal 1 | x => Cvc.Untyped.Term.mkInt 1)
Instances For
sub over two or more terms.
Equations
- Cvc.Typed.Term.subN terms atLeastTwoElements = Cvc.Untyped.Term.subN terms atLeastTwoElements
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
lt over two or more terms.
Equations
- Cvc.Typed.Term.ltN terms atLeastTwoElements = Cvc.Untyped.Term.ltN terms atLeastTwoElements
Instances For
Euclidean integer division, left-associative; zero on a zero divisor.
Equations
- lft.intDivTotal rgt = Cvc.Untyped.Term.intDivTotal lft rgt
Instances For
intDivTotal over two or more terms.
Equations
- Cvc.Typed.Term.intDivTotalN terms atLeastTwoElements = Cvc.Untyped.Term.intDivTotalN terms atLeastTwoElements
Instances For
A real literal.
Equations
Instances For
An integer literal, read from its decimal representation.
Equations
Instances For
le over two or more terms.
Equations
- Cvc.Typed.Term.leN terms atLeastTwoElements = Cvc.Untyped.Term.leN terms atLeastTwoElements
Instances For
realDivTotal over two or more terms.
Equations
- Cvc.Typed.Term.realDivTotalN terms atLeastTwoElements = Cvc.Untyped.Term.realDivTotalN terms atLeastTwoElements
Instances For
realDiv over two or more terms.
Equations
- Cvc.Typed.Term.realDivN terms atLeastTwoElements = Cvc.Untyped.Term.realDivN terms atLeastTwoElements
Instances For
add over any number of terms: none gives 0, one gives that term.
Equations
- Cvc.Typed.Term.addN' terms = Cvc.Untyped.Term.addN' terms (match Cvc.Typ.of α with | Cvc.Typ.real => Cvc.Untyped.Term.mkReal 0 | x => Cvc.Untyped.Term.mkInt 0)
Instances For
Whether arg is divisible by divisor.
Equations
- Cvc.Typed.Term.divisible divisor arg = Cvc.Untyped.Term.divisible divisor arg
Instances For
Euclidean integer modulus; the dividend on a zero divisor.
Equations
- lft.intModTotal rgt = Cvc.Untyped.Term.intModTotal lft rgt
Instances For
The constant π.
Equations
Instances For
intDiv over two or more terms.
Equations
- Cvc.Typed.Term.intDivN terms atLeastTwoElements = Cvc.Untyped.Term.intDivN terms atLeastTwoElements
Instances For
Bit-wise and of the low size bits of lft and rgt.
Equations
- Cvc.Typed.Term.iand size lft rgt = Cvc.Untyped.Term.iand size lft rgt
Instances For
mul over two or more terms.
Equations
- Cvc.Typed.Term.mulN terms atLeastTwoElements = Cvc.Untyped.Term.mulN terms atLeastTwoElements
Instances For
Real division, left-associative; zero on a zero divisor.
Equations
- lft.realDivTotal rgt = Cvc.Untyped.Term.realDivTotal lft rgt
Instances For
gt over two or more terms.
Equations
- Cvc.Typed.Term.gtN terms atLeastTwoElements = Cvc.Untyped.Term.gtN terms atLeastTwoElements
Instances For
Arith's operators, taken apart one level, indexed by the sort each produces.
- int
[Ω]
: OnInt → View.Arith Typ.int
An operator with a result of sort
Int. - real
[Ω]
: OnRat → View.Arith Typ.real
An operator with a result of sort
Rat. - any
[Ω]
{τ : Typ}
: OnAny τ.Denote → View.Arith τ
An operator whose result's sort is a type variable.
- bool
[Ω]
: OnBool → View.Arith Typ.bool
An operator with a result of sort
Bool.
Instances For
Arith's operators with a result of sort Rat.
- realDiv
[Ω]
(kids : Kids Rat)
: OnRat
Real division, left-associative; unspecified on a zero divisor.
kidsholds every operand, two or more. - realDivTotal
[Ω]
(kids : Kids Rat)
: OnRat
Real division, left-associative; zero on a zero divisor.
kidsholds every operand, two or more. - sqrt
[Ω]
(arg : Term Rat)
: OnRat
Square root.
- exp
[Ω]
(arg : Term Rat)
: OnRat
The exponential function.
- toReal
[Ω]
(α : Typ)
{h0 : α.isArith = true}
(arithTerm : Term α.Denote)
: OnRat
Conversion to a real.
- sine
[Ω]
(arg : Term Rat)
: OnRat
Sine.
- cosine
[Ω]
(arg : Term Rat)
: OnRat
Cosine.
- tangent
[Ω]
(arg : Term Rat)
: OnRat
Tangent.
- cosecant
[Ω]
(arg : Term Rat)
: OnRat
Cosecant.
- secant
[Ω]
(arg : Term Rat)
: OnRat
Secant.
- cotangent
[Ω]
(arg : Term Rat)
: OnRat
Cotangent.
- arcsine
[Ω]
(arg : Term Rat)
: OnRat
Arc sine.
- arccosine
[Ω]
(arg : Term Rat)
: OnRat
Arc cosine.
- arctangent
[Ω]
(arg : Term Rat)
: OnRat
Arc tangent.
- arccosecant
[Ω]
(arg : Term Rat)
: OnRat
Arc cosecant.
- arcsecant
[Ω]
(arg : Term Rat)
: OnRat
Arc secant.
- arccotangent
[Ω]
(arg : Term Rat)
: OnRat
Arc cotangent.
- pi
[Ω]
: OnRat
The constant π.
Instances For
Arith's operators whose result's sort is a type variable.
- neg
[Ω]
{β : Type}
[ToTyp β]
{h0 : (Typ.of β).isArith = true}
(arithTerm : Term β)
: OnAny β
Arithmetic negation.
- add
[Ω]
{β : Type}
[ToTyp β]
{h0 : (Typ.of β).isArith = true}
(kids : Kids β)
: OnAny β
Binary addition.
kidsholds every operand, two or more. - sub
[Ω]
{β : Type}
[ToTyp β]
{h0 : (Typ.of β).isArith = true}
(kids : Kids β)
: OnAny β
Binary subtraction;
subNis left-associative.kidsholds every operand, two or more. - mul
[Ω]
{β : Type}
[ToTyp β]
{h0 : (Typ.of β).isArith = true}
(kids : Kids β)
: OnAny β
Binary multiplication.
kidsholds every operand, two or more. - abs
[Ω]
{β : Type}
[ToTyp β]
{h0 : (Typ.of β).isArith = true}
(arithTerm : Term β)
: OnAny β
Absolute value.
- pow
[Ω]
{β : Type}
[ToTyp β]
{h0 : (Typ.of β).isArith = true}
(base exponent : Term β)
: OnAny β
Exponentiation.
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.
kidsholds every operand, two or more. - intDivTotal
[Ω]
(kids : Kids Int)
: OnInt
Euclidean integer division, left-associative; zero on a zero divisor.
kidsholds 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
sizebits oflftandrgt; zero whensize ≤ 0. - iand
[Ω]
(size : Nat)
(lft rgt : Term Int)
: OnInt
Bit-wise and of the low
sizebits oflftandrgt.
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.
- lt [Ω] (α : Typ) {h0 : α.isArith = true} (kids : Kids α.Denote) : OnBool
- le [Ω] (α : Typ) {h0 : α.isArith = true} (kids : Kids α.Denote) : OnBool
- gt [Ω] (α : Typ) {h0 : α.isArith = true} (kids : Kids α.Denote) : OnBool
- ge [Ω] (α : Typ) {h0 : α.isArith = true} (kids : Kids α.Denote) : OnBool
- isInt
[Ω]
(α : Typ)
{h0 : α.isArith = true}
(arithTerm : Term α.Denote)
: OnBool
Whether an arithmetic term denotes an integer.
- divisible
[Ω]
(divisor : Nat)
(arg : Term Int)
: OnBool
Whether
argis divisible bydivisor.
Instances For
Values #
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
- term.isInt32Value = Cvc.Untyped.Term.isInt32Value term
Instances For
Get the Int32 representation of this integral value.
NB: requires that this term is an Int32 value (see isInt32Value).
Equations
- term.getInt32Value = Cvc.Untyped.Term.getInt32Value term
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
- term.isInt64Value = Cvc.Untyped.Term.isInt64Value term
Instances For
Get the Int64 representation of this integral value.
NB: requires that this term is an Int64 value (see isInt64Value).
Equations
- term.getInt64Value = Cvc.Untyped.Term.getInt64Value term
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
- term.isUInt32Value = Cvc.Untyped.Term.isUInt32Value term
Instances For
Get the UInt32 representation of this integral value.
NB: requires that this term is an UInt32 value (see isUInt32Value).
Equations
- term.getUInt32Value = Cvc.Untyped.Term.getUInt32Value term
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
- term.isUInt64Value = Cvc.Untyped.Term.isUInt64Value term
Instances For
Get the UInt64 representation of this integral value.
NB: requires that this term is an UInt64 value (see isUInt64Value).
Equations
- term.getUInt64Value = Cvc.Untyped.Term.getUInt64Value term
Instances For
Whether a term denotes a real that fits a 32-bit numerator and denominator.
Equations
- term.isReal32Value = Cvc.Untyped.Term.isReal32Value term
Instances For
The numerator and denominator of a real value, at 32 bits.
Equations
- term.getReal32Value = Cvc.Untyped.Term.getReal32Value term
Instances For
Whether a term denotes a real that fits a 64-bit numerator and denominator.
Equations
- term.isReal64Value = Cvc.Untyped.Term.isReal64Value term
Instances For
The numerator and denominator of a real value, at 64 bits.
Equations
- term.getReal64Value = Cvc.Untyped.Term.getReal64Value term
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
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
- term.isIntValue = Cvc.Untyped.Term.isIntValue term
Instances For
The integer a term denotes, failing if it denotes none.
Equations
- term.getIntValue = Cvc.Untyped.Term.getIntValue term
Instances For
The integer a term denotes, failing if it denotes none.
Equations
- term.getIntValue? = Cvc.Untyped.Term.getIntValue? term
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
- term.isRealValue = Cvc.Untyped.Term.isRealValue term
Instances For
The real a term denotes as a string, failing if it denotes none.
Equations
- term.getRealValue = Cvc.Untyped.Term.getRealValue term
Instances For
The real a term denotes as a string, failing if it denotes none.
Equations
- term.getRealValue? = Cvc.Untyped.Term.getRealValue? term
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
- term.getRatValue = Cvc.Untyped.Term.getRatValue term
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
- term.getRatValue? = Cvc.Untyped.Term.getRatValue? term
Instances For
Equations
- Cvc.Typed.Term.instSrtLikeInt = { toToTyp := Cvc.ToTyp.instInt, termToValue := fun [Cvc.Ω] (t : Cvc.Typed.Term Int) => liftM t.getIntValue, valueToTerm := fun [Cvc.Ω] => Cvc.Typed.Term.mkInt }
Equations
- Cvc.Typed.Term.instSrtLikeRat = { toToTyp := Cvc.ToTyp.instRat, termToValue := fun [Cvc.Ω] (t : Cvc.Typed.Term Rat) => liftM t.getRatValue, valueToTerm := fun [Cvc.Ω] => Cvc.Typed.Term.mkReal }