Files
pplus-library/pseudo/prover/decreases-recursion.pseudo
alexm 568474d52f
Test (in pplus-core) / in-core (push) Failing after 28m44s
Initial commit
2026-11-12 22:23:48 -05:00

16 lines
388 B
Plaintext

// The recursive call's measure is compared with N as it is at the call
// (N + 2), not with N as it was on entry. The run compares with entry.
// MUST-NOT-PROVE: decreases-step@12
// RUN-STOPS: decreases@7
FUNCTION F(N : INTEGER) RETURNS INTEGER
REQUIRE N >= 0
DECREASES N
IF N == 0 THEN
RETURN 0
ENDIF
N <- N + 2
RETURN F(N - 1)
ENDFUNCTION
OUTPUT F(3)