// RUN: bash -c '@caesar @file --slice-error-first 2>&1 | grep -Eq "Counter-example to property found"'
// Adapted from refute-geo2_bmc.pgcl, translated by pgcl2heyvl.

@wp
coproc geometric(init_count: UInt, init_running: Bool) -> (count: UInt, running: Bool)
    pre init_count + 0.99
    post count
{
    count = init_count
    running = init_running
    // Unexplored executions contribute zero to the lower approximation.
    // With init_count == 0 and init_running == true, it is 509/512 > 0.99.
    @unroll(12, 0)
    while running {
        var stop: Bool = flip(0.5)
        if stop {
            running = false
        } else {
            count = count + 1
        }
    }
}
