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

Safe Haskell | None
Language | Haskell2010

Agda.TypeChecking.SizedTypes.Syntax

Contents

- Syntax
- Polarities to specify solutions.
- Solutions.
- Constraint simplification
- Printing
- Wellformedness
- Computing variable sets

Description

Syntax of size expressions and constraints.

Synopsis

- newtype Offset = O Int
- newtype Rigid = RigidId {
  - rigidId :: String
  }
- newtype Flex = FlexId {
  - flexId :: String
  }
- data SizeExpr' rigid flex
  - = Const {
    - offset :: Offset
    }
  - | Rigid {
    - rigid :: rigid
    - offset :: Offset
    }
  - | Infty
  - | Flex {
    - flex :: flex
    - offset :: Offset
    }
- type SizeExpr = SizeExpr' Rigid Flex
- data Cmp
  - = Lt
  - | Le
- data Constraint' rigid flex = Constraint {
  - leftExpr :: SizeExpr' rigid flex
  - cmp :: Cmp
  - rightExpr :: SizeExpr' rigid flex
  }
- type Constraint = Constraint' Rigid Flex
- data Polarity
  - = Least
  - | Greatest
- data PolarityAssignment flex = PolarityAssignment Polarity flex
- type Polarities flex = Map flex Polarity
- emptyPolarities :: Polarities flex
- polaritiesFromAssignments :: Ord flex => [PolarityAssignment flex] -> Polarities flex
- getPolarity :: Ord flex => Polarities flex -> flex -> Polarity
- newtype Solution rigid flex = Solution {
  - theSolution :: Map flex (SizeExpr' rigid flex)
  }
- emptySolution :: Solution r f
- class Substitute r f a where
  - subst :: Solution r f -> a -> a
- type CTrans r f = Constraint' r f -> Either String [Constraint' r f]
- simplify1 :: (Pretty f, Pretty r, Eq r) => CTrans r f -> CTrans r f
- ifLe :: Cmp -> a -> a -> a
- compareOffset :: Offset -> Cmp -> Offset -> Bool
- class ValidOffset a where
  - validOffset :: a -> Bool
- class TruncateOffset a where
  - truncateOffset :: a -> a
- class Rigids r a where
  - rigids :: a -> Set r
- class Flexs flex a | a -> flex where
  - flexs :: a -> Set flex

# Syntax

newtype Offset Source #

Constant finite sizes `n >= 0`.

Constructors

O Int |

Instances

Enum Offset Source # |

Instance details

Defined in Agda.TypeChecking.SizedTypes.Syntax

Methods

succ :: Offset -> Offset Source #

pred :: Offset -> Offset Source #

toEnum :: Int -> Offset Source #

fromEnum :: Offset -> Int Source #

enumFrom :: Offset -> [Offset] Source #

enumFromThen :: Offset -> Offset -> [Offset] Source #

enumFromTo :: Offset -> Offset -> [Offset] Source #

enumFromThenTo :: Offset -> Offset -> Offset -> [Offset] Source #

Eq Offset Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods (==) :: Offset -> Offset -> Bool Source # (/=) :: Offset -> Offset -> Bool Source #
Num Offset Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods (+) :: Offset -> Offset -> Offset Source # (-) :: Offset -> Offset -> Offset Source # (*) :: Offset -> Offset -> Offset Source # negate :: Offset -> Offset Source # abs :: Offset -> Offset Source # signum :: Offset -> Offset Source # fromInteger :: Integer -> Offset Source #
Ord Offset Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods compare :: Offset -> Offset -> Ordering Source # (<) :: Offset -> Offset -> Bool Source # (<=) :: Offset -> Offset -> Bool Source # (>) :: Offset -> Offset -> Bool Source # (>=) :: Offset -> Offset -> Bool Source # max :: Offset -> Offset -> Offset Source # min :: Offset -> Offset -> Offset Source #
Show Offset Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods showsPrec :: Int -> Offset -> ShowS Source # show :: Offset -> String Source # showList :: [Offset] -> ShowS Source #
MeetSemiLattice Offset Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods meet :: Offset -> Offset -> Offset Source #
Pretty Offset Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods pretty :: Offset -> Doc Source # prettyPrec :: Int -> Offset -> Doc Source # prettyList :: [Offset] -> Doc Source #
TruncateOffset Offset Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods truncateOffset :: Offset -> Offset Source #
ValidOffset Offset Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods validOffset :: Offset -> Bool Source #
Negative Offset Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.WarshallSolver Methods negative :: Offset -> Bool Source #
Plus Offset Offset Offset Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods plus :: Offset -> Offset -> Offset Source #
Plus Offset Weight Weight Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.WarshallSolver Methods plus :: Offset -> Weight -> Weight Source #
Plus Weight Offset Weight Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.WarshallSolver Methods plus :: Weight -> Offset -> Weight Source #
Plus (SizeExpr' r f) Offset (SizeExpr' r f) Source # | Add offset to size expression.
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods plus :: SizeExpr' r f -> Offset -> SizeExpr' r f Source #

