Safe Haskell | None |
---|---|
Language | Haskell2010 |
Given
- the function clauses
cs
- the patterns
ps
of the split clause
we want to compute a variable index (in the split clause) to split on next.
The matcher here checks whether the split clause is covered by one of
the given clauses cs
or whether further splitting is needed (and
when yes, where).
Synopsis
- data Match a
- match :: PureTCM m => [Clause] -> [NamedArg SplitPattern] -> m (Match (Nat, SplitInstantiation))
- matchClause :: PureTCM m => [NamedArg SplitPattern] -> Clause -> m MatchResult
- type SplitPattern = Pattern' SplitPatVar
- data SplitPatVar = SplitPatVar {
- splitPatVarName :: PatVarName
- splitPatVarIndex :: Int
- splitExcludedLits :: [Literal]
- fromSplitPattern :: NamedArg SplitPattern -> NamedArg DeBruijnPattern
- fromSplitPatterns :: [NamedArg SplitPattern] -> [NamedArg DeBruijnPattern]
- toSplitPatterns :: [NamedArg DeBruijnPattern] -> [NamedArg SplitPattern]
- toSplitPSubst :: PatternSubstitution -> SplitPSubstitution
- applySplitPSubst :: TermSubst a => SplitPSubstitution -> a -> a
- isTrivialPattern :: HasConstInfo m => Pattern' a -> m Bool
- data BlockingVar = BlockingVar {
- blockingVarNo :: Nat
- blockingVarCons :: [ConHead]
- blockingVarLits :: [Literal]
- blockingVarOverlap :: Bool
- blockingVarLazy :: Bool
- type BlockingVars = [BlockingVar]
- data BlockedOnResult
- = BlockedOnProj {
- blockedOnResultOverlap :: Bool
- | BlockedOnApply { }
- | NotBlockedOnResult
- = BlockedOnProj {
- setBlockingVarOverlap :: BlockingVar -> BlockingVar
- data ApplyOrIApply
Documentation
If matching is inconclusive (Block
) we want to know which
variables or projections are blocking the match.
Yes a | Matches unconditionally. |
No | Definitely does not match. |
Block | |
|
:: PureTCM m | |
=> [Clause] | Search for clause that covers the patterns. |
-> [NamedArg SplitPattern] | Patterns of the current |
-> m (Match (Nat, SplitInstantiation)) |
Match the given patterns against a list of clauses.
If successful, return the index of the covering clause.
:: PureTCM m | |
=> [NamedArg SplitPattern] | Split clause patterns |
-> Clause | Clause |
-> m MatchResult | Result.
If |
type SplitPattern = Pattern' SplitPatVar Source #
data SplitPatVar Source #
For each variable in the patterns of a split clause, we remember the de Bruijn-index and the literals excluded by previous matches.
SplitPatVar | |
|
Instances
Pretty SplitPatVar Source # | |||||
Defined in Agda.TypeChecking.Coverage.Match pretty :: SplitPatVar -> Doc Source # prettyPrec :: Int -> SplitPatVar -> Doc Source # prettyList :: [SplitPatVar] -> Doc Source # | |||||
PrettyTCM SplitPatVar Source # | |||||
Defined in Agda.TypeChecking.Coverage.Match prettyTCM :: MonadPretty m => SplitPatVar -> m Doc Source # | |||||
Subst SplitPattern Source # | |||||
Defined in Agda.TypeChecking.Coverage.Match
| |||||
DeBruijn SplitPatVar Source # | |||||
Defined in Agda.TypeChecking.Coverage.Match deBruijnVar :: Int -> SplitPatVar Source # debruijnNamedVar :: String -> Int -> SplitPatVar Source # deBruijnView :: SplitPatVar -> Maybe Int Source # | |||||
Show SplitPatVar Source # | |||||
Defined in Agda.TypeChecking.Coverage.Match showsPrec :: Int -> SplitPatVar -> ShowS show :: SplitPatVar -> String showList :: [SplitPatVar] -> ShowS | |||||
type SubstArg SplitPattern Source # | |||||
Defined in Agda.TypeChecking.Coverage.Match |
toSplitPSubst :: PatternSubstitution -> SplitPSubstitution Source #
applySplitPSubst :: TermSubst a => SplitPSubstitution -> a -> a Source #
isTrivialPattern :: HasConstInfo m => Pattern' a -> m Bool Source #
A pattern that matches anything (modulo eta).
data BlockingVar Source #
Variable blocking a match.
BlockingVar | |
|
Instances
Pretty BlockingVar Source # | |
Defined in Agda.TypeChecking.Coverage.Match pretty :: BlockingVar -> Doc Source # prettyPrec :: Int -> BlockingVar -> Doc Source # prettyList :: [BlockingVar] -> Doc Source # | |
Show BlockingVar Source # | |
Defined in Agda.TypeChecking.Coverage.Match showsPrec :: Int -> BlockingVar -> ShowS show :: BlockingVar -> String showList :: [BlockingVar] -> ShowS |
type BlockingVars = [BlockingVar] Source #
data BlockedOnResult Source #
Missing elimination blocking a match.
BlockedOnProj | Blocked on unsplit projection. |
| |
BlockedOnApply | Blocked on unintroduced argument. |
| |
NotBlockedOnResult |