// This file is part of the SV-Benchmarks collection of verification tasks: // https://gitlab.com/sosy-lab/benchmarking/sv-benchmarks // // SPDX-FileCopyrightText: 2020 Aman Goel // SPDX-FileCopyrightText: 2022 The SV-Benchmarks Community // // SPDX-License-Identifier: GPL-3.0-or-later // This C program is converted from Btor2 by Btor2C version sha1:a0fa249 // with arguments: { architecture=64, lazy_modulo=false, use_memmove=false, unroll_inner_loops=false, shortest_type=true, diff_type=true, decimal_constant=true, zero_init=false, sra_extend_sign=true } // Comments from the original Btor2 file: // ; source: https://github.com/aman-goel/avr/tree/92362931700b66684418a991d018c9fbdbebc06f/tests // ; BTOR description generated by Yosys 0.9+431 (git sha1 4a3b5437, clang 4.0.1-6 -fPIC -Os) for module main. extern unsigned char __VERIFIER_nondet_uchar(); extern unsigned short __VERIFIER_nondet_ushort(); extern unsigned int __VERIFIER_nondet_uint(); extern unsigned long __VERIFIER_nondet_ulong(); extern void abort(void); extern void __assert_fail(const char *, const char *, unsigned int, const char *); void reach_error() { __assert_fail("0", "h_b06.c", 0, "reach_error"); } void __VERIFIER_assert(int cond) { if (!(cond)) { ERROR: { reach_error(); abort(); } } } void assume_abort_if_not(int cond) { if (!cond) { abort(); } } int main() { // Defining sorts ... typedef unsigned char SORT_1; // BV with 1 bits const SORT_1 mask_SORT_1 = (SORT_1)-1 >> (sizeof(SORT_1) * 8 - 1); const SORT_1 msb_SORT_1 = (SORT_1)1 << (1 - 1); typedef unsigned char SORT_11; // BV with 2 bits const SORT_11 mask_SORT_11 = (SORT_11)-1 >> (sizeof(SORT_11) * 8 - 2); const SORT_11 msb_SORT_11 = (SORT_11)1 << (2 - 1); typedef unsigned int SORT_15; // BV with 32 bits const SORT_15 mask_SORT_15 = (SORT_15)-1 >> (sizeof(SORT_15) * 8 - 32); const SORT_15 msb_SORT_15 = (SORT_15)1 << (32 - 1); // Initializing constants ... const SORT_1 var_5 = 0; const SORT_11 var_12 = 0; const SORT_15 var_17 = 2; const SORT_1 var_22 = 1; const SORT_11 var_39 = 1; // Collecting input declarations ... SORT_1 input_2; SORT_1 input_3; SORT_1 input_4; SORT_11 input_26; SORT_11 input_40; SORT_1 input_45; // Collecting state declarations ... SORT_1 state_6 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_8 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_11 state_13 = __VERIFIER_nondet_uchar() & mask_SORT_11; SORT_1 state_31 = __VERIFIER_nondet_uchar() & mask_SORT_1; // Initializing states ... SORT_1 init_7_arg_1 = var_5; state_6 = init_7_arg_1; SORT_1 init_9_arg_1 = var_5; state_8 = init_9_arg_1; SORT_11 init_14_arg_1 = var_12; state_13 = init_14_arg_1; SORT_1 init_32_arg_1 = var_5; state_31 = init_32_arg_1; for (;;) { // Getting external input values ... input_2 = __VERIFIER_nondet_uchar(); input_2 = input_2 & mask_SORT_1; input_3 = __VERIFIER_nondet_uchar(); input_3 = input_3 & mask_SORT_1; input_4 = __VERIFIER_nondet_uchar(); input_4 = input_4 & mask_SORT_1; input_26 = __VERIFIER_nondet_uchar(); input_26 = input_26 & mask_SORT_11; input_40 = __VERIFIER_nondet_uchar(); input_40 = input_40 & mask_SORT_11; input_45 = __VERIFIER_nondet_uchar(); input_45 = input_45 & mask_SORT_1; // Assuming invariants ... // Asserting properties ... SORT_1 var_10_arg_0 = state_6; SORT_1 var_10_arg_1 = state_8; SORT_1 var_10 = var_10_arg_0 == var_10_arg_1; SORT_11 var_16_arg_0 = state_13; SORT_15 var_16 = var_16_arg_0; SORT_15 var_18_arg_0 = var_16; SORT_15 var_18_arg_1 = var_17; SORT_1 var_18 = var_18_arg_0 != var_18_arg_1; SORT_1 var_19_arg_0 = var_10; SORT_1 var_19_arg_1 = var_18; SORT_1 var_19 = var_19_arg_0 & var_19_arg_1; var_19 = var_19 & mask_SORT_1; SORT_1 var_23_arg_0 = var_19; SORT_1 var_23 = ~var_23_arg_0; var_23 = var_23 & mask_SORT_1; SORT_1 var_24_arg_0 = var_22; SORT_1 var_24_arg_1 = var_23; SORT_1 var_24 = var_24_arg_0 & var_24_arg_1; var_24 = var_24 & mask_SORT_1; SORT_1 bad_25_arg_0 = var_24; __VERIFIER_assert(!(bad_25_arg_0)); // Computing next states ... SORT_1 var_33_arg_0 = input_2; SORT_1 var_33_arg_1 = var_5; SORT_1 var_33_arg_2 = var_22; SORT_1 var_33 = var_33_arg_0 ? var_33_arg_1 : var_33_arg_2; SORT_1 var_34_arg_0 = state_31; SORT_1 var_34_arg_1 = var_33; SORT_1 var_34_arg_2 = var_33; SORT_1 var_34 = var_34_arg_0 ? var_34_arg_1 : var_34_arg_2; SORT_1 next_35_arg_1 = var_34; SORT_1 var_36_arg_0 = input_2; SORT_1 var_36_arg_1 = var_5; SORT_1 var_36_arg_2 = var_22; SORT_1 var_36 = var_36_arg_0 ? var_36_arg_1 : var_36_arg_2; SORT_1 var_37_arg_0 = state_31; SORT_1 var_37_arg_1 = var_36; SORT_1 var_37_arg_2 = var_36; SORT_1 var_37 = var_37_arg_0 ? var_37_arg_1 : var_37_arg_2; SORT_1 next_38_arg_1 = var_37; SORT_1 var_41_arg_0 = input_3; SORT_11 var_41_arg_1 = var_12; SORT_11 var_41_arg_2 = var_39; SORT_11 var_41 = var_41_arg_0 ? var_41_arg_1 : var_41_arg_2; SORT_1 var_42_arg_0 = state_31; SORT_11 var_42_arg_1 = var_41; SORT_11 var_42_arg_2 = input_40; SORT_11 var_42 = var_42_arg_0 ? var_42_arg_1 : var_42_arg_2; SORT_1 var_43_arg_0 = state_31; SORT_11 var_43_arg_1 = var_42; SORT_11 var_43_arg_2 = var_39; SORT_11 var_43 = var_43_arg_0 ? var_43_arg_1 : var_43_arg_2; SORT_11 next_44_arg_1 = var_43; SORT_1 var_46_arg_0 = input_3; SORT_1 var_46_arg_1 = var_5; SORT_1 var_46_arg_2 = var_22; SORT_1 var_46 = var_46_arg_0 ? var_46_arg_1 : var_46_arg_2; SORT_1 var_47_arg_0 = state_31; SORT_1 var_47_arg_1 = var_46; SORT_1 var_47_arg_2 = input_45; SORT_1 var_47 = var_47_arg_0 ? var_47_arg_1 : var_47_arg_2; SORT_1 var_48_arg_0 = state_31; SORT_1 var_48_arg_1 = var_47; SORT_1 var_48_arg_2 = var_22; SORT_1 var_48 = var_48_arg_0 ? var_48_arg_1 : var_48_arg_2; SORT_1 next_49_arg_1 = var_48; // Assigning next states ... state_6 = next_35_arg_1; state_8 = next_38_arg_1; state_13 = next_44_arg_1; state_31 = next_49_arg_1; } return 0; }