HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

  • PackageAgda-2.7.0.1
  • Exports10
  • LanguageHaskell2010
  • LicenceMIT
  • SourceCallMatrix.hs
typetype ArgumentIndex = Int
#

Call matrix indices = function argument indices.

Machine integer Int is sufficient, since we cannot index more arguments than we have addresses on our machine.

newtypenewtype CallMatrix' a
#

Call matrices.

A call matrix for a call f --> g has dimensions ar(g) × ar(f).

Each column corresponds to one formal argument of caller f. Each row corresponds to one argument in the call to g.

In the presence of dot patterns, a call argument can be related to several different formal arguments of f.

See e.g. testsucceedDotPatternTermination.agda:

    data D : Nat -> Set where
      cz : D zero
      c1 : forall n -> D n -> D (suc n)
      c2 : forall n -> D n -> D n

    f : forall n -> D n -> Nat
    f .zero    cz        = zero
    f .(suc n) (c1  n d) = f n (c2 n d)
    f n        (c2 .n d) = f n d
  

Call matrices (without guardedness) are

          -1 -1   n < suc n  and       n <  c1 n d
           ?  =                   c2 n d <= c1 n d

           = -1   n <= n     and  n < c2 n d
           ? -1                   d < c2 n d
  

Here is a part of the original documentation for call matrices (kept for historical reasons):

This datatype encodes information about a single recursive function application. The columns of the call matrix stand for source function arguments (patterns). The rows of the matrix stand for target function arguments. Element (i, j) in the matrix should be computed as follows:

  • lt (less than) if the j-th argument to the target function is structurally strictly smaller than the i-th pattern.

  • le (less than or equal) if the j-th argument to the target function is structurally smaller than the i-th pattern.

  • unknown otherwise.

Instances11Functor, Foldable, Traversable, Pretty, CallComb, NotWorse, …
  • Functor CallMatrix'Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • Foldable CallMatrix'Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • Traversable CallMatrix'Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • Pretty CallMatrixDefined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • CallComb CallMatrixDefined in Agda-2.7.0.1 · Agda.Termination.CallMatrix

    Call matrix multiplication.

    f --(m1)--> g --(m2)--> h is combined to f --(m2 mul m1)--> h

    Note the reversed order of multiplication: The matrix c1 of the second call g-->h in the sequence f-->g-->h is multiplied with the matrix c2 of the first call.

    Preconditions: m1 has dimensions ar(g) × ar(f). m2 has dimensions ar(h) × ar(g).

    Postcondition: m1 >*< m2 has dimensions ar(h) × ar(f).

  • NotWorse CallMatrixDefined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • Eq a => Eq (CallMatrix' a)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • Ord a => Ord (CallMatrix' a)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • (HasZero a, Show a) => Show (CallMatrix' a)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • PartialOrd a => PartialOrd (CallMatrix' a)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • HasZero a => Diagonal (CallMatrix' a) aDefined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
classclass CallComb a where
#

Call matrix multiplication and call combination.

Methods

Instances3CallComb
  • CallComb CallMatrixDefined in Agda-2.7.0.1 · Agda.Termination.CallMatrix

    Call matrix multiplication.

    f --(m1)--> g --(m2)--> h is combined to f --(m2 mul m1)--> h

    Note the reversed order of multiplication: The matrix c1 of the second call g-->h in the sequence f-->g-->h is multiplied with the matrix c2 of the first call.

    Preconditions: m1 has dimensions ar(g) × ar(f). m2 has dimensions ar(h) × ar(g).

    Postcondition: m1 >*< m2 has dimensions ar(h) × ar(f).

  • Monoid cinfo => CallComb (CMSet cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix

    Call matrix set product is the Cartesian product.

  • Monoid cinfo => CallComb (CallMatrixAug cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix

    Augmented call matrix multiplication.

Call matrix augmented with path information.

2 declarations
datadata CallMatrixAug cinfo
#

Call matrix augmented with path information.

Constructors

Instances8Eq, Show, Pretty, PartialOrd, CallComb, NotWorse, …

Sets of incomparable call matrices augmented with path information.

4 declarations
newtypenewtype CMSet cinfo
#

Sets of incomparable call matrices augmented with path information. Use overloaded null, empty, singleton, mappend.

Constructors

Instances10Show, Semigroup, Monoid, Pretty, Null, CallComb, …
  • Show cinfo => Show (CMSet cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • Semigroup (CMSet cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • Monoid (CMSet cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • Pretty cinfo => Pretty (CMSet cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • Null (CMSet cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix
  • Monoid cinfo => CallComb (CMSet cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix

    Call matrix set product is the Cartesian product.

  • CombineNewOld (CMSet cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallGraph
  • Collection (Call cinfo) (CallGraph cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallGraph
  • Singleton (Call cinfo) (CallGraph cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallGraph
  • Singleton (CallMatrixAug cinfo) (CMSet cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallMatrix

Printing

0 declarations