newtype Rigid Source #

Fixed size variables `i`.

Constructors

RigidId |

Fields

- rigidId :: String

Instances

Eq Rigid Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods (==) :: Rigid -> Rigid -> Bool Source # (/=) :: Rigid -> Rigid -> Bool Source #
Ord Rigid Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods compare :: Rigid -> Rigid -> Ordering Source # (<) :: Rigid -> Rigid -> Bool Source # (<=) :: Rigid -> Rigid -> Bool Source # (>) :: Rigid -> Rigid -> Bool Source # (>=) :: Rigid -> Rigid -> Bool Source # max :: Rigid -> Rigid -> Rigid Source # min :: Rigid -> Rigid -> Rigid Source #
Show Rigid Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods showsPrec :: Int -> Rigid -> ShowS Source # show :: Rigid -> String Source # showList :: [Rigid] -> ShowS Source #
Pretty Rigid Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods pretty :: Rigid -> Doc Source # prettyPrec :: Int -> Rigid -> Doc Source # prettyList :: [Rigid] -> Doc Source #

newtype Flex Source #

Size meta variables `X` to solve for.

Constructors

FlexId |

Fields

- flexId :: String

Instances

Eq Flex Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods (==) :: Flex -> Flex -> Bool Source # (/=) :: Flex -> Flex -> Bool Source #
Ord Flex Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods compare :: Flex -> Flex -> Ordering Source # (<) :: Flex -> Flex -> Bool Source # (<=) :: Flex -> Flex -> Bool Source # (>) :: Flex -> Flex -> Bool Source # (>=) :: Flex -> Flex -> Bool Source # max :: Flex -> Flex -> Flex Source # min :: Flex -> Flex -> Flex Source #
Show Flex Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods showsPrec :: Int -> Flex -> ShowS Source # show :: Flex -> String Source # showList :: [Flex] -> ShowS Source #
Pretty Flex Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods pretty :: Flex -> Doc Source # prettyPrec :: Int -> Flex -> Doc Source # prettyList :: [Flex] -> Doc Source #

data SizeExpr' rigid flex Source #

Size expressions appearing in constraints.

Constructors

Const | Constant number `n`.

Fields

- offset :: Offset

Rigid | Variable plus offset `i + n`.

Fields

- rigid :: rigid
- offset :: Offset

Infty | Infinity `∞`.
Flex | Meta variable `X + n`.

Fields

- flex :: flex
- offset :: Offset

Instances

Ord f => Substitute r f (SizeExpr' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods subst :: Solution r f -> SizeExpr' r f -> SizeExpr' r f Source #
Flexs flex (SizeExpr' rigid flex) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods flexs :: SizeExpr' rigid flex -> Set flex Source #
Rigids r (SizeExpr' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods rigids :: SizeExpr' r f -> Set r Source #
Subst Term (SizeExpr' NamedRigid SizeMeta) Source # | Only for `raise`.
Instance details Defined in Agda.TypeChecking.SizedTypes.Solve Methods applySubst :: Substitution' Term -> SizeExpr' NamedRigid SizeMeta -> SizeExpr' NamedRigid SizeMeta Source #
Functor (SizeExpr' rigid) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods fmap :: (a -> b) -> SizeExpr' rigid a -> SizeExpr' rigid b Source # (<$) :: a -> SizeExpr' rigid b -> SizeExpr' rigid a Source #
Foldable (SizeExpr' rigid) Source # |

Instance details

Defined in Agda.TypeChecking.SizedTypes.Syntax

Methods

fold :: Monoid m => SizeExpr' rigid m -> m Source #

foldMap :: Monoid m => (a -> m) -> SizeExpr' rigid a -> m Source #

foldr :: (a -> b -> b) -> b -> SizeExpr' rigid a -> b Source #

foldr' :: (a -> b -> b) -> b -> SizeExpr' rigid a -> b Source #

foldl :: (b -> a -> b) -> b -> SizeExpr' rigid a -> b Source #

foldl' :: (b -> a -> b) -> b -> SizeExpr' rigid a -> b Source #

foldr1 :: (a -> a -> a) -> SizeExpr' rigid a -> a Source #

foldl1 :: (a -> a -> a) -> SizeExpr' rigid a -> a Source #

toList :: SizeExpr' rigid a -> [a] Source #

null :: SizeExpr' rigid a -> Bool Source #

length :: SizeExpr' rigid a -> Int Source #

elem :: Eq a => a -> SizeExpr' rigid a -> Bool Source #

maximum :: Ord a => SizeExpr' rigid a -> a Source #

minimum :: Ord a => SizeExpr' rigid a -> a Source #

sum :: Num a => SizeExpr' rigid a -> a Source #

product :: Num a => SizeExpr' rigid a -> a Source #

Traversable (SizeExpr' rigid) Source # |

Instance details

Defined in Agda.TypeChecking.SizedTypes.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> SizeExpr' rigid a -> f (SizeExpr' rigid b) Source #

sequenceA :: Applicative f => SizeExpr' rigid (f a) -> f (SizeExpr' rigid a) Source #

mapM :: Monad m => (a -> m b) -> SizeExpr' rigid a -> m (SizeExpr' rigid b) Source #

sequence :: Monad m => SizeExpr' rigid (m a) -> m (SizeExpr' rigid a) Source #

(Eq rigid, Eq flex) => Eq (SizeExpr' rigid flex) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods (==) :: SizeExpr' rigid flex -> SizeExpr' rigid flex -> Bool Source # (/=) :: SizeExpr' rigid flex -> SizeExpr' rigid flex -> Bool Source #
(Ord rigid, Ord flex) => Ord (SizeExpr' rigid flex) Source # |

Instance details

Defined in Agda.TypeChecking.SizedTypes.Syntax

Methods

compare :: SizeExpr' rigid flex -> SizeExpr' rigid flex -> Ordering Source #

(<) :: SizeExpr' rigid flex -> SizeExpr' rigid flex -> Bool Source #

(<=) :: SizeExpr' rigid flex -> SizeExpr' rigid flex -> Bool Source #

(>) :: SizeExpr' rigid flex -> SizeExpr' rigid flex -> Bool Source #

(>=) :: SizeExpr' rigid flex -> SizeExpr' rigid flex -> Bool Source #

max :: SizeExpr' rigid flex -> SizeExpr' rigid flex -> SizeExpr' rigid flex Source #

min :: SizeExpr' rigid flex -> SizeExpr' rigid flex -> SizeExpr' rigid flex Source #

(Show rigid, Show flex) => Show (SizeExpr' rigid flex) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods showsPrec :: Int -> SizeExpr' rigid flex -> ShowS Source # show :: SizeExpr' rigid flex -> String Source # showList :: [SizeExpr' rigid flex] -> ShowS Source #
(Pretty r, Pretty f) => Pretty (SizeExpr' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods pretty :: SizeExpr' r f -> Doc Source # prettyPrec :: Int -> SizeExpr' r f -> Doc Source # prettyList :: [SizeExpr' r f] -> Doc Source #
TruncateOffset (SizeExpr' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods truncateOffset :: SizeExpr' r f -> SizeExpr' r f Source #
ValidOffset (SizeExpr' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods validOffset :: SizeExpr' r f -> Bool Source #
Plus (SizeExpr' r f) Offset (SizeExpr' r f) Source # | Add offset to size expression.
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods plus :: SizeExpr' r f -> Offset -> SizeExpr' r f Source #
Plus (SizeExpr' r f) Label (SizeExpr' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.WarshallSolver Methods plus :: SizeExpr' r f -> Label -> SizeExpr' r f Source #
Plus (SizeExpr' r f) Weight (SizeExpr' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.WarshallSolver Methods plus :: SizeExpr' r f -> Weight -> SizeExpr' r f Source #

type SizeExpr = SizeExpr' Rigid Flex Source #

data Cmp Source #

Comparison operator, e.g. for size expression.

Constructors

Lt | `<`.
Le | `≤`.

Instances

Bounded Cmp Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods minBound :: Cmp Source # maxBound :: Cmp Source #
Enum Cmp Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods succ :: Cmp -> Cmp Source # pred :: Cmp -> Cmp Source # toEnum :: Int -> Cmp Source # fromEnum :: Cmp -> Int Source # enumFrom :: Cmp -> [Cmp] Source # enumFromThen :: Cmp -> Cmp -> [Cmp] Source # enumFromTo :: Cmp -> Cmp -> [Cmp] Source # enumFromThenTo :: Cmp -> Cmp -> Cmp -> [Cmp] Source #
Eq Cmp Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods (==) :: Cmp -> Cmp -> Bool Source # (/=) :: Cmp -> Cmp -> Bool Source #
Ord Cmp Source # | Comparison operator is ordered ``Lt` < `Le``.
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods compare :: Cmp -> Cmp -> Ordering Source # (<) :: Cmp -> Cmp -> Bool Source # (<=) :: Cmp -> Cmp -> Bool Source # (>) :: Cmp -> Cmp -> Bool Source # (>=) :: Cmp -> Cmp -> Bool Source # max :: Cmp -> Cmp -> Cmp Source # min :: Cmp -> Cmp -> Cmp Source #
Show Cmp Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods showsPrec :: Int -> Cmp -> ShowS Source # show :: Cmp -> String Source # showList :: [Cmp] -> ShowS Source #
Dioid Cmp Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods compose :: Cmp -> Cmp -> Cmp Source # unitCompose :: Cmp Source #
MeetSemiLattice Cmp Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods meet :: Cmp -> Cmp -> Cmp Source #
Top Cmp Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods top :: Cmp Source # isTop :: Cmp -> Bool Source #
Pretty Cmp Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods pretty :: Cmp -> Doc Source # prettyPrec :: Int -> Cmp -> Doc Source # prettyList :: [Cmp] -> Doc Source #

data Constraint' rigid flex Source #

Constraint: an inequation between size expressions, e.g. `X < ∞` or `i + 3 ≤ j`.

Constructors

Constraint |

Fields

- leftExpr :: SizeExpr' rigid flex
- cmp :: Cmp
- rightExpr :: SizeExpr' rigid flex

Instances

PrettyTCM SizeConstraint Source # | Assumes we are in the right context.
Instance details Defined in Agda.TypeChecking.SizedTypes.Solve Methods prettyTCM :: SizeConstraint -> TCM Doc Source #
Subst Term SizeConstraint Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Solve Methods applySubst :: Substitution' Term -> SizeConstraint -> SizeConstraint Source #
Ord f => Substitute r f (Constraint' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods subst :: Solution r f -> Constraint' r f -> Constraint' r f Source #
Ord flex => Flexs flex (Constraint' rigid flex) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods flexs :: Constraint' rigid flex -> Set flex Source #
Ord r => Rigids r (Constraint' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods rigids :: Constraint' r f -> Set r Source #
Functor (Constraint' rigid) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods fmap :: (a -> b) -> Constraint' rigid a -> Constraint' rigid b Source # (<$) :: a -> Constraint' rigid b -> Constraint' rigid a Source #
Foldable (Constraint' rigid) Source # |

Instance details

Defined in Agda.TypeChecking.SizedTypes.Syntax

Methods

fold :: Monoid m => Constraint' rigid m -> m Source #

foldMap :: Monoid m => (a -> m) -> Constraint' rigid a -> m Source #

foldr :: (a -> b -> b) -> b -> Constraint' rigid a -> b Source #

foldr' :: (a -> b -> b) -> b -> Constraint' rigid a -> b Source #

foldl :: (b -> a -> b) -> b -> Constraint' rigid a -> b Source #

foldl' :: (b -> a -> b) -> b -> Constraint' rigid a -> b Source #

foldr1 :: (a -> a -> a) -> Constraint' rigid a -> a Source #

foldl1 :: (a -> a -> a) -> Constraint' rigid a -> a Source #

toList :: Constraint' rigid a -> [a] Source #

null :: Constraint' rigid a -> Bool Source #

length :: Constraint' rigid a -> Int Source #

elem :: Eq a => a -> Constraint' rigid a -> Bool Source #

maximum :: Ord a => Constraint' rigid a -> a Source #

minimum :: Ord a => Constraint' rigid a -> a Source #

sum :: Num a => Constraint' rigid a -> a Source #

product :: Num a => Constraint' rigid a -> a Source #

Traversable (Constraint' rigid) Source # |

Instance details

Defined in Agda.TypeChecking.SizedTypes.Syntax

Methods

traverse :: Applicative f => (a -> f b) -> Constraint' rigid a -> f (Constraint' rigid b) Source #

sequenceA :: Applicative f => Constraint' rigid (f a) -> f (Constraint' rigid a) Source #

mapM :: Monad m => (a -> m b) -> Constraint' rigid a -> m (Constraint' rigid b) Source #

sequence :: Monad m => Constraint' rigid (m a) -> m (Constraint' rigid a) Source #

(Show rigid, Show flex) => Show (Constraint' rigid flex) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods showsPrec :: Int -> Constraint' rigid flex -> ShowS Source # show :: Constraint' rigid flex -> String Source # showList :: [Constraint' rigid flex] -> ShowS Source #
(Pretty r, Pretty f) => Pretty (Constraint' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods pretty :: Constraint' r f -> Doc Source # prettyPrec :: Int -> Constraint' r f -> Doc Source # prettyList :: [Constraint' r f] -> Doc Source #

type Constraint = Constraint' Rigid Flex Source #

# Polarities to specify solutions.

data Polarity Source #

What type of solution are we looking for?

Constructors

Least |
Greatest |

Instances

Eq Polarity Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods (==) :: Polarity -> Polarity -> Bool Source # (/=) :: Polarity -> Polarity -> Bool Source #
Ord Polarity Source # |

Instance details

Defined in Agda.TypeChecking.SizedTypes.Syntax

Methods

compare :: Polarity -> Polarity -> Ordering Source #

(<) :: Polarity -> Polarity -> Bool Source #

(<=) :: Polarity -> Polarity -> Bool Source #

(>) :: Polarity -> Polarity -> Bool Source #

(>=) :: Polarity -> Polarity -> Bool Source #

max :: Polarity -> Polarity -> Polarity Source #

min :: Polarity -> Polarity -> Polarity Source #

Pretty Polarity Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods pretty :: Polarity -> Doc Source # prettyPrec :: Int -> Polarity -> Doc Source # prettyList :: [Polarity] -> Doc Source #

data PolarityAssignment flex Source #

Assigning a polarity to a flexible variable.

Constructors

PolarityAssignment Polarity flex |

Instances

Pretty flex => Pretty (PolarityAssignment flex) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods pretty :: PolarityAssignment flex -> Doc Source # prettyPrec :: Int -> PolarityAssignment flex -> Doc Source # prettyList :: [PolarityAssignment flex] -> Doc Source #

type Polarities flex = Map flex Polarity Source #

Type of solution wanted for each flexible.

emptyPolarities :: Polarities flex Source #

polaritiesFromAssignments :: Ord flex => [PolarityAssignment flex] -> Polarities flex Source #

getPolarity :: Ord flex => Polarities flex -> flex -> Polarity Source #

Default polarity is `Least`.

# Solutions.

newtype Solution rigid flex Source #

Partial substitution from flexible variables to size expression.

Constructors

Solution |

Fields

- theSolution :: Map flex (SizeExpr' rigid flex)

Instances

Ord f => Substitute r f (Solution r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods subst :: Solution r f -> Solution r f -> Solution r f Source #
(Show flex, Show rigid) => Show (Solution rigid flex) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods showsPrec :: Int -> Solution rigid flex -> ShowS Source # show :: Solution rigid flex -> String Source # showList :: [Solution rigid flex] -> ShowS Source #
Null (Solution rigid flex) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods empty :: Solution rigid flex Source # null :: Solution rigid flex -> Bool Source #
(Pretty r, Pretty f) => Pretty (Solution r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods pretty :: Solution r f -> Doc Source # prettyPrec :: Int -> Solution r f -> Doc Source # prettyList :: [Solution r f] -> Doc Source #

emptySolution :: Solution r f Source #

class Substitute r f a where Source #

Executing a substitution.

Methods

subst :: Solution r f -> a -> a Source #

Instances

Substitute r f a => Substitute r f [a] Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods subst :: Solution r f -> [a] -> [a] Source #
Ord f => Substitute r f (Solution r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods subst :: Solution r f -> Solution r f -> Solution r f Source #
Substitute r f a => Substitute r f (Map k a) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods subst :: Solution r f -> Map k a -> Map k a Source #
Ord f => Substitute r f (Constraint' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods subst :: Solution r f -> Constraint' r f -> Constraint' r f Source #
Ord f => Substitute r f (SizeExpr' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods subst :: Solution r f -> SizeExpr' r f -> SizeExpr' r f Source #

# Constraint simplification

type CTrans r f = Constraint' r f -> Either String [Constraint' r f] Source #

simplify1 :: (Pretty f, Pretty r, Eq r) => CTrans r f -> CTrans r f Source #

Returns an error message if we have a contradictory constraint.

ifLe :: Cmp -> a -> a -> a Source #

`Le` acts as `True`, `Lt` as `False`.

compareOffset :: Offset -> Cmp -> Offset -> Bool Source #

Interpret `Cmp` as relation on `Offset`.

# Printing

# Wellformedness

class ValidOffset a where Source #

Offsets `+ n` must be non-negative

Methods

validOffset :: a -> Bool Source #

Instances

ValidOffset Offset Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods validOffset :: Offset -> Bool Source #
ValidOffset (SizeExpr' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods validOffset :: SizeExpr' r f -> Bool Source #

class TruncateOffset a where Source #

Make offsets non-negative by rounding up.

Methods

truncateOffset :: a -> a Source #

Instances

TruncateOffset Offset Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods truncateOffset :: Offset -> Offset Source #
TruncateOffset (SizeExpr' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods truncateOffset :: SizeExpr' r f -> SizeExpr' r f Source #

# Computing variable sets

class Rigids r a where Source #

The rigid variables contained in a pice of syntax.

Methods

rigids :: a -> Set r Source #

Instances

(Ord r, Rigids r a) => Rigids r [a] Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods rigids :: [a] -> Set r Source #
Ord r => Rigids r (Constraint' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods rigids :: Constraint' r f -> Set r Source #
Rigids r (SizeExpr' r f) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods rigids :: SizeExpr' r f -> Set r Source #

class Flexs flex a | a -> flex where Source #

The flexibe variables contained in a pice of syntax.

Methods

flexs :: a -> Set flex Source #

Instances

Flexs SizeMeta HypSizeConstraint Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Solve Methods flexs :: HypSizeConstraint -> Set SizeMeta Source #
(Ord flex, Flexs flex a) => Flexs flex [a] Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods flexs :: [a] -> Set flex Source #
Ord flex => Flexs flex (Constraint' rigid flex) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods flexs :: Constraint' rigid flex -> Set flex Source #
Flexs flex (SizeExpr' rigid flex) Source # |
Instance details Defined in Agda.TypeChecking.SizedTypes.Syntax Methods flexs :: SizeExpr' rigid flex -> Set flex Source #