--type-based-termination: --size-preservation analysis comes too late for nested functions
andreasabel opened this issue · comments
Andreas Abel commented
With nest : forall i -> Nat i -> Nat i
the nest
function termination checks, but the size preservation analysis seems to come too late to certify termination of nest
:
{-# OPTIONS --type-based-termination #-}
{-# OPTIONS --no-syntax-based-termination #-}
{-# OPTIONS --size-preservation #-}
{-# OPTIONS -v term.tbt:50 #-}
data Nat : Set where -- ∀[∞]. ⁺t₀
zero : Nat -- ∀[∞]. ⁺t₀
suc : Nat → Nat -- ∀[<1, ∞]. ⁺t₀ → ⁺t₁
nest : Nat → Nat -- ∀[∞]. ⁺t₀ → ⁺∞
nest zero = zero
nest (suc x) = nest (nest x)
-- Signature of nest after size-preservation inference:
-- ∀[∞]. ⁺t₀ → ⁺t₀
Termination checking failed for the following functions:
nest
Problematic calls:
nest (nest x)
RFC: @knisht