// This file is part of the SV-Benchmarks collection of verification tasks: // https://gitlab.com/sosy-lab/benchmarking/sv-benchmarks // // SPDX-FileCopyrightText: 2022 Jana (Philipp) Berger // // SPDX-License-Identifier: GPL-3.0-or-later // Prototype declarations of the functions used to communicate with the model checkers extern unsigned long __VERIFIER_nondet_ulong(); extern long __VERIFIER_nondet_long(); extern unsigned char __VERIFIER_nondet_uchar(); extern char __VERIFIER_nondet_char(); extern unsigned short __VERIFIER_nondet_ushort(); extern short __VERIFIER_nondet_short(); extern float __VERIFIER_nondet_float(); extern double __VERIFIER_nondet_double(); extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__)); void reach_error() { __assert_fail("0", "Req1_Prop1_Batch26100_1loop.c", 13, "reach_error"); } void __VERIFIER_assert(int cond) { if(!(cond)) { ERROR: {reach_error();abort();} } return; } void assume_abort_if_not(int cond) { if(!cond) { abort(); } } #define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) #define abs(a) (((a) < 0 ) ? -(a) : (a)) // Function prototypes // Internal control logic variables unsigned char isInitial = 0; // Signal variables unsigned short int var_1_1 = 1; unsigned short int var_1_3 = 36007; unsigned short int var_1_5 = 32; unsigned short int var_1_6 = 128; unsigned char var_1_8 = 1; unsigned char var_1_9 = 1; unsigned long int var_1_10 = 128; unsigned short int var_1_11 = 1; signed char var_1_12 = 50; signed char var_1_13 = -10; signed char var_1_14 = 1; signed char var_1_15 = 0; signed char var_1_16 = -5; signed short int var_1_17 = -32; unsigned short int var_1_19 = 10; signed char var_1_20 = 2; signed char var_1_22 = 16; float var_1_23 = 3.225; unsigned char var_1_24 = 128; float var_1_25 = 127.875; float var_1_26 = 7.6; unsigned char var_1_27 = 1; unsigned char var_1_28 = 0; signed char var_1_29 = 32; unsigned char var_1_30 = 64; unsigned char var_1_31 = 64; unsigned char var_1_32 = 100; unsigned char var_1_33 = 2; unsigned char var_1_34 = 10; signed short int var_1_35 = 200; signed char var_1_36 = -10; // Calibration values // Last'ed variables unsigned long int last_1_var_1_10 = 128; unsigned short int last_1_var_1_11 = 1; unsigned char last_1_var_1_30 = 64; signed short int last_1_var_1_35 = 200; // Additional functions void initially(void) { } void step(void) { // From: Req10Batch26100_1loop if (last_1_var_1_11 < last_1_var_1_35) { var_1_27 = (var_1_28 || (! var_1_9)); } else { if (var_1_14 == var_1_6) { var_1_27 = var_1_28; } else { var_1_27 = var_1_28; } } // From: Req13Batch26100_1loop signed long int stepLocal_7 = -16; if (stepLocal_7 == last_1_var_1_10) { var_1_34 = (max (var_1_33 , var_1_14)); } // From: Req12Batch26100_1loop signed long int stepLocal_6 = 25 * (var_1_34 - var_1_24); if (stepLocal_6 >= last_1_var_1_30) { var_1_30 = ((var_1_31 + 8) + (var_1_32 - var_1_33)); } // From: Req1Batch26100_1loop if (! var_1_27) { if (var_1_27) { var_1_1 = (var_1_3 - var_1_30); } else { if (var_1_3 < (var_1_30 / (var_1_5 + var_1_6))) { var_1_1 = var_1_34; } } } else { var_1_1 = var_1_34; } // From: Req5Batch26100_1loop signed long int stepLocal_0 = abs (10); if (stepLocal_0 > var_1_34) { var_1_12 = ((abs (var_1_13)) - var_1_14); } else { var_1_12 = (var_1_15 + var_1_16); } // From: Req14Batch26100_1loop var_1_35 = var_1_32; // From: Req15Batch26100_1loop var_1_36 = var_1_33; // From: Req2Batch26100_1loop if (var_1_34 > (var_1_3 - var_1_6)) { var_1_8 = (! (! 0)); } else { var_1_8 = (var_1_27 || var_1_9); } // From: Req7Batch26100_1loop if (var_1_8) { var_1_19 = (var_1_34 + var_1_14); } // From: Req4Batch26100_1loop if (var_1_6 > var_1_30) { if (var_1_34 <= var_1_3) { if (var_1_19 <= var_1_34) { var_1_11 = (var_1_3 - 16); } else { var_1_11 = var_1_6; } } else { var_1_11 = var_1_30; } } else { var_1_11 = var_1_30; } // From: Req3Batch26100_1loop if (var_1_34 <= var_1_35) { var_1_10 = (var_1_3 + (min (var_1_6 , var_1_30))); } else { if (var_1_27) { var_1_10 = var_1_35; } } // From: Req6Batch26100_1loop unsigned short int stepLocal_1 = var_1_5; if (var_1_6 > stepLocal_1) { var_1_17 = (var_1_30 + (max (var_1_19 , (max (var_1_16 , var_1_13))))); } // From: Req9Batch26100_1loop signed short int stepLocal_3 = var_1_17; signed char stepLocal_2 = var_1_15; if (var_1_3 < stepLocal_3) { if (((var_1_24 - var_1_14) << var_1_35) >= stepLocal_2) { var_1_23 = (var_1_25 + var_1_26); } } else { var_1_23 = 15.79f; } // From: Req11Batch26100_1loop unsigned char stepLocal_5 = var_1_27; unsigned short int stepLocal_4 = var_1_19; if (stepLocal_5 && var_1_27) { if (var_1_1 < stepLocal_4) { var_1_29 = (abs (var_1_16)); } } else { var_1_29 = (min (var_1_16 , var_1_13)); } // From: Req8Batch26100_1loop if ((var_1_30 * 1) <= (var_1_36 + var_1_11)) { var_1_20 = (var_1_14 - var_1_22); } } void updateVariables() { var_1_3 = __VERIFIER_nondet_ushort(); assume_abort_if_not(var_1_3 >= 32767); assume_abort_if_not(var_1_3 <= 65534); var_1_5 = __VERIFIER_nondet_ushort(); assume_abort_if_not(var_1_5 >= 1); assume_abort_if_not(var_1_5 <= 32768); var_1_6 = __VERIFIER_nondet_ushort(); assume_abort_if_not(var_1_6 >= 1); assume_abort_if_not(var_1_6 <= 32767); var_1_9 = __VERIFIER_nondet_uchar(); assume_abort_if_not(var_1_9 >= 1); assume_abort_if_not(var_1_9 <= 1); var_1_13 = __VERIFIER_nondet_char(); assume_abort_if_not(var_1_13 >= -126); assume_abort_if_not(var_1_13 <= 126); var_1_14 = __VERIFIER_nondet_char(); assume_abort_if_not(var_1_14 >= 0); assume_abort_if_not(var_1_14 <= 126); var_1_15 = __VERIFIER_nondet_char(); assume_abort_if_not(var_1_15 >= -63); assume_abort_if_not(var_1_15 <= 63); var_1_16 = __VERIFIER_nondet_char(); assume_abort_if_not(var_1_16 >= -63); assume_abort_if_not(var_1_16 <= 63); var_1_22 = __VERIFIER_nondet_char(); assume_abort_if_not(var_1_22 >= 0); assume_abort_if_not(var_1_22 <= 126); var_1_24 = __VERIFIER_nondet_uchar(); assume_abort_if_not(var_1_24 >= 127); assume_abort_if_not(var_1_24 <= 255); var_1_25 = __VERIFIER_nondet_float(); assume_abort_if_not((var_1_25 >= -461168.6018427382800e+13F && var_1_25 <= -1.0e-20F) || (var_1_25 <= 4611686.018427382800e+12F && var_1_25 >= 1.0e-20F )); var_1_26 = __VERIFIER_nondet_float(); assume_abort_if_not((var_1_26 >= -461168.6018427382800e+13F && var_1_26 <= -1.0e-20F) || (var_1_26 <= 4611686.018427382800e+12F && var_1_26 >= 1.0e-20F )); var_1_28 = __VERIFIER_nondet_uchar(); assume_abort_if_not(var_1_28 >= 0); assume_abort_if_not(var_1_28 <= 0); var_1_31 = __VERIFIER_nondet_uchar(); assume_abort_if_not(var_1_31 >= 0); assume_abort_if_not(var_1_31 <= 64); var_1_32 = __VERIFIER_nondet_uchar(); assume_abort_if_not(var_1_32 >= 63); assume_abort_if_not(var_1_32 <= 127); var_1_33 = __VERIFIER_nondet_uchar(); assume_abort_if_not(var_1_33 >= 0); assume_abort_if_not(var_1_33 <= 63); } void updateLastVariables() { last_1_var_1_10 = var_1_10; last_1_var_1_11 = var_1_11; last_1_var_1_30 = var_1_30; last_1_var_1_35 = var_1_35; } int property() { return (((((((((((((((! var_1_27) ? (var_1_27 ? (var_1_1 == ((unsigned short int) (var_1_3 - var_1_30))) : ((var_1_3 < (var_1_30 / (var_1_5 + var_1_6))) ? (var_1_1 == ((unsigned short int) var_1_34)) : 1)) : (var_1_1 == ((unsigned short int) var_1_34))) && ((var_1_34 > (var_1_3 - var_1_6)) ? (var_1_8 == ((unsigned char) (! (! 0)))) : (var_1_8 == ((unsigned char) (var_1_27 || var_1_9))))) && ((var_1_34 <= var_1_35) ? (var_1_10 == ((unsigned long int) (var_1_3 + (min (var_1_6 , var_1_30))))) : (var_1_27 ? (var_1_10 == ((unsigned long int) var_1_35)) : 1))) && ((var_1_6 > var_1_30) ? ((var_1_34 <= var_1_3) ? ((var_1_19 <= var_1_34) ? (var_1_11 == ((unsigned short int) (var_1_3 - 16))) : (var_1_11 == ((unsigned short int) var_1_6))) : (var_1_11 == ((unsigned short int) var_1_30))) : (var_1_11 == ((unsigned short int) var_1_30)))) && (((abs (10)) > var_1_34) ? (var_1_12 == ((signed char) ((abs (var_1_13)) - var_1_14))) : (var_1_12 == ((signed char) (var_1_15 + var_1_16))))) && ((var_1_6 > var_1_5) ? (var_1_17 == ((signed short int) (var_1_30 + (max (var_1_19 , (max (var_1_16 , var_1_13))))))) : 1)) && (var_1_8 ? (var_1_19 == ((unsigned short int) (var_1_34 + var_1_14))) : 1)) && (((var_1_30 * 1) <= (var_1_36 + var_1_11)) ? (var_1_20 == ((signed char) (var_1_14 - var_1_22))) : 1)) && ((var_1_3 < var_1_17) ? ((((var_1_24 - var_1_14) << var_1_35) >= var_1_15) ? (var_1_23 == ((float) (var_1_25 + var_1_26))) : 1) : (var_1_23 == ((float) 15.79f)))) && ((last_1_var_1_11 < last_1_var_1_35) ? (var_1_27 == ((unsigned char) (var_1_28 || (! var_1_9)))) : ((var_1_14 == var_1_6) ? (var_1_27 == ((unsigned char) var_1_28)) : (var_1_27 == ((unsigned char) var_1_28))))) && ((var_1_27 && var_1_27) ? ((var_1_1 < var_1_19) ? (var_1_29 == ((signed char) (abs (var_1_16)))) : 1) : (var_1_29 == ((signed char) (min (var_1_16 , var_1_13)))))) && (((25 * (var_1_34 - var_1_24)) >= last_1_var_1_30) ? (var_1_30 == ((unsigned char) ((var_1_31 + 8) + (var_1_32 - var_1_33)))) : 1)) && ((-16 == last_1_var_1_10) ? (var_1_34 == ((unsigned char) (max (var_1_33 , var_1_14)))) : 1)) && (var_1_35 == ((signed short int) var_1_32))) && (var_1_36 == ((signed char) var_1_33)) ; } int main(void) { isInitial = 1; initially(); int k_loop; for (k_loop = 0; k_loop < 1; k_loop++) { updateLastVariables(); updateVariables(); step(); __VERIFIER_assert(property()); isInitial = 0; } return 0; }