aviad_true-termination.c

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:15.0
disk size 455 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
/* An example using integer division, given to me by Aviad Pineles
 * Date: 15.12.2013
 * Author: Amir Ben-Amram, amirben@cs.mta.ac.il
 *
 */
extern int __VERIFIER_nondet_int(void);


 int f(int a) {
    int tmp, count = 0;
    while(a > 1) {
      tmp = a % 2;
      if(tmp == 0) a = a / 2;
      else a = a - 1;
      count++;
    }
    return count;
  }
  
int main() {
    int x = __VERIFIER_nondet_int();
    int count = f(x);
    return count;
  }

popout

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

actions get anonymous link download benchmark