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

Safe HaskellNone
LanguageHaskell98

Agda.TypeChecking.Reduce

Contents

Synopsis

Documentation

reduce :: Reduce a => a -> TCM a Source #

reduceB :: Reduce a => a -> TCM (Blocked a) Source #

normalise :: Normalise a => a -> TCM a Source #

simplify :: Simplify a => a -> TCM a Source #

class Instantiate t where Source #

Instantiate something. Results in an open meta variable or a non meta. Doesn't do any reduction, and preserves blocking tags (when blocking meta is uninstantiated).

Minimal complete definition

instantiate'

Methods

instantiate' :: t -> ReduceM t Source #

Instances

Instantiate EqualityView Source # 
Instantiate LevelAtom Source # 
Instantiate PlusLevel Source # 
Instantiate Level Source # 
Instantiate Sort Source # 
Instantiate Telescope Source # 
Instantiate Type Source # 
Instantiate Elim Source # 
Instantiate Term Source # 
Instantiate Candidate Source # 
Instantiate Constraint Source # 
Instantiate t => Instantiate [t] Source # 

Methods

instantiate' :: [t] -> ReduceM [t] Source #

Instantiate t => Instantiate (Dom t) Source # 

Methods

instantiate' :: Dom t -> ReduceM (Dom t) Source #

Instantiate t => Instantiate (Arg t) Source # 

Methods

instantiate' :: Arg t -> ReduceM (Arg t) Source #

Instantiate a => Instantiate (Blocked a) Source # 
Instantiate t => Instantiate (Abs t) Source # 

Methods

instantiate' :: Abs t -> ReduceM (Abs t) Source #

Instantiate a => Instantiate (Closure a) Source # 
(Instantiate a, Instantiate b) => Instantiate (a, b) Source # 

Methods

instantiate' :: (a, b) -> ReduceM (a, b) Source #

Instantiate e => Instantiate (Map k e) Source # 

Methods

instantiate' :: Map k e -> ReduceM (Map k e) Source #

(Instantiate a, Instantiate b, Instantiate c) => Instantiate (a, b, c) Source # 

Methods

instantiate' :: (a, b, c) -> ReduceM (a, b, c) Source #

Reduction to weak head normal form.

ifBlocked :: MonadTCM tcm => Term -> (MetaId -> Term -> tcm a) -> (Term -> tcm a) -> tcm a Source #

Case on whether a term is blocked on a meta (or is a meta). That means it can change its shape when the meta is instantiated.

ifBlockedType :: MonadTCM tcm => Type -> (MetaId -> Type -> tcm a) -> (Type -> tcm a) -> tcm a Source #

Case on whether a type is blocked on a meta (or is a meta).

class Reduce t where Source #

Methods

reduce' :: t -> ReduceM t Source #

reduceB' :: t -> ReduceM (Blocked t) Source #

Instances

Reduce EqualityView Source # 
Reduce LevelAtom Source # 
Reduce PlusLevel Source # 
Reduce Level Source # 
Reduce Sort Source # 
Reduce Telescope Source # 
Reduce Type Source # 
Reduce Elim Source # 
Reduce Term Source # 
Reduce Candidate Source # 
Reduce Constraint Source # 
Reduce t => Reduce [t] Source # 

Methods

reduce' :: [t] -> ReduceM [t] Source #

reduceB' :: [t] -> ReduceM (Blocked [t]) Source #

Reduce t => Reduce (Dom t) Source # 

Methods

reduce' :: Dom t -> ReduceM (Dom t) Source #

reduceB' :: Dom t -> ReduceM (Blocked (Dom t)) Source #

Reduce t => Reduce (Arg t) Source # 

Methods

reduce' :: Arg t -> ReduceM (Arg t) Source #

reduceB' :: Arg t -> ReduceM (Blocked (Arg t)) Source #

(Subst t a, Reduce a) => Reduce (Abs a) Source # 

Methods

reduce' :: Abs a -> ReduceM (Abs a) Source #

reduceB' :: Abs a -> ReduceM (Blocked (Abs a)) Source #

Reduce a => Reduce (Closure a) Source # 
(Reduce a, Reduce b) => Reduce (a, b) Source # 

Methods

reduce' :: (a, b) -> ReduceM (a, b) Source #

reduceB' :: (a, b) -> ReduceM (Blocked (a, b)) Source #

Reduce e => Reduce (Map k e) Source # 

Methods

reduce' :: Map k e -> ReduceM (Map k e) Source #

reduceB' :: Map k e -> ReduceM (Blocked (Map k e)) Source #

(Reduce a, Reduce b, Reduce c) => Reduce (a, b, c) Source # 

Methods

