ModuleAgda-2.7.0.1Haskell2010
Agda.TypeChecking.Rules.LHS.Problem
- 12 types
- 1 class
- 11 values
- PackageAgda-2.7.0.1
- Exports24
- LanguageHaskell2010
- LicenceMIT
- SourceProblem.hs
When we encounter a flexible variable in the unifier, where did it come from?
The alternatives are ordered such that we will assign the higher one first,
i.e., first we try to assign a DotFlex, then...
Constructors
RecordFlex [FlexibleVarKind]From a record pattern (ConP). Saves the FlexibleVarKind of its subpatterns.
ImplicitFlexFrom a hidden formal argument or underscore (
WildP).DotFlexFrom a dot pattern (DotP).
OtherFlex
Instances3Eq, Show, ChooseFlex
Eq FlexibleVarKindDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemShow FlexibleVarKindDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemChooseFlex FlexibleVarKindDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problem
Flexible variables are equipped with information where they come from, in order to make a choice which one to assign when two flexibles are unified.
Constructors
Instances10Functor, Foldable, Traversable, Eq, Show, LensHiding, …
Functor FlexibleVarDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemFoldable FlexibleVarDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemTraversable FlexibleVarDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemEq a => Eq (FlexibleVar a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemShow a => Show (FlexibleVar a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemLensHiding (FlexibleVar a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemLensArgInfo (FlexibleVar a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemLensModality (FlexibleVar a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemLensOrigin (FlexibleVar a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemChooseFlex a => ChooseFlex (FlexibleVar a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problem
Instances4Eq, Show, Semigroup, Monoid
Eq FlexChoiceDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemShow FlexChoiceDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemSemigroup FlexChoiceDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemMonoid FlexChoiceDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problem
Methods
chooseFlex :: a -> a -> FlexChoice
Instances9ChooseFlex, …
ChooseFlex ArgInfoDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemChooseFlex HidingDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemChooseFlex OriginDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemChooseFlex IsForcedDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemChooseFlex FlexibleVarKindDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemChooseFlex IntDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemChooseFlex a => ChooseFlex (FlexibleVar a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemChooseFlex a => ChooseFlex (Maybe a)Defined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemChooseFlex a => ChooseFlex [a]Defined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problem
A user pattern together with an internal term that it should be equal to after splitting is complete. Special cases: * User pattern is a variable but internal term isn't: this will be turned into an as pattern. * User pattern is a dot pattern: this pattern won't trigger any splitting but will be checked for equality after all splitting is complete and as patterns have been bound. * User pattern is an absurd pattern: emptiness of the type will be checked after splitting is complete. * User pattern is an annotated wildcard: type annotation will be checked after splitting is complete.
Constructors
Instances11Eq, Show, Generic, NFData, Subst, PrettyTCM, …
Eq ProblemEqDefined in Agda-2.7.0.1 · Agda.Syntax.AbstractShow ProblemEqDefined in Agda-2.7.0.1 · Agda.Syntax.AbstractGeneric ProblemEqDefined in Agda-2.7.0.1 · Agda.Syntax.AbstractNFData ProblemEqDefined in Agda-2.7.0.1 · Agda.Syntax.AbstractSubst ProblemEqDefined in Agda-2.7.0.1 · Agda.TypeChecking.Substitute · orphanPrettyTCM ProblemEqDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problem · orphanHilite ProblemEqDefined in Agda-2.7.0.1 · Agda.Interaction.Highlighting.FromAbstractKillRange ProblemEqDefined in Agda-2.7.0.1 · Agda.Syntax.AbstractBlankVars ProblemEqDefined in Agda-2.7.0.1 · Agda.Syntax.Translation.InternalToAbstracttype Rep ProblemEq = D1 ('MetaDataDefined in Agda-2.7.0.1 · Agda.Syntax.Abstract"ProblemEq"
"Agda.Syntax.Abstract"
"Agda-2.7.0.1-DbbZpETDDF1KkwuzEZvfn8"
'False) (C1 ('MetaCons"ProblemEq"
'PrefixI 'True) (S1 ('MetaSel ('Just"problemInPat"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Pattern) :*: (S1 ('MetaSel ('Just"problemInst"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Term) :*: S1 ('MetaSel ('Just"problemType"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Dom Type)))))type SubstArg ProblemEq = TermDefined in Agda-2.7.0.1 · Agda.TypeChecking.Substitute · orphan
The user patterns we still have to split on.
Constructors
Problem_problemEqs :: [ProblemEq]User patterns which are typed (including the ones generated from implicit arguments).
_problemRestPats :: [NamedArg Pattern]List of user patterns which could not yet be typed. Example:
f : (b : Bool) -> if b then Nat else Nat -> Nat f true = zero f false zero = zero f false (suc n) = nIn this sitation, for clause 2, we construct an initial problemproblemEqs = [false = b] problemRestPats = [zero]As we instantiatebtofalse, thetargetTypereduces toNat -> Natand we can move patternzeroover toproblemEqs._problemCont :: LHSState a -> TCM aThe code that checks the RHS.
Instances5Pretty, Subst, PrettyTCM, InstantiateFull, SubstArg
Pretty AsBindingDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemSubst AsBindingDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemPrettyTCM AsBindingDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemInstantiateFull AsBindingDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problemtype SubstArg AsBinding = TermDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problem
Instances3Subst, PrettyTCM, SubstArg
Subst DotPatternDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemPrettyTCM DotPatternDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problemtype SubstArg DotPattern = TermDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problem
Instances3Subst, PrettyTCM, SubstArg
Subst AbsurdPatternDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemPrettyTCM AbsurdPatternDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problemtype SubstArg AbsurdPattern = TermDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problem
Instances1PrettyTCM
PrettyTCM AnnotationPatternDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problem
State worked on during the main loop of checking a lhs. [Ulf Norell's PhD, page. 35]
Constructors
LHSState_lhsTel :: TelescopeThe types of the pattern variables.
_lhsOutPat :: [NamedArg DeBruijnPattern]Patterns after splitting. The de Bruijn indices refer to positions in the list of abstract syntax patterns in the problem, counted from the back (right-to-left).
_lhsProblem :: Problem aUser patterns of supposed type
delta._lhsTarget :: Arg TypeType eliminated by problemRestPats in the problem. Can be Irrelevant to indicate that we came by an irrelevant projection and, hence, the rhs must be type-checked in irrelevant mode.
_lhsPartialSplit :: ![Maybe Int]have we splitted with a PartialFocus?
_lhsIndexedSplit :: !BoolHave we split on any indexed inductive types?
Constructors
LeftoverPatternspatternVariables :: IntMap [(Name, PatVarPosition)]asPatterns :: [AsBinding]dotPatterns :: [DotPattern]absurdPatterns :: [AbsurdPattern]typeAnnotations :: [AnnotationPattern]otherPatterns :: [Pattern]
Instances4Semigroup, Monoid, PrettyTCM, Null
Semigroup LeftoverPatternsDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemMonoid LeftoverPatternsDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemPrettyTCM LeftoverPatternsDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.ProblemNull LeftoverPatternsDefined in Agda-2.7.0.1 · Agda.TypeChecking.Rules.LHS.Problem
Classify remaining patterns after splitting is complete into pattern variables, as patterns, dot patterns, and absurd patterns. Precondition: there are no more constructor patterns.
getUserVariableNames Build a renaming for the internal patterns using variable names from the user patterns. If there are multiple user names for the same internal variable, the unused ones are returned as as-bindings. Names that are not also module parameters are preferred over those that are.