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

Safe HaskellNone

Agda.Compiler.Epic.Injection

Synopsis

Documentation

findInjection :: [(QName, Definition)] -> Compile TCM [(QName, Definition)]Source

Find potentially injective functions, solve constraints to fix some constructor tags and make functions whose constraints are fulfilled injections

type InjConstraints = Maybe [(QName, QName)]Source

If the pairs of constructor names have the same tags, the function is injective. If Nothing, the function is not injective.

isInjectiveSource

Arguments

:: QName

Name of the function being tested

-> [Clause]

The function's clauses

-> Compile TCM (Maybe ((QName, InjectiveFun), [(QName, QName)])) 

nrBinds :: Num i => Pattern -> iSource

isInjectiveHereSource

Arguments

:: QName

Name of the function being tested

-> Int

The current argument

-> Clause 
-> Compile TCM InjConstraints 

litToCon :: Literal -> TCM TermSource

Turn NATURAL literal n into suc^n zero.

class Injectible a whereSource

Are two terms injectible? Tries to find a mapping between constructors that equates the terms.

Precondition: t1 is normalised, t2 is in WHNF When reducing t2, it may become a literal, which makes this not work in some cases...

data TagEq Source

Constructors

Same Int 
IsTag Tag 

Instances

Eq TagEq 

data Tags Source

Constructors

Tags 

Fields

eqGroups :: Int :-> Set QName
 
constrGroup :: QName :-> TagEq
 

unify :: QName -> QName -> Tags -> Compile TCM (Maybe Tags)Source

setTag :: Int -> Tag -> Tags -> Compile TCM (Maybe Tags)Source

mergeGroups :: Int -> Int -> Tags -> Compile TCM (Maybe Tags)Source

(!!!!) :: Ord k => (k :-> v) -> k -> vSource