4NestedWith3Variables_true-termination.c

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:05.0
disk size 620 Bytes
downloadable true
type
attribute value
name no_type
processor id 1
description this is the default benchmark type for rejected benchmarks and benchmarks that are not associated with a type.
owning community none
loading contents
/*
 * Date: 2014-06-08
 * Author: leike@informatik.uni-freiburg.de
 *
 * (a, b) is a vector that is rotated around (0, 0) and scaled by a factor of 5.
 * I.e., (a, b) is on an outward spiral around (0, 0).
 *
 * This program terminates because on average, (a, b) is (0, 0),
 * hence q decreases by 1 on average.
 */

typedef enum {false, true} bool;

extern int __VERIFIER_nondet_int(void);

int main()
{
    int a, b, q, olda;
	q = __VERIFIER_nondet_int();
	a = __VERIFIER_nondet_int();
	b = __VERIFIER_nondet_int();
	while (q > 0) {
		q = q + a - 1;
		olda = a;
		a = 3*olda - 4*b;
		b = 4*olda + 3*b;
	}
	return 0;
}
popout

content may be truncated. 'popout' for larger text window.

actions get anonymous link download benchmark