| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Agda.Termination.Termination
Description
Termination checker, based on "A Predicative Analysis of Structural Recursion" by Andreas Abel and Thorsten Altenkirch (JFP'01), and "The Size-Change Principle for Program Termination" by Chin Soon Lee, Neil Jones, and Amir Ben-Amram (POPL'01).
Synopsis
- data Terminates cinfo
- = Terminates
- | TerminatesNot GuardednessHelps cinfo
- data GuardednessHelps
- terminates :: (Monoid cinfo, ?cutoff :: CutOff) => CallGraph cinfo -> Terminates cinfo
- terminatesFilter :: (Monoid cinfo, ?cutoff :: CutOff) => Bool -> (Node -> Bool) -> CallGraph cinfo -> Terminates cinfo
- terminationCounterexample :: (Monoid cinfo, ?cutoff :: CutOff) => Bool -> (Node -> Bool) -> CallGraph cinfo -> Terminates cinfo
- idempotentEndos :: (?cutoff :: CutOff) => CallGraph cinfo -> [CallMatrixAug cinfo]
Documentation
data Terminates cinfo Source #
Result of running the termination checker.
Constructors
| Terminates | Termination proved without considering guardedness. |
| TerminatesNot GuardednessHelps cinfo | Termination could not be proven, witnessed by the supplied problematic call path. Guardedness could help, though. |
data GuardednessHelps Source #
Would termination go through with guardedness?
Constructors
| GuardednessHelpsYes | Guardedness would provide termination evidence. |
| GuardednessHelpsNot | Guardedness does not help with termination. |
Instances
terminates :: (Monoid cinfo, ?cutoff :: CutOff) => CallGraph cinfo -> Terminates cinfo Source #
checks if the functions represented by terminates cscs
terminate. The call graph cs should have one entry (Call) per
recursive function application.
The termination criterion is taken from Jones et al. In the completed call graph, each idempotent call-matrix from a function to itself must have a decreasing argument. Idempotency is wrt. matrix multiplication.
This criterion is strictly more liberal than searching for a lexicographic order (and easier to implement, but harder to justify).
terminates does not use guardedness, terminatesFilter is more general.
Arguments
| :: (Monoid cinfo, ?cutoff :: CutOff) | |
| => Bool | Use guardedness? |
| -> (Node -> Bool) | Only consider calls whose source and target satisfy this predicate. |
| -> CallGraph cinfo | Callgraph augmented with |
| -> Terminates cinfo | A bad call path of type |
While no counterexample to termination is found, complete the given call graph step-by-step.
terminationCounterexample Source #
Arguments
| :: (Monoid cinfo, ?cutoff :: CutOff) | |
| => Bool | Use guardedness? |
| -> (Node -> Bool) | Only consider calls whose source and target satisfy this predicate. |
| -> CallGraph cinfo | Callgraph augmented with |
| -> Terminates cinfo | A bad call path of type |
Does the given callgraph contain a counterexample to termination?
idempotentEndos :: (?cutoff :: CutOff) => CallGraph cinfo -> [CallMatrixAug cinfo] Source #
Get all idempotent call-matrixes of loops in the call graph.