Agda-2.6.20240731: A dependently typed functional programming language and proof assistant
Safe HaskellNone
LanguageHaskell2010

Agda.TypeChecking.Coverage.SplitTree

Description

Split tree for transforming pattern clauses into case trees.

The coverage checker generates a split tree from the clauses. The clause compiler uses it to transform clauses to case trees.

The initial problem is a set of clauses. The root node designates on which argument to split and has subtrees for all the constructors. Splitting continues until there is only a single clause left at each leaf of the split tree.

Synopsis

Documentation

data SplitTree' a Source #

Abstract case tree shape.

Constructors

SplittingDone

No more splits coming. We are at a single, all-variable clause.

Fields

SplitAt

A split is necessary.

Fields

Instances

Instances details
DropArgs SplitTree Source # 
Instance details

Defined in Agda.TypeChecking.DropArgs

Methods

dropArgs :: Int -> SplitTree -> SplitTree Source #

Pretty a => Pretty (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

KillRange a => KillRange (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

EmbPrj a => EmbPrj (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Serialise.Instances.Internal

Methods

icode :: SplitTree' a -> S Int32 Source #

icod_ :: SplitTree' a -> S Int32 Source #

value :: Int32 -> R (SplitTree' a) Source #

NFData a => NFData (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

rnf :: SplitTree' a -> ()

Generic (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Associated Types

type Rep (SplitTree' a) 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

type Rep (SplitTree' a) = D1 ('MetaData "SplitTree'" "Agda.TypeChecking.Coverage.SplitTree" "Agda-2.6.20240731-inplace" 'False) (C1 ('MetaCons "SplittingDone" 'PrefixI 'True) (S1 ('MetaSel ('Just "splitBindings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "SplitAt" 'PrefixI 'True) (S1 ('MetaSel ('Just "splitArg") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Arg Int)) :*: (S1 ('MetaSel ('Just "splitLazy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LazySplit) :*: S1 ('MetaSel ('Just "splitTrees") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SplitTrees' a)))))

Methods

from :: SplitTree' a -> Rep (SplitTree' a) x

to :: Rep (SplitTree' a) x -> SplitTree' a

Show a => Show (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

showsPrec :: Int -> SplitTree' a -> ShowS

show :: SplitTree' a -> String

showList :: [SplitTree' a] -> ShowS

type Rep (SplitTree' a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

type Rep (SplitTree' a) = D1 ('MetaData "SplitTree'" "Agda.TypeChecking.Coverage.SplitTree" "Agda-2.6.20240731-inplace" 'False) (C1 ('MetaCons "SplittingDone" 'PrefixI 'True) (S1 ('MetaSel ('Just "splitBindings") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :+: C1 ('MetaCons "SplitAt" 'PrefixI 'True) (S1 ('MetaSel ('Just "splitArg") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Arg Int)) :*: (S1 ('MetaSel ('Just "splitLazy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LazySplit) :*: S1 ('MetaSel ('Just "splitTrees") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SplitTrees' a)))))

data LazySplit Source #

Constructors

LazySplit 
StrictSplit 

Instances

Instances details
EmbPrj LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Serialise.Instances.Internal

Methods

icode :: LazySplit -> S Int32 Source #

icod_ :: LazySplit -> S Int32 Source #

value :: Int32 -> R LazySplit Source #

NFData LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

rnf :: LazySplit -> ()

Generic LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Associated Types

type Rep LazySplit 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

type Rep LazySplit = D1 ('MetaData "LazySplit" "Agda.TypeChecking.Coverage.SplitTree" "Agda-2.6.20240731-inplace" 'False) (C1 ('MetaCons "LazySplit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "StrictSplit" 'PrefixI 'False) (U1 :: Type -> Type))

Methods

from :: LazySplit -> Rep LazySplit x

to :: Rep LazySplit x -> LazySplit

Show LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

showsPrec :: Int -> LazySplit -> ShowS

show :: LazySplit -> String

showList :: [LazySplit] -> ShowS

Eq LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

(==) :: LazySplit -> LazySplit -> Bool

(/=) :: LazySplit -> LazySplit -> Bool

Ord LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

compare :: LazySplit -> LazySplit -> Ordering

(<) :: LazySplit -> LazySplit -> Bool

(<=) :: LazySplit -> LazySplit -> Bool

(>) :: LazySplit -> LazySplit -> Bool

(>=) :: LazySplit -> LazySplit -> Bool

max :: LazySplit -> LazySplit -> LazySplit

min :: LazySplit -> LazySplit -> LazySplit

type Rep LazySplit Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

type Rep LazySplit = D1 ('MetaData "LazySplit" "Agda.TypeChecking.Coverage.SplitTree" "Agda-2.6.20240731-inplace" 'False) (C1 ('MetaCons "LazySplit" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "StrictSplit" 'PrefixI 'False) (U1 :: Type -> Type))

type SplitTrees' a = [(a, SplitTree' a)] Source #

Split tree branching. A finite map from constructor names to splittrees A list representation seems appropriate, since we are expecting not so many constructors per data type, and there is no need for random access.

data SplitTag Source #

Tag for labeling branches of a split tree. Each branch is associated to either a constructor or a literal, or is a catchall branch (currently only used for splitting on a literal type).

Instances

Instances details
Pretty SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

KillRange SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

DropArgs SplitTree Source # 
Instance details

Defined in Agda.TypeChecking.DropArgs

Methods

dropArgs :: Int -> SplitTree -> SplitTree Source #

PrettyTCM SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Pretty

EmbPrj SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Serialise.Instances.Internal

Methods

icode :: SplitTag -> S Int32 Source #

icod_ :: SplitTag -> S Int32 Source #

value :: Int32 -> R SplitTag Source #

NFData SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

rnf :: SplitTag -> ()

Generic SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Associated Types

type Rep SplitTag 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

type Rep SplitTag = D1 ('MetaData "SplitTag" "Agda.TypeChecking.Coverage.SplitTree" "Agda-2.6.20240731-inplace" 'False) (C1 ('MetaCons "SplitCon" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 QName)) :+: (C1 ('MetaCons "SplitLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Literal)) :+: C1 ('MetaCons "SplitCatchall" 'PrefixI 'False) (U1 :: Type -> Type)))

Methods

from :: SplitTag -> Rep SplitTag x

to :: Rep SplitTag x -> SplitTag

Show SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

showsPrec :: Int -> SplitTag -> ShowS

show :: SplitTag -> String

showList :: [SplitTag] -> ShowS

Eq SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

(==) :: SplitTag -> SplitTag -> Bool

(/=) :: SplitTag -> SplitTag -> Bool

Ord SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

Methods

compare :: SplitTag -> SplitTag -> Ordering

(<) :: SplitTag -> SplitTag -> Bool

(<=) :: SplitTag -> SplitTag -> Bool

(>) :: SplitTag -> SplitTag -> Bool

(>=) :: SplitTag -> SplitTag -> Bool

max :: SplitTag -> SplitTag -> SplitTag

min :: SplitTag -> SplitTag -> SplitTag

type Rep SplitTag Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

type Rep SplitTag = D1 ('MetaData "SplitTag" "Agda.TypeChecking.Coverage.SplitTree" "Agda-2.6.20240731-inplace" 'False) (C1 ('MetaCons "SplitCon" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 QName)) :+: (C1 ('MetaCons "SplitLit" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Literal)) :+: C1 ('MetaCons "SplitCatchall" 'PrefixI 'False) (U1 :: Type -> Type)))

Printing a split tree

data SplitTreeLabel a Source #

Constructors

SplitTreeLabel 

Fields

Instances

Instances details
Pretty a => Pretty (SplitTreeLabel a) Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.SplitTree

toTree :: SplitTree' a -> Tree (SplitTreeLabel a) Source #

Convert a split tree into a Tree (for printing).