Equations
- Std.Time.Internal.Bounded.instLE = { le := fun (l r : Std.Time.Internal.Bounded rel n m) => l.val ≤ r.val }
Equations
- Std.Time.Internal.Bounded.instLT = { lt := fun (l r : Std.Time.Internal.Bounded rel n m) => l.val < r.val }
Equations
- Std.Time.Internal.Bounded.instRepr = { reprPrec := fun (n_1 : Std.Time.Internal.Bounded rel m n) => reprPrec n_1.val }
Equations
- Std.Time.Internal.Bounded.instBEq = { beq := fun (x y : Std.Time.Internal.Bounded rel n m) => decide (x.val = y.val) }
Equations
- Std.Time.Internal.Bounded.instDecidableLe = inferInstanceAs (Decidable (x.val ≤ y.val))
A Bounded integer that the relation used is the the less-equal relation so, it includes all
integers that lo ≤ val ≤ hi.
Instances For
Casts the boundaries of the Bounded using equivalences.
Equations
- Std.Time.Internal.Bounded.cast h₁ h₂ b = ⟨b.val, ⋯⟩
Instances For
A Bounded integer that the relation used is the the less-than relation so, it includes all
integers that lo < val < hi.
Instances For
Creates a new Bounded Integer.
Equations
- Std.Time.Internal.Bounded.mk val proof = ⟨val, proof⟩
Instances For
Convert a Int to a Bounded if it checks.
Equations
- Std.Time.Internal.Bounded.ofInt? val = if h : rel lo val ∧ rel val hi then some ⟨val, h⟩ else none
Instances For
Convert a Nat to a Bounded.LE by wrapping it.
Equations
Instances For
Equations
- Std.Time.Internal.Bounded.LE.instOfNatHAddIntCast = { ofNat := let h := ⋯; Std.Time.Internal.Bounded.LE.ofNatWrapping (↑n) h }
Equations
- Std.Time.Internal.Bounded.LE.instInhabitedHAddIntCast = { default := let h := ⋯; Std.Time.Internal.Bounded.LE.ofNatWrapping lo h }
Creates a new Bounded integer that the relation is less-equal.
Equations
- Std.Time.Internal.Bounded.LE.mk val proof = ⟨val, proof⟩
Instances For
Creates a new Bounded integer that the relation is less-equal.
Equations
- Std.Time.Internal.Bounded.LE.exact val = ⟨↑val, ⋯⟩
Instances For
Creates a new Bounded integer.
Equations
Instances For
Convert a Nat to a Bounded.LE.
Equations
Instances For
Convert a Nat to a Bounded.LE if it checks.
Equations
- Std.Time.Internal.Bounded.LE.ofNat? val = if h : val ≤ hi then some (Std.Time.Internal.Bounded.LE.ofNat val h) else none
Instances For
Convert a Nat to a Bounded.LE using the lower boundary too.
Equations
Instances For
Convert a Nat to a Bounded.LE using the lower boundary too.
Equations
- Std.Time.Internal.Bounded.LE.clip val h = if h₀ : lo ≤ val then if h₁ : val ≤ hi then ⟨val, ⋯⟩ else ⟨hi, ⋯⟩ else ⟨lo, ⋯⟩
Instances For
Convert a Bounded.LE to a Nat.
Equations
- n.toNat' h = match n.val, ⋯ with | Int.ofNat n, x => n | Int.negSucc a, h => ⋯.elim
Instances For
Convert a Bounded.LE to a Fin.
Equations
- n.toFin h₀ = ⟨n.val.toNat, ⋯⟩
Instances For
Convert a Fin to a Bounded.LE.
Equations
Instances For
Convert a Fin to a Bounded.LE.
Equations
- Std.Time.Internal.Bounded.LE.ofFin' fin h = if h₁ : ↑fin ≥ lo then Std.Time.Internal.Bounded.LE.ofNat' ↑fin ⋯ else Std.Time.Internal.Bounded.LE.ofNat' lo ⋯
Instances For
Creates a new Bounded.LE using a the modulus of a number.
Equations
- Std.Time.Internal.Bounded.LE.byEmod b i hi = ⟨b % i, ⋯⟩
Instances For
Creates a new Bounded.LE using a the Truncating modulus of a number.
Equations
- Std.Time.Internal.Bounded.LE.byMod b i hi = ⟨b.tmod i, ⋯⟩
Instances For
Adjust the bounds of a Bounded by setting the lower bound to zero and the maximum value to (m - n).
Instances For
Adjust the bounds of a Bounded by changing the higher bound if another value j satisfies the same
constraint.
Equations
- bounded.truncateTop h = ⟨bounded.val, ⋯⟩
Instances For
Adjust the bounds of a Bounded by changing the lower bound if another value j satisfies the same
constraint.
Equations
- bounded.truncateBottom h = ⟨bounded.val, ⋯⟩
Instances For
Adjust the bounds of a Bounded by adding a constant value to both the lower and upper bounds.
Instances For
Adjust the bounds of a Bounded by adding a constant value to both the lower and upper bounds.
Instances For
Adjust the bounds of a Bounded by adding a constant value to both the lower and upper bounds.
Instances For
Adjust the bounds of a Bounded by adding a constant value to the upper bounds.
Instances For
Adjust the bounds of a Bounded by adding a constant value to the lower bounds.
Instances For
Adds two Bounded and adjust the boundaries.
Instances For
Adjust the bounds of a Bounded by subtracting a constant value to both the lower and upper bounds.
Instances For
Adds two Bounded and adjust the boundaries.
Equations
- bounded.subBounds bounded₂ = bounded.addBounds bounded₂.neg
Instances For
Adjust the bounds of a Bounded by applying the emod operation constraining the lower bound to 0 and
the upper bound to the value.
Equations
- bounded.emod num hi = Std.Time.Internal.Bounded.LE.byEmod bounded.val num hi
Instances For
Adjust the bounds of a Bounded by applying the mod operation.
Equations
- bounded.mod num hi = Std.Time.Internal.Bounded.LE.byMod bounded.val num hi
Instances For
Adjust the bounds of a Bounded by applying the multiplication operation with a positive number.
Instances For
Adjust the bounds of a Bounded by applying the multiplication operation with a positive number.
Instances For
Adjust the bounds of a Bounded by applying the div operation.
Equations
- bounded.ediv num h = match ⋯ with | ⋯ => ⟨bounded.val.ediv num, ⋯⟩
Instances For
Expand the range of a bounded value.
Equations
- bounded.expand h h₁ = ⟨bounded.val, ⋯⟩
Instances For
Expand the bottom of the bounded to a number nhi is hi is less or equal to the previous higher bound.
Equations
- bounded.expandTop h = bounded.expand h ⋯
Instances For
Expand the bottom of the bounded to a number nlo if lo is greater or equal to the previous lower bound.
Equations
- bounded.expandBottom h = bounded.expand ⋯ h
Instances For
Adds one to the value of the bounded if the value is less than the higher bound of the bounded number.
Instances For
Returns the absolute value of the bounded number bo with bounds -(i - 1) to i - 1. The result
will be a new bounded number with bounds 0 to i - 1.
Equations
Instances For
Returns the maximum between a number and the bounded.