Agda-2.5.4: A dependently typed functional programming language and proof assistant

Safe HaskellSafe
LanguageHaskell2010

Agda.Utils.IntSet.Infinite

Description

Possibly infinite sets of integers (but with finitely many consecutive segments). Used for checking guard coverage in int/nat cases in the treeless compiler.

Synopsis

Documentation

data IntSet #

Represents a set of integers. Invariants: - All cannot be the argument to Below or Above - at most one IntsBelow - at most one IntsAbove - if `Below lo` and `Below hi`, then `lo < hi` - if `Below lo .. (Some xs)` then `all (> lo) xs` - if `Above hi .. (Some xs)` then `all (< hi - 1) xs`

Instances
Eq IntSet # 
Instance details

Defined in Agda.Utils.IntSet.Infinite

Methods

(==) :: IntSet -> IntSet -> Bool #

(/=) :: IntSet -> IntSet -> Bool #

Show IntSet # 
Instance details

Defined in Agda.Utils.IntSet.Infinite

Semigroup IntSet # 
Instance details

Defined in Agda.Utils.IntSet.Infinite

Monoid IntSet # 
Instance details

Defined in Agda.Utils.IntSet.Infinite

empty :: IntSet #

No integers.

full :: IntSet #

All integers.

below :: Integer -> IntSet #

All integers `< n`

above :: Integer -> IntSet #

All integers `>= n`

singleton :: Integer -> IntSet #

A single integer.

member :: Integer -> IntSet -> Bool #

Membership

toFiniteList :: IntSet -> Maybe [Integer] #

If finite, return the list of elements.

invariant :: IntSet -> Bool #

Invariant.