juvix icon indicating copy to clipboard operation
juvix copied to clipboard

Juvix should understand Suc (suc n) is structurally larger than suc n.

Open batconjurer opened this issue 2 years ago • 0 comments

Describe the bug Juvix should understand Suc (suc n) is structurally larger than suc n. To Reproduce As it does not, the folllowing fibonacci implementation fails the termination checker

module betterfib;
    open import Stdlib.Prelude;
    fib : ℕ -> ℕ; 
    fib zero := zero;
    fib (suc (zero)) := 1;
    fib (suc (suc n)) := fib (suc n) + fib n;

    main : IO;
    main := putStrLn( natToStr (fib 25));

end; 

Expected behavior Compiliation succeeds

batconjurer avatar Aug 20 '22 09:08 batconjurer