Check whether a type is either not a SIZELT or a SIZELT that is non-empty.
ModuleAgda-2.7.0.1Haskell2010
Agda.TypeChecking.SizedTypes
- 2 types
- 28 values
- PackageAgda-2.7.0.1
- Exports30
- LanguageHaskell2010
- LicenceMIT
- SourceSizedTypes.hs
SIZELT stuff
8 declarationsPrecondition: Term is reduced and not blocked. Throws a patternViolation if undecided
Checks that a size variable is ensured to be > 0.
E.g. variable i cannot be zero in context
(i : Size) (j : Size< ↑ ↑ i) (k : Size< j) (k' : Size< k).
Throws a patternViolation if undecided.
Check whether a variable in the context is bounded by a size expression.
If x : Size< a, then a is returned.
Whenever we create a bounded size meta, add a constraint
expressing the bound. First argument is the new meta and must be a MetaV{}.
In boundedSizeMetaHook v tel a, tel includes the current context.
trySizeUniv cmp t m n x els1 y els2
is called as a last resort when conversion checking m
failed for definitions cmp n : tm = x els1 and n = y els2,
where the heads x and y are not equal.
trySizeUniv accounts for subtyping between SIZELT and SIZE,
like Size< i =< Size.
If it does not succeed it reports failure of conversion check.
Size views that reduce.
2 declarationsCompute the deep size view of a term. Precondition: sized types are enabled.
Size comparison that might add constraints.
6 declarationsCompare two sizes.
Compare two sizes in max view.
compareBelowMax u vs checks u <= max vs. Precondition: size vs >= 2
If envAssignMetas then postpone as constraint, otherwise, fail hard. Failing is required if we speculatively test several alternatives.
Checked whether a size constraint is trivial (like X <= X+1).
Size constraints.
7 declarationsTest whether a problem consists only of size constraints.
Test whether a constraint speaks about sizes.
isSizeConstraint_ :: (Type -> Bool)Test for being a sized type
-> (Comparison -> Bool)Restriction to these directions.
-> Closure Constraint-> Bool
Take out all size constraints of the given direction (DANGER!).
Find the size constraints of the matching direction.
Return a list of size metas and their context.
Size constraint solving.
7 declarationsAtomic size expressions.
Instances3Eq, Show, Pretty
Eq OldSizeExprDefined in Agda-2.7.0.1 · Agda.TypeChecking.SizedTypesShow OldSizeExprDefined in Agda-2.7.0.1 · Agda.TypeChecking.SizedTypesPretty OldSizeExprDefined in Agda-2.7.0.1 · Agda.TypeChecking.SizedTypes
Size constraints we can solve.
Constructors
Leq OldSizeExpr Int OldSizeExprLeq a +n brepresentsa =< b + n.Leq a -n brepresentsa + n =< b.
Instances2Show, Pretty
Show OldSizeConstraintDefined in Agda-2.7.0.1 · Agda.TypeChecking.SizedTypesPretty OldSizeConstraintDefined in Agda-2.7.0.1 · Agda.TypeChecking.SizedTypes
Compute a set of size constraints that all live in the same context from constraints over terms of type size that may live in different contexts.
Turn a constraint over de Bruijn indices into a size constraint.
Turn a term with de Bruijn indices into a size expression with offset.
Throws a patternViolation if the term isn't a proper size expression.
Compute list of size metavariables with their arguments appearing in a constraint.
Convert size constraint into form where each meta is applied
to indices 0,1,..,n-1 where n is the arity of that meta.
X[σ] <= t becomes X[id] <= t[σ^-1]
X[σ] ≤ Y[τ] becomes X[id] ≤ Y[τ[σ^-1]] or X[σ[τ^1]] ≤ Y[id]
whichever is defined. If none is defined, we give up.