reduce' :: (a, b, c) -> ReduceM (a, b, c) Source #

reduceB' :: (a, b, c) -> ReduceM (Blocked (a, b, c)) Source #

unfoldDefinition :: Bool -> (Term -> ReduceM (Blocked Term)) -> Term -> QName -> Args -> ReduceM (Blocked Term) Source #

If the first argument is True, then a single delayed clause may be unfolded.

reduceDefCopy :: QName -> Args -> TCM (Reduced () Term) Source #

Reduce a non-primitive definition if it is a copy linking to another def.

reduceHead :: Term -> TCM (Blocked Term) Source #

Reduce simple (single clause) definitions.

appDef_ :: QName -> Term -> [Clause] -> Maybe CompiledClauses -> MaybeReducedArgs -> ReduceM (Reduced (Blocked Term) Term) Source #

Apply a definition using the compiled clauses, or fall back to ordinary clauses if no compiled clauses exist.

appDef :: Term -> CompiledClauses -> MaybeReducedArgs -> ReduceM (Reduced (Blocked Term) Term) Source #

Apply a defined function to it's arguments, using the compiled clauses. The original term is the first argument applied to the third.

appDef' :: Term -> [Clause] -> MaybeReducedArgs -> ReduceM (Reduced (Blocked Term) Term) Source #

Apply a defined function to it's arguments, using the original clauses.

Simplification

class Simplify t where Source #

Only unfold definitions if this leads to simplification which means that a constructor/literal pattern is matched.

Minimal complete definition

simplify'

Methods

simplify' :: t -> ReduceM t Source #

Instances

Simplify Bool Source # 
Simplify EqualityView Source # 
Simplify ClauseBody Source # 
Simplify LevelAtom Source # 
Simplify PlusLevel Source # 
Simplify Level Source # 
Simplify Sort Source # 
Simplify Type Source # 
Simplify Elim Source # 
Simplify Term Source # 
Simplify Candidate Source # 
Simplify DisplayForm Source # 
Simplify Constraint Source # 
Simplify ProblemConstraint Source # 
Simplify t => Simplify [t] Source # 

Methods

simplify' :: [t] -> ReduceM [t] Source #

Simplify a => Simplify (Maybe a) Source # 

Methods

simplify' :: Maybe a -> ReduceM (Maybe a) Source #

Simplify t => Simplify (Dom t) Source # 

Methods

simplify' :: Dom t -> ReduceM (Dom t) Source #

Simplify t => Simplify (Arg t) Source # 

Methods

simplify' :: Arg t -> ReduceM (Arg t) Source #

(Subst t a, Simplify a) => Simplify (Tele a) Source # 

Methods

simplify' :: Tele a -> ReduceM (Tele a) Source #

(Subst t a, Simplify a) => Simplify (Abs a) Source # 

Methods

simplify' :: Abs a -> ReduceM (Abs a) Source #

Simplify a => Simplify (Closure a) Source # 
(Simplify a, Simplify b) => Simplify (a, b) Source # 

Methods

simplify' :: (a, b) -> ReduceM (a, b) Source #

Simplify e => Simplify (Map k e) Source # 

Methods

simplify' :: Map k e -> ReduceM (Map k e) Source #

Simplify t => Simplify (Named name t) Source # 

Methods

simplify' :: Named name t -> ReduceM (Named name t) Source #

(Simplify a, Simplify b, Simplify c) => Simplify (a, b, c) Source # 

Methods

simplify' :: (a, b, c) -> ReduceM (a, b, c) Source #

Normalisation

class Normalise t where Source #

Minimal complete definition

normalise'

Methods

normalise' :: t -> ReduceM t Source #

Instances

Normalise Bool Source # 
Normalise Char Source # 
Normalise Int Source # 
Normalise EqualityView Source # 
Normalise ConPatternInfo Source # 
Normalise ClauseBody Source # 
Normalise LevelAtom Source # 
Normalise PlusLevel Source # 
Normalise Level Source # 
Normalise Sort Source # 
Normalise Type Source # 
Normalise Elim Source # 
Normalise Term Source # 
Normalise Candidate Source # 
Normalise DisplayForm Source # 
Normalise Constraint Source # 
Normalise ProblemConstraint Source # 
Normalise t => Normalise [t] Source # 

Methods

normalise' :: [t] -> ReduceM [t] Source #

Normalise a => Normalise (Maybe a) Source # 

Methods

normalise' :: Maybe a -> ReduceM (Maybe a) Source #

Normalise t => Normalise (Dom t) Source # 

Methods

normalise' :: Dom t -> ReduceM (Dom t) Source #

Normalise t => Normalise (Arg t) Source # 

Methods

normalise' :: Arg t -> ReduceM (Arg t) Source #

