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

Safe Haskell | None
Language | Haskell2010

Agda.TypeChecking.Abstract

Description

Functions for abstracting terms over other terms.

Synopsis

- typeOf :: Type -> Type
- abstractType :: Type -> Term -> Type -> TCM Type
- piAbstractTerm :: Term -> Type -> Type -> TCM Type
- piAbstract :: (Term, EqualityView) -> Type -> TCM Type
- class IsPrefixOf a where
- abstractTerm :: Type -> Term -> Type -> Term -> TCM Term
- class AbsTerm a where
- swap01 :: Subst Term a => a -> a

# Documentation

typeOf :: Type -> Type #

abstractType :: Type -> Term -> Type -> TCM Type #

`abstractType a v b[v] = b` where `a : v`.

piAbstractTerm :: Term -> Type -> Type -> TCM Type #

    piAbstractTerm v a b[v] = (w : a) -> b[w]

piAbstract :: (Term, EqualityView) -> Type -> TCM Type #

    piAbstract (v, a) b[v] = (w : a) -> b[w]

For `rewrite`, it does something special:

    piAbstract (prf, Eq a v v') b[v,prf] = (w : a) (w' : Eq a w v') -> b[w,w']

class IsPrefixOf a where #

`isPrefixOf u v = Just es` if `v == u `applyE` es`.

Minimal complete definition

isPrefixOf

Methods

isPrefixOf :: a -> a -> Maybe Elims #

Instances

IsPrefixOf Elims # |
Methods isPrefixOf :: Elims -> Elims -> Maybe Elims #
IsPrefixOf Term # |
Methods isPrefixOf :: Term -> Term -> Maybe Elims #
IsPrefixOf Args # |
Methods isPrefixOf :: Args -> Args -> Maybe Elims #

abstractTerm :: Type -> Term -> Type -> Term -> TCM Term #

class AbsTerm a where #

Minimal complete definition

absTerm

Methods

absTerm :: Term -> a -> a #

    subst u . absTerm u == id

Instances

AbsTerm LevelAtom # |
Methods absTerm :: Term -> LevelAtom -> LevelAtom #
AbsTerm PlusLevel # |
Methods absTerm :: Term -> PlusLevel -> PlusLevel #
AbsTerm Level # |
Methods absTerm :: Term -> Level -> Level #
AbsTerm Sort # |
Methods absTerm :: Term -> Sort -> Sort #
AbsTerm Type # |
Methods absTerm :: Term -> Type -> Type #
AbsTerm Term # |
Methods absTerm :: Term -> Term -> Term #
AbsTerm a => AbsTerm [a] # |
Methods absTerm :: Term -> [a] -> [a] #
AbsTerm a => AbsTerm (Maybe a) # |
Methods absTerm :: Term -> Maybe a -> Maybe a #
AbsTerm a => AbsTerm (Ptr a) # |
Methods absTerm :: Term -> Ptr a -> Ptr a #
AbsTerm a => AbsTerm (Dom a) # |
Methods absTerm :: Term -> Dom a -> Dom a #
AbsTerm a => AbsTerm (Arg a) # |
Methods absTerm :: Term -> Arg a -> Arg a #
(Subst Term a, AbsTerm a) => AbsTerm (Abs a) # |
Methods absTerm :: Term -> Abs a -> Abs a #
AbsTerm a => AbsTerm (Elim' a) # |
Methods absTerm :: Term -> Elim' a -> Elim' a #
(AbsTerm a, AbsTerm b) => AbsTerm (a, b) # |
Methods absTerm :: Term -> (a, b) -> (a, b) #

swap01 :: Subst Term a => a -> a #

This swaps `var 0` and `var 1`.