TwoWay_true.c

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:16.0
disk size 811 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
// package TwoWay;

// public class TwoWay {
	// public static void main(String[] args) {
		// Random.args = args;
		// twoWay(true, Random.random());
	// }

	// public static int twoWay(boolean terminate, int n) {
		// if (n < 0) {
			// return 1;
		// } else {
			// int m = n;
			// if (terminate) {
				// m--;
			// } else {
				// m++;
			// }
			// return m*twoWay(terminate, m);
		// }
	// }
// }

extern int __VERIFIER_nondet_int(void);

int twoWay(int terminate, int n) {
		if (n < 0) {
			return 1;
		} else {
			int m = n;
			if (terminate) {
				m--;
			} else {
				m++;
			}
			return m*twoWay(terminate, m);
		}
	}

int main() {
	int x = __VERIFIER_nondet_int();
	if(x < 0)
		return 0;
	int y = __VERIFIER_nondet_int();
	if(y < 0) 
		return 0;
	int z = __VERIFIER_nondet_int();
	twoWay(1,x);

}
popout

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

actions get anonymous link download benchmark