Normalise a => Normalise (Pattern' a) Source # 
(Subst t a, Normalise a) => Normalise (Tele a) Source # 

Methods

normalise' :: Tele a -> ReduceM (Tele a) Source #

(Subst t a, Normalise a) => Normalise (Abs a) Source # 

Methods

normalise' :: Abs a -> ReduceM (Abs a) Source #

Normalise a => Normalise (Closure a) Source # 
(Normalise a, Normalise b) => Normalise (a, b) Source # 

Methods

normalise' :: (a, b) -> ReduceM (a, b) Source #

Normalise e => Normalise (Map k e) Source # 

Methods

normalise' :: Map k e -> ReduceM (Map k e) Source #

Normalise t => Normalise (Named name t) Source # 

Methods

normalise' :: Named name t -> ReduceM (Named name t) Source #

(Normalise a, Normalise b, Normalise c) => Normalise (a, b, c) Source # 

Methods

normalise' :: (a, b, c) -> ReduceM (a, b, c) Source #

Full instantiation

class InstantiateFull t where Source #

instantiateFull' instantiates metas everywhere (and recursively) but does not reduce.

Minimal complete definition

instantiateFull'

Methods

instantiateFull' :: t -> ReduceM t Source #

Instances

InstantiateFull Bool Source # 
InstantiateFull Char Source # 
InstantiateFull Int Source # 
InstantiateFull ModuleName Source # 
InstantiateFull QName Source # 
InstantiateFull Name Source # 
InstantiateFull Scope Source # 
InstantiateFull EqualityView Source # 
InstantiateFull Substitution Source # 
InstantiateFull ConPatternInfo Source # 
InstantiateFull ClauseBody Source # 
InstantiateFull Clause Source # 
InstantiateFull LevelAtom Source # 
InstantiateFull PlusLevel Source # 
InstantiateFull Level Source # 
InstantiateFull Sort Source # 
InstantiateFull Term Source # 
InstantiateFull CompiledClauses Source # 
InstantiateFull Candidate Source # 
InstantiateFull FunctionInverse Source # 
InstantiateFull Defn Source # 
InstantiateFull Definition Source # 
InstantiateFull RewriteRule Source # 
InstantiateFull NLPat Source # 
InstantiateFull DisplayTerm Source # 
InstantiateFull DisplayForm Source # 
InstantiateFull Section Source # 
InstantiateFull Signature Source # 
InstantiateFull Constraint Source # 
InstantiateFull ProblemConstraint Source # 
InstantiateFull Interface Source # 
InstantiateFull LHSResult Source # 
InstantiateFull t => InstantiateFull [t] Source # 

Methods

instantiateFull' :: [t] -> ReduceM [t] Source #

InstantiateFull a => InstantiateFull (Maybe a) Source # 
InstantiateFull t => InstantiateFull (Dom t) Source # 

Methods

instantiateFull' :: Dom t -> ReduceM (Dom t) Source #

InstantiateFull t => InstantiateFull (Arg t) Source # 

Methods

instantiateFull' :: Arg t -> ReduceM (Arg t) Source #

InstantiateFull a => InstantiateFull (Pattern' a) Source # 
(Subst t a, InstantiateFull a) => InstantiateFull (Tele a) Source # 
InstantiateFull a => InstantiateFull (Type' a) Source # 
(Subst t a, InstantiateFull a) => InstantiateFull (Abs a) Source # 

Methods

instantiateFull' :: Abs a -> ReduceM (Abs a) Source #

InstantiateFull a => InstantiateFull (Elim' a) Source # 
InstantiateFull a => InstantiateFull (Case a) Source # 
InstantiateFull a => InstantiateFull (WithArity a) Source # 
InstantiateFull a => InstantiateFull (Builtin a) Source # 
InstantiateFull a => InstantiateFull (Open a) Source # 
InstantiateFull a => InstantiateFull (Closure a) Source # 
(InstantiateFull a, InstantiateFull b) => InstantiateFull (a, b) Source # 

Methods

instantiateFull' :: (a, b) -> ReduceM (a, b) Source #

InstantiateFull e => InstantiateFull (Map k e) Source # 

Methods

instantiateFull' :: Map k e -> ReduceM (Map k e) Source #

InstantiateFull e => InstantiateFull (HashMap k e) Source # 
InstantiateFull t => InstantiateFull (Named name t) Source # 

Methods

instantiateFull' :: Named name t -> ReduceM (Named name t) Source #

(InstantiateFull a, InstantiateFull b, InstantiateFull c) => InstantiateFull (a, b, c) Source # 

Methods

instantiateFull' :: (a, b, c) -> ReduceM (a, b, c) Source #