aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/library/lux/abstract/interval.lux
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--stdlib/source/library/lux/abstract/interval.lux54
1 files changed, 27 insertions, 27 deletions
diff --git a/stdlib/source/library/lux/abstract/interval.lux b/stdlib/source/library/lux/abstract/interval.lux
index fcad3b26d..8531fc3ca 100644
--- a/stdlib/source/library/lux/abstract/interval.lux
+++ b/stdlib/source/library/lux/abstract/interval.lux
@@ -77,29 +77,29 @@
(All (_ a) (-> (Interval a) (Interval a) (Interval a)))
(implementation
(def enum (the enum right))
- (def bottom (order.min (at right order) (at left bottom) (at right bottom)))
- (def top (order.max (at right order) (at left top) (at right top)))))
+ (def bottom (order.min (of right order) (of left bottom) (of right bottom)))
+ (def top (order.max (of right order) (of left top) (of right top)))))
(def .public (intersection left right)
(All (_ a) (-> (Interval a) (Interval a) (Interval a)))
(implementation
(def enum (the enum right))
- (def bottom (order.max (at right order) (at left bottom) (at right bottom)))
- (def top (order.min (at right order) (at left top) (at right top)))))
+ (def bottom (order.max (of right order) (of left bottom) (of right bottom)))
+ (def top (order.min (of right order) (of left top) (of right top)))))
(def .public (complement interval)
(All (_ a) (-> (Interval a) (Interval a)))
(implementation
(def enum (the enum interval))
- (def bottom (at interval succ (at interval top)))
- (def top (at interval pred (at interval bottom)))))
+ (def bottom (of interval succ (of interval top)))
+ (def top (of interval pred (of interval bottom)))))
(def .public (precedes? reference sample)
(All (_ a) (-> (Interval a) (Interval a) Bit))
(let [(open "[0]") reference
- limit (at reference bottom)]
- (and (< limit (at sample bottom))
- (< limit (at sample top)))))
+ limit (of reference bottom)]
+ (and (< limit (of sample bottom))
+ (< limit (of sample top)))))
(def .public (succeeds? reference sample)
(All (_ a) (-> (Interval a) (Interval a) Bit))
@@ -119,9 +119,9 @@
(def .public (meets? reference sample)
(All (_ a) (-> (Interval a) (Interval a) Bit))
(let [(open ",#[0]") reference
- limit (at reference bottom)]
- (and (,#= limit (at sample top))
- (order.<= ,#order limit (at sample bottom)))))
+ limit (of reference bottom)]
+ (and (,#= limit (of sample top))
+ (order.<= ,#order limit (of sample bottom)))))
(def .public (touches? reference sample)
(All (_ a) (-> (Interval a) (Interval a) Bit))
@@ -132,11 +132,11 @@
[(def .public (<name> reference sample)
(All (_ a) (-> (Interval a) (Interval a) Bit))
(let [(open ",#[0]") reference]
- (and (,#= (at reference <eq_side>)
- (at sample <eq_side>))
+ (and (,#= (of reference <eq_side>)
+ (of sample <eq_side>))
(<ineq> ,#order
- (at reference <ineq_side>)
- (at sample <ineq_side>)))))]
+ (of reference <ineq_side>)
+ (of sample <ineq_side>)))))]
[starts? ,#bottom order.<= ,#top]
[finishes? ,#top order.>= ,#bottom]
@@ -147,8 +147,8 @@
(implementation
(def (= reference sample)
(let [(open ",#[0]") reference]
- (and (,#= ,#bottom (at sample bottom))
- (,#= ,#top (at sample top)))))))
+ (and (,#= ,#bottom (of sample bottom))
+ (,#= ,#top (of sample top)))))))
(def .public (nested? reference sample)
(All (_ a) (-> (Interval a) (Interval a) Bit))
@@ -156,8 +156,8 @@
(and (inner? reference) (inner? sample))
(and (outer? reference) (outer? sample)))
(let [(open ",#[0]") reference]
- (and (order.>= ,#order (at reference bottom) (at sample bottom))
- (order.<= ,#order (at reference top) (at sample top))))
+ (and (order.>= ,#order (of reference bottom) (of sample bottom))
+ (order.<= ,#order (of reference top) (of sample top))))
(or (singleton? reference)
(and (inner? reference) (outer? sample)))
@@ -165,16 +165,16 @@
... (and (outer? reference) (inner? sample))
(let [(open ",#[0]") reference]
- (or (and (order.>= ,#order (at reference bottom) (at sample bottom))
- (order.> ,#order (at reference bottom) (at sample top)))
- (and (,#< (at reference top) (at sample bottom))
- (order.<= ,#order (at reference top) (at sample top)))))
+ (or (and (order.>= ,#order (of reference bottom) (of sample bottom))
+ (order.> ,#order (of reference bottom) (of sample top)))
+ (and (,#< (of reference top) (of sample bottom))
+ (order.<= ,#order (of reference top) (of sample top)))))
))
(def .public (overlaps? reference sample)
(All (_ a) (-> (Interval a) (Interval a) Bit))
(let [(open ",#[0]") reference]
- (and (not (at ..equivalence = reference sample))
+ (and (not (of ..equivalence = reference sample))
(cond (singleton? sample)
false
@@ -183,8 +183,8 @@
(or (and (inner? sample) (outer? reference))
(and (outer? sample) (inner? reference)))
- (or (order.>= ,#order (at reference bottom) (at sample top))
- (order.<= ,#order (at reference top) (at sample bottom)))
+ (or (order.>= ,#order (of reference bottom) (of sample top))
+ (order.<= ,#order (of reference top) (of sample bottom)))
... both inner
(inner? sample)