| 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) => (Node -> Bool) -> CallGraph cinfo -> Terminates cinfo
- endos :: [Call cinfo] -> [CallMatrixAug cinfo]
- idempotent :: (?cutoff :: CutOff) => CallMatrixAug cinfo -> Bool
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).
endos :: [Call cinfo] -> [CallMatrixAug cinfo] Source #
idempotent :: (?cutoff :: CutOff) => CallMatrixAug cinfo -> Bool Source #