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

14 lines
360 B
Plaintext

// The INVARIANT is proved kept for the value just visited; the run checks it
// with the next value, and it is FALSE there (Seen is 1, X is -1).
// MUST-NOT-PROVE: invariant-keep@9
DECLARE L : LIST OF INTEGER
DECLARE Seen : INTEGER
L <- [1, -1]
Seen <- 0
FOR EACH X IN L
INVARIANT Seen == 0 OR X >= 0
IF X >= 0 THEN
Seen <- 1
ENDIF
NEXT X