Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Non-linear matching of the lhs of a rewrite rule against a neutral term.
Given a lhs
Δ ⊢ lhs : B
and a candidate term
Γ ⊢ t : A
we seek a substitution Γ ⊢ σ : Δ such that
Γ ⊢ B[σ] = A and Γ ⊢ lhs[σ] = t : A
Synopsis
- newtype NLM a = NLM {}
- data NLMState = NLMState {}
- nlmSub :: Lens' Sub NLMState
- nlmEqs :: Lens' PostponedEquations NLMState
- runNLM :: MonadReduce m => NLM () -> m (Either Blocked_ NLMState)
- matchingBlocked :: Blocked_ -> NLM ()
- tellSub :: Relevance -> Int -> Type -> Term -> NLM ()
- tellEq :: Telescope -> Telescope -> Type -> Term -> Term -> NLM ()
- type Sub = IntMap (Relevance, Term)
- data PostponedEquation = PostponedEquation {}
- type PostponedEquations = [PostponedEquation]
- class Match t a b where
- makeSubstitution :: Telescope -> Sub -> Maybe Substitution
- checkPostponedEquations :: PureTCM m => Substitution -> PostponedEquations -> m (Maybe Blocked_)
- nonLinMatch :: (PureTCM m, Match t a b) => Telescope -> t -> a -> b -> m (Either Blocked_ Substitution)
- equal :: PureTCM m => Type -> Term -> Term -> m (Maybe Blocked_)
- getTypedHead :: PureTCM m => Term -> m (Maybe (QName, Type))
Documentation
Monad for non-linear matching.
Instances
matchingBlocked :: Blocked_ -> NLM () Source #
tellSub :: Relevance -> Int -> Type -> Term -> NLM () Source #
Add substitution i |-> v : a
to result of matching.
data PostponedEquation Source #
Matching against a term produces a constraint which we have to verify after applying the substitution computed by matching.
type PostponedEquations = [PostponedEquation] Source #
class Match t a b where Source #
Match a non-linear pattern against a neutral term, returning a substitution.
makeSubstitution :: Telescope -> Sub -> Maybe Substitution Source #
checkPostponedEquations :: PureTCM m => Substitution -> PostponedEquations -> m (Maybe Blocked_) Source #
nonLinMatch :: (PureTCM m, Match t a b) => Telescope -> t -> a -> b -> m (Either Blocked_ Substitution) Source #