-- | Force a value in the Sierpinski space into Booleans. This may diverge as bottom cannot be
-- reliably detected.
force :: Sigma -> Bool
force p = loop 0
          where loop k
                   | approximate p (prec RoundDown k) = True -- lower approximation is True, the value is top
                   | not (approximate p (prec RoundUp k)) = False -- upper approximation is False, the value is bottom
                   | otherwise = loop (k+1)

-- | The Show instance may cause divergence because 'force' could diverge. An alternative
-- implementation would give up after a while, and the user would have to use 'force' explicitly to
-- get the exact results (or divergence).
force :: Sigma -> Bool
force p = loop 0
          where loop k
                   | approximate p (prec RoundDown k) = True -- lower approximation is True, the value is top
                   | not (approximate p (prec RoundUp k)) = False -- upper approximation is False, the value is bottom
                   | otherwise = loop (k+1)

-- | The Show instance may cause divergence because 'force' could diverge. An alternative
-- implementation would give up after a while, and the user would have to use 'force' explicitly to
-- get the exact results (or divergence).
force p = loop 0
          where loop k
                   | approximate p (prec RoundDown k) = True -- lower approximation is True, the value is top
                   | not (approximate p (prec RoundUp k)) = False -- upper approximation is False, the value is bottom
                   | otherwise = loop (k+1)

-- | The Show instance may cause divergence because 'force' could diverge. An alternative
-- implementation would give up after a while, and the user would have to use 'force' explicitly to
-- get the exact results (or divergence).