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

Safe HaskellNone
LanguageHaskell2010

Agda.TypeChecking.Coverage.Match

Synopsis

Documentation

data Match a Source #

If matching is inconclusive (Block) we want to know which variables or projections are blocking the match.

Constructors

Yes a

Matches unconditionally.

No

Definitely does not match.

Block 

Fields

Instances
Functor Match Source # 
Instance details

Defined in Agda.TypeChecking.Coverage.Match

Methods

fmap :: (a -> b) -> Match a -> Match b #

(<$) :: a -> Match b -> Match a #

match :: (MonadReduce m, HasConstInfo m, HasBuiltins m) => [Clause] -> [NamedArg SplitPattern] -> m (Match (Nat, [SplitPattern])) Source #

Given

  1. the function clauses cs
  2. the patterns ps

we want to compute a variable index of the split clause to split on next.

First, we find the set cs' of all the clauses that are instances (via substitutions rhos) of the split clause.

In these substitutions, we look for a column that has only constructor patterns. We try to split on this column first.

Match the given patterns against a list of clauses

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.

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.

Constructors

BlockingVar 

Fields

data BlockedOnResult Source #

Constructors

BlockedOnProj

Blocked on unsplit projection

Fields

BlockedOnApply

Blocked on unintroduced argument

Fields

NotBlockedOnResult