This is a (possibly) more efficient variation on Slade's algorithm elsewhere in this thread.
- Let $x$ be the smallest point not yet covered; initially $x=0$.
- Let $S$ be a partial finite subcover, initially $\emptyset$
- Let $L$ be a list of the open intervals considered so far, initially $\emptyset$
- Repeat until $x>1$:
- If $L$ contains an interval $(a,b)$ with $x\in (a,b)$ then
- Insert $(a,b)$ into $S$
- Set $x=b$
- If not, then read another interval from the open cover and add it to $L$.
- $S$ now contains a finite open cover of $[0,1]$ that is a subcover of the given cover.
The test "If $L$ contains..." is finite; it needs only examine the finite list $L$.
The outer repeat
loop must terminate because $[0,1]$ is compact.
The algorithm is therefore guaranteed to terminate in finite time if presented with an open cover of $[0,1]$.
There is an obvious optimization: after reading an interval and adding it to $L$, skip the “if $L$ contains an interval…” test unless $x$ is a member of the latest interval.