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

ModuleAgda-2.7.0.1Haskell2010

Agda.Termination.CallGraph

Call graphs and related concepts, more or less as defined in "A Predicative Analysis of Structural Recursion" by Andreas Abel and Thorsten Altenkirch.

  • 3 types
  • 11 values
  • PackageAgda-2.7.0.1
  • Exports16
  • LanguageHaskell2010
  • LicenceMIT
  • SourceCallGraph.hs

Calls

8 declarations
typetype Node = Int
#

Call graph nodes.

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

typetype Call cinfo = Edge Node (CMSet cinfo)
#

Calls are edges in the call graph. It can be labelled with several call matrices if there are several pathes from one function to another.

Call graphs

8 declarations
newtypenewtype CallGraph cinfo
#

A call graph is a set of calls. Every call also has some associated meta information, which should be Monoidal so that the meta information for different calls can be combined when the calls are combined.

Constructors

Instances7Show, Semigroup, Monoid, Pretty, Null, Collection, …
  • Show cinfo => Show (CallGraph cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallGraph
  • Semigroup (CallGraph cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallGraph

    CallGraph is a monoid under union.

  • Monoid (CallGraph cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallGraph
  • Pretty cinfo => Pretty (CallGraph cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallGraph

    Displays the recursion behaviour corresponding to a call graph.

  • Null (CallGraph cinfo)Defined in Agda-2.7.0.1 · Agda.Termination.CallGraph

    null checks whether the call graph is completely disconnected.

  • 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
valuetoList :: CallGraph cinfo -> [Call cinfo]
#

Converts a call graph to a list of calls with associated meta information.

valuecomplete
  1. :: (IP "cutoff" CutOff, Monoid cinfo)
  2. => CallGraph cinfo
  3. -> CallGraph cinfo
#

Call graph comparison. A graph cs' is `worse' than cs if it has a new edge (call) or a call got worse, which means that one of its elements that was better or equal to Le moved a step towards Un.

A call graph is complete if combining it with itself does not make it any worse. This is sound because of monotonicity: By combining a graph with itself, it can only get worse, but if it does not get worse after one such step, it gets never any worse.

complete cs completes the call graph cs. A call graph is complete if it contains all indirect calls; if f -> g and g -> h are present in the graph, then f -> h should also be present.