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 :: (MonadReduce m, HasConstInfo m, HasBuiltins m) => [Clause] -> [NamedArg SplitPattern] -> m (Match (Nat, SplitInstantiation))
- matchClause :: (MonadReduce m, HasConstInfo m, HasBuiltins m) => [NamedArg SplitPattern] -> Clause -> m MatchResult
- type SplitPattern = Pattern' SplitPatVar
- data SplitPatVar = SplitPatVar {}
- fromSplitPatterns :: [NamedArg SplitPattern] -> [NamedArg DeBruijnPattern]
- toSplitPatterns :: [NamedArg DeBruijnPattern] -> [NamedArg SplitPattern]
- toSplitPSubst :: PatternSubstitution -> SplitPSubstitution
- applySplitPSubst :: Subst Term a => SplitPSubstitution -> a -> a
- isTrivialPattern :: HasConstInfo m => Pattern' a -> m Bool
- data BlockingVar = BlockingVar {}
- type BlockingVars = [BlockingVar]
- data BlockedOnResult
- 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 | |
|
:: (MonadReduce m, HasConstInfo m, HasBuiltins 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.
:: (MonadReduce m, HasConstInfo m, HasBuiltins m) | |
=> [NamedArg SplitPattern] | Split clause patterns |
-> Clause | Clause |
-> m MatchResult | Result.
If |
matchClause qs i c
checks whether clause c
covers a split clause with patterns qs
.
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.
Instances
Show SplitPatVar Source # | |
Defined in Agda.TypeChecking.Coverage.Match showsPrec :: Int -> SplitPatVar -> ShowS # show :: SplitPatVar -> String # showList :: [SplitPatVar] -> ShowS # | |
Pretty SplitPatVar Source # | |
Defined in Agda.TypeChecking.Coverage.Match pretty :: SplitPatVar -> Doc Source # prettyPrec :: Int -> SplitPatVar -> Doc Source # prettyList :: [SplitPatVar] -> Doc Source # | |
DeBruijn SplitPatVar Source # | |
Defined in Agda.TypeChecking.Coverage.Match deBruijnVar :: Int -> SplitPatVar Source # debruijnNamedVar :: String -> Int -> SplitPatVar Source # deBruijnView :: SplitPatVar -> Maybe Int Source # | |
PrettyTCM SplitPatVar Source # | |
Defined in Agda.TypeChecking.Coverage.Match prettyTCM :: MonadPretty m => SplitPatVar -> m Doc Source # | |
Subst SplitPattern SplitPattern Source # | |
Defined in Agda.TypeChecking.Coverage.Match |
toSplitPSubst :: PatternSubstitution -> SplitPSubstitution Source #
applySplitPSubst :: Subst Term 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
Show BlockingVar Source # | |
Defined in Agda.TypeChecking.Coverage.Match showsPrec :: Int -> BlockingVar -> ShowS # show :: BlockingVar -> String # showList :: [BlockingVar] -> ShowS # | |
Pretty BlockingVar Source # | |
Defined in Agda.TypeChecking.Coverage.Match pretty :: BlockingVar -> Doc Source # prettyPrec :: Int -> BlockingVar -> Doc Source # prettyList :: [BlockingVar] -> Doc Source # |
type BlockingVars = [BlockingVar] Source #
data BlockedOnResult Source #
Missing elimination blocking a match.
BlockedOnProj | Blocked on unsplit projection. |
| |
BlockedOnApply | Blocked on unintroduced argument. |
| |
NotBlockedOnResult |