Interval Set #
This file contains the definition of interval sets (IntervalSet),
a sorted set of non-overlapping intervals (Interval.nonOverlapping).
BoundedOrder is used to define negation of interval sets (IntervalSet.negate).
Equations
- instBoundedOrderChar = { bot := Char.min, bot_le := Char.min_le, top := Char.maxChar, le_top := Char.le_max }
 
Equations
- One or more equations did not get rendered due to their size.
 
Equations
- instInhabitedNonemptyIntervalChar = { default := { toProd := default, fst_le_snd := instInhabitedNonemptyIntervalChar._proof_1 } }
 
Nonempty intervals r1 and r2 are non overlapping when they are sorted and
they are not overlapping or adjacent, i.e. the difference of r2.fst and r1.snd
is greater than one. Intervals with a difference of one are canonicalized
to a new NonemptyInterval (IntervalSet.canonicalize).
Instances For
Equations
- Interval.instDecidableNonOverlapping r1 r2 = inferInstanceAs (Decidable (1 < r2.fst - r1.snd))
 
create intersection of intervals r1 and r2 if it exists.
Equations
- One or more equations did not get rendered due to their size.
 
Instances For
Equations
- Interval.Char.sub c₁ c₂ = c₁.toNat - c₂.toNat
 
Instances For
Equations
create interval between intervals r1 and r2.
Equations
Instances For
remove duplicate
Equations
- One or more equations did not get rendered due to their size.
 
Instances For
a list of intervals is non overlapping when intervals are sorted and no intervals are overlapping or adjacent
Equations
- Intervals.dataIsNonOverlapping [] = (true = true)
 - Intervals.dataIsNonOverlapping [head] = (true = true)
 - Intervals.dataIsNonOverlapping (head :: tail) = List.IsChain Interval.nonOverlapping (head :: tail)
 
Instances For
an array of intervals is non overlapping when intervals.data is non overlapping
Equations
- Intervals.nonOverlapping intervals = Intervals.dataIsNonOverlapping intervals.toList
 
Instances For
Equations
- instToStringIntervalSetChar = { toString := fun (s : IntervalSet Char) => toString s.intervals }
 
last element of array intervals is non overlapping with NonemptyInterval next
Equations
- Interval.nonOverlappingWithLast intervals (some next_2) = Interval.nonOverlapping last next_2
 - Interval.nonOverlappingWithLast intervals (some val) = (true = true)
 - Interval.nonOverlappingWithLast intervals none = (true = true)
 - Interval.nonOverlappingWithLast intervals none = (false = true)
 
Instances For
Accumulator for loop in canonicalize
- next : Option (NonemptyInterval Char)
 - set : IntervalSet Char
 - nonOverlapping : nonOverlappingWithLast self.set.intervals self.next
 
Instances For
Instances For
is next.fst equal to n.fst