Skip to content

Commit ff6925f

Browse files
authored
Update Symbols module (#704)
1 parent f462624 commit ff6925f

File tree

2 files changed

+45
-19
lines changed

2 files changed

+45
-19
lines changed

src/intervals/interval_operations/boolean.jl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ isequal_interval(x) = Base.Fix2(isequal_interval, x)
4141
Test whether `x` is contained in `y`.
4242
4343
Implement the `subset` function of the IEEE Standard 1788-2015 (Table 9.3).
44+
45+
See also: [`isstrictsubset`](@ref) and [`isinterior`](@ref).
4446
"""
4547
issubset_interval(x::BareInterval, y::BareInterval) = (inf(y) inf(x)) & (sup(x) sup(y))
4648

@@ -64,16 +66,15 @@ issubset_interval(x, y, z, w...) = issubset_interval(x, y) & issubset_interval(y
6466
"""
6567
isstrictsubset(x, y)
6668
67-
Test whether `x` is a strict subset of `y`. If `x` and `y` are intervals, this
68-
is semantically equivalent to `isinterior(x, y)`. If `x` and `y` are vectors,
69-
`x` must be a subset of `y` with at least one of their component being a strict
70-
subset.
69+
Test whether `x` is a subset of, but not equal to, `y`. If `x` and `y` are
70+
vectors, `x` must be a subset of `y` with at least one of their component being
71+
a strict subset.
7172
72-
See also: [`isinterior`](@ref).
73+
See also: [`issubset_interval`](@ref) and [`isinterior`](@ref).
7374
"""
74-
isstrictsubset(x::BareInterval, y::BareInterval) = isinterior(x, y)
75+
isstrictsubset(x::BareInterval, y::BareInterval) = issubset_interval(x, y) & !isequal_interval(x, y)
7576

76-
isstrictsubset(x::Interval, y::Interval) = isinterior(x, y)
77+
isstrictsubset(x::Interval, y::Interval) = issubset_interval(x, y) & !isequal_interval(x, y)
7778
isstrictsubset(x::Complex{<:Interval}, y::Complex{<:Interval}) =
7879
(isstrictsubset(real(x), real(y)) & issubset_interval(imag(x), imag(y))) | (issubset_interval(real(x), real(y)) & isstrictsubset(imag(x), imag(y)))
7980
isstrictsubset(x::Complex{<:Interval}, y::Interval) = isstrictsubset(real(x), y) & isthinzero(imag(x))
@@ -83,15 +84,16 @@ isstrictsubset(x::AbstractVector, y::AbstractVector) = issubset_interval(x, y) &
8384

8485
isstrictsubset(x, y, z, w...) = isstrictsubset(x, y) & isstrictsubset(y, z, w...)
8586

87+
isstrictsubset(x) = Base.Fix2(isstrictsubset, x)
88+
8689
"""
8790
isinterior(x, y)
8891
89-
Test whether `x` is in the interior of `y`. If `x` and `y` are intervals, this
90-
is semantically equivalent to `isstrictsubset(x, y)`.
92+
Test whether `x` is in the interior of `y`.
9193
9294
Implement the `interior` function of the IEEE Standard 1788-2015 (Table 9.3).
9395
94-
See also: [`isstrictsubset`](@ref).
96+
See also: [`issubset_interval`](@ref) and [`isstrictsubset`](@ref).
9597
"""
9698
isinterior(x::BareInterval, y::BareInterval) =
9799
_strictlessprime(inf(y), inf(x)) & _strictlessprime(sup(x), sup(y))

src/symbols.jl

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Symbols
22

33
using IntervalArithmetic
4-
export .., ±, , , , ∅, ℝ, ,
4+
export .., ±, , , , , , , , , ∅, ℝ
55

66
"""
77
..(a, b)
@@ -74,39 +74,63 @@ Interval{Rational{Int64}}(-85563208//27235615, 85563208//27235615, com)
7474
7575
Unicode alias of [`isequal_interval`](@ref).
7676
"""
77-
(x, y) = isequal_interval(x, y)
77+
const = isequal_interval
7878

7979
"""
80-
≺(x, y)
81-
x ≺ y
80+
⊑(x, y)
81+
x ⊑ y
82+
83+
Unicode alias of [`issubset_interval`](@ref).
84+
"""
85+
const = issubset_interval
8286

83-
Unicode alias of [`strictprecedes`](@ref).
8487
"""
85-
(x, y) = strictprecedes(x, y)
88+
⋤(x, y)
89+
x ⋤ y
90+
91+
Unicode alias of [`isstrictsubset`](@ref).
92+
"""
93+
const = isstrictsubset
8694

8795
"""
8896
⪽(x, y)
8997
x ⪽ y
9098
9199
Unicode alias of [`isinterior`](@ref).
92100
"""
93-
(x, y) = isinterior(x, y)
101+
const = isinterior
102+
103+
"""
104+
⪯(x, y)
105+
x ⪯ y
106+
107+
Unicode alias of [`precedes`](@ref).
108+
"""
109+
const = precedes
110+
111+
"""
112+
≺(x, y)
113+
x ≺ y
114+
115+
Unicode alias of [`strictprecedes`](@ref).
116+
"""
117+
const = strictprecedes
94118

95119
"""
96120
⊔(x, y)
97121
x ⊔ y
98122
99123
Unicode alias of [`hull`](@ref).
100124
"""
101-
(x, y) = hull(x, y)
125+
const = hull
102126

103127
"""
104128
⊓(x, y)
105129
x ⊓ y
106130
107131
Unicode alias of [`intersect_interval`](@ref).
108132
"""
109-
(x, y) = intersect_interval(x, y)
133+
const = intersect_interval
110134

111135
"""
112136

0 commit comments

Comments
 (0)