Agda
Safe HaskellNone
LanguageHaskell2010

Agda.TypeChecking.Positivity.Occurrence

Description

Occurrences.

Synopsis

Documentation

type PragmaPolarities = List1 (Ranged Occurrence) Source #

List of polarities stemming from POLARITY pragma.

data Occurrence Source #

Subterm occurrences for positivity checking. The constructors are listed in increasing information they provide: Mixed <= JustPos <= StrictPos <= GuardPos <= Unused Mixed <= JustNeg <= Unused.

Constructors

Mixed

Arbitrary occurrence (positive and negative).

JustNeg

Negative occurrence.

JustPos

Positive occurrence, but not strictly positive.

StrictPos

Strictly positive occurrence.

GuardPos

Guarded strictly positive occurrence (i.e., under ∞). For checking recursive records.

Unused

No occurrence.

Instances

Instances details
Pretty Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

KillRange Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

PrettyTCM Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Pretty

PrettyTCMWithNode Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Pretty

EmbPrj Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Serialise.Instances.Internal

Null Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

SemiRing Occurrence Source #

Occurrence is a complete lattice with least element Mixed and greatest element Unused.

It forms a commutative semiring where oplus is meet (glb) and otimes is composition. Both operations are idempotent.

For oplus, Unused is neutral (zero) and Mixed is dominant. For otimes, StrictPos is neutral (one) and Unused is dominant.

Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

StarSemiRing Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

NFData Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Methods

rnf :: Occurrence -> () #

Eq Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Ord Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Bounded Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Enum Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Exception Occurrence Source #

Exception for short-circuiting when finding a Mixed path from source to target.

Instance details

Defined in Agda.TypeChecking.Positivity.OccurrenceAnalysis

Show Occurrence Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Abstract [Occurrence] Source # 
Instance details

Defined in Agda.TypeChecking.Substitute

Apply [Occurrence] Source # 
Instance details

Defined in Agda.TypeChecking.Substitute

data OccursPath Source #

Constructors

Root 
LeftOfArrow !OccursPath 
DefArg !OccursPath !QName !Nat

in the nth argument of a defined constant

MutDefArg !OccursPath !QName !Nat

in the nth argument of a def in the current mutual block. (def given by Int index in the block)

UnderInf !OccursPath

in the principal argument of built-in ∞

VarArg !OccursPath !Nat !Occurrence

as an argument to a bound variable with given polarity. The polarity is only used for warning printing.

MetaArg !OccursPath

as an argument of a metavariable

ConArgType !OccursPath !QName

in the type of a constructor

IndArgType !OccursPath !QName

in a datatype index of a constructor

ConEndpoint !OccursPath !QName

in an endpoint of a higher constructor

InClause !OccursPath !Nat

in the nth clause of a defined function

Matched !OccursPath

matched against in a clause of a defined function

InIndex !OccursPath

is an index of an inductive family

InDefOf !OccursPath !QName

in the definition of a constant

data Node Source #

Constructors

DefNode QName

Definition site of a mutual definition

ArgNode QName Int

Occurrence of the nth definition argument inside the definition.

Instances

Instances details
Pretty Node Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

PrettyTCM Node Source # 
Instance details

Defined in Agda.TypeChecking.Positivity

Methods

prettyTCM :: MonadPretty m => Node -> m Doc Source #

Eq Node Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Methods

(==) :: Node -> Node -> Bool #

(/=) :: Node -> Node -> Bool #

Ord Node Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Methods

compare :: Node -> Node -> Ordering #

(<) :: Node -> Node -> Bool #

(<=) :: Node -> Node -> Bool #

(>) :: Node -> Node -> Bool #

(>=) :: Node -> Node -> Bool #

max :: Node -> Node -> Node #

min :: Node -> Node -> Node #

Show Node Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Methods

showsPrec :: Int -> Node -> ShowS #

show :: Node -> String #

showList :: [Node] -> ShowS #

Hashable Node Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Methods

hashWithSalt :: Int -> Node -> Int #

hash :: Node -> Int #

data Edge a Source #

Constructors

Edge !Occurrence !a 

Instances

Instances details
Functor Edge Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Methods

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

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

PrettyTCMWithNode (Edge OccursWhere) Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.OccurrenceAnalysis

Pretty a => PrettyTCMWithNode (Edge a) Source # 
Instance details

Defined in Agda.TypeChecking.Positivity

Monoid a => SemiRing (Edge a) Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Methods

ozero :: Edge a Source #

oone :: Edge a Source #

oplus :: Edge a -> Edge a -> Edge a Source #

otimes :: Edge a -> Edge a -> Edge a Source #

Eq a => Eq (Edge a) Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Methods

(==) :: Edge a -> Edge a -> Bool #

(/=) :: Edge a -> Edge a -> Bool #

Ord a => Ord (Edge a) Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Methods

compare :: Edge a -> Edge a -> Ordering #

(<) :: Edge a -> Edge a -> Bool #

(<=) :: Edge a -> Edge a -> Bool #

(>) :: Edge a -> Edge a -> Bool #

(>=) :: Edge a -> Edge a -> Bool #

max :: Edge a -> Edge a -> Edge a #

min :: Edge a -> Edge a -> Edge a #

Show a => Show (Edge a) Source # 
Instance details

Defined in Agda.TypeChecking.Positivity.Occurrence

Methods

showsPrec :: Int -> Edge a -> ShowS #

show :: Edge a -> String #

showList :: [Edge a] -> ShowS #

mergeEdges :: Edge a -> Edge a -> Edge a Source #