Skip to content

Commit efc85a6

Browse files
committed
updates
1 parent f832b9e commit efc85a6

File tree

5 files changed

+566
-547
lines changed

5 files changed

+566
-547
lines changed

README.md

Lines changed: 58 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,85 @@
1-
Disjoint Interval Set
2-
=====================
1+
# Disjoint Interval Set
32

43
The Disjoint Interval Set (DIS) equipped with a few operations
54
satisfies the concept of a Boolean algebra over sets of disjoint
65
intervals equipped with all the standard set-theoretic operations,
76
like intersection (*), union (+), and complement (~).
87

9-
### Boolean Algebra
8+
## Concept: Boolean Algebra
9+
1010
A Boolean algebra provides a powerful conceptual and mathematical framework.
1111
It is a set of elements equipped with a few operations that satisfy
1212
a few axioms. The operations are usually called union (+), intersection (*),
1313
and complement (~). The axioms are usually called the Boolean laws.
1414

15-
## DIS Operations
16-
The DIS supports the following operations:
15+
## Constructors
16+
17+
The DIS supports the following constructors:
18+
19+
- **Empty Constructor**: `disjoint_interval_set()`
20+
21+
Create an empty DIS.
22+
23+
- **Constructor From Iterable**: `disjoint_interval_set(intervals)`
24+
25+
Create a DIS from an iterable of intervals.
26+
27+
- **Copy Constructor**: `disjoint_interval_set(disjoint_interval_set)`
28+
29+
Create a copy of a DIS.
30+
31+
## Set-Theoretic Operations
32+
33+
The DIS supports the following set-theoretic operations:
34+
35+
- **Union**: `operator+(disjoint_interval_set, disjoint_interval_set)`
1736

18-
1. `disjoint_interval_set()`: Create an empty DIS.
19-
2. `disjoint_interval_set(intervals)`: Create a DIS from an iterable of intervals.
20-
3. `disjoint_interval_set(disjoint_interval_set)`: Create a copy of a DIS.
21-
4. `operator+(disjoint_interval_set, disjoint_interval_set)`: Union of two DIS.
22-
5. `operator*(disjoint_interval_set, disjoint_interval_set)`: Intersection of two DIS.
23-
6. `operator~(disjoint_interval_set)`: Complement of a DIS.
37+
Create a DIS that is the union of two DIS.
38+
39+
- **Intersection**: `operator*(disjoint_interval_set, disjoint_interval_set)`
40+
41+
Create a DIS that is the intersection of two DIS.
42+
43+
- **Complement**: `operator~(disjoint_interval_set)`
44+
45+
Create a DIS that is the complement of a DIS.
46+
47+
- **Set-Difference**: `operator-(disjoint_interval_set, disjoint_interval_set)`
48+
49+
Create a DIS that is the set difference of two DIS.
50+
51+
- **Symmetric Difference**: `operator^(disjoint_interval_set, disjoint_interval_set)`
52+
53+
Create a DIS that is the symmetric difference of two DIS.
54+
55+
## Predicates
2456

25-
## DIS Predicates
2657
The DIS supports the following predicates:
2758

28-
1. `is_empty(disjoint_interval_set)`: Check if a DIS is empty.
59+
- **Empty**: `is_empty(disjoint_interval_set)`: Check if a DIS is empty.
2960

30-
2. relational predicates `==`, `!=`, `<`, `<=`, `>`, `>=`:
61+
- **Relational Predicates**: `==`, `!=`, `<`, `<=`, `>`, `>=`:
3162

32-
Compare two DIS for equality, inequality, subset, proper subset, superset,
33-
and proper superset.
63+
Compare two DIS for equality, inequality, subset, proper subset, superset,
64+
and proper superset.
3465

35-
These also work with intervals and values. For example, `DIS == interval`,
36-
since an interval can be considered a DIS with a single interval and a
37-
value can be considered an interval with a single value, `[value, value]`.
66+
These also work with intervals and values. For example, `DIS == interval`,
67+
since an interval can be considered a DIS with a single interval and a
68+
value can be considered an interval with a single value, `[value, value]`.
3869

39-
3. `contains(disjoint_interval_set, value)`: Check if a DIS contains a value.
70+
- **Set Membership**: `contains(disjoint_interval_set, value)`
4071

72+
Check if a DIS contains a value.
4173

42-
## Generic Programming
74+
## Interval Type
4375

4476
The DIS is parameterized by the interval type. The interval type must
45-
satisfy the concept of an interval:
46-
77+
satisfy the concept of an interval.
4778

4879
### Interval Concept
80+
4981
An interval is a pair of values that satisfy the following axioms:
5082

51-
1. `lower(interval)`: Return the lower bound of the interval.
52-
2. `upper(interval)`: Return the upper bound of the interval.
53-
3. `contains(interval, value)`: Check if the interval contains a value.
83+
- `infimum(interval)`: Return the infimum of the interval.
84+
- `supremum(interval)`: Return the supremum of the interval.
85+
- `contains(interval, value)`: Check if the interval contains a value.

0 commit comments

Comments
 (0)