// 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=true, 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", "vis_arrays_vsaR_p04.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_3; // BV with 5 bits const SORT_3 mask_SORT_3 = (SORT_3)-1 >> (sizeof(SORT_3) * 8 - 5); const SORT_3 msb_SORT_3 = (SORT_3)1 << (5 - 1); typedef unsigned short SORT_5; // BV with 12 bits const SORT_5 mask_SORT_5 = (SORT_5)-1 >> (sizeof(SORT_5) * 8 - 12); const SORT_5 msb_SORT_5 = (SORT_5)1 << (12 - 1); typedef unsigned char SORT_7; // BV with 3 bits const SORT_7 mask_SORT_7 = (SORT_7)-1 >> (sizeof(SORT_7) * 8 - 3); const SORT_7 msb_SORT_7 = (SORT_7)1 << (3 - 1); typedef unsigned char SORT_14; // BV with 2 bits const SORT_14 mask_SORT_14 = (SORT_14)-1 >> (sizeof(SORT_14) * 8 - 2); const SORT_14 msb_SORT_14 = (SORT_14)1 << (2 - 1); // Initializing constants ... const SORT_7 var_8 = 0; const SORT_1 var_12 = 0; const SORT_14 var_16 = 0; const SORT_1 var_21 = 1; const SORT_7 var_50 = 1; const SORT_7 var_52 = 4; // Collecting input declarations ... SORT_1 input_2; SORT_3 input_4; SORT_5 input_6; SORT_3 input_25; SORT_3 input_27; SORT_3 input_29; SORT_1 input_31; SORT_5 input_33; SORT_3 input_35; SORT_3 input_37; SORT_3 input_39; SORT_3 input_41; SORT_3 input_43; SORT_3 input_45; SORT_3 input_47; // Collecting state declarations ... SORT_7 state_9 = __VERIFIER_nondet_uchar() & mask_SORT_7; // Initializing states ... SORT_7 init_10_arg_1 = var_8; state_9 = init_10_arg_1; for (;;) { // Getting external input values ... input_2 = __VERIFIER_nondet_uchar(); input_4 = __VERIFIER_nondet_uchar(); input_6 = __VERIFIER_nondet_ushort(); input_25 = __VERIFIER_nondet_uchar(); input_27 = __VERIFIER_nondet_uchar(); input_29 = __VERIFIER_nondet_uchar(); input_31 = __VERIFIER_nondet_uchar(); input_33 = __VERIFIER_nondet_ushort(); input_35 = __VERIFIER_nondet_uchar(); input_37 = __VERIFIER_nondet_uchar(); input_39 = __VERIFIER_nondet_uchar(); input_41 = __VERIFIER_nondet_uchar(); input_43 = __VERIFIER_nondet_uchar(); input_45 = __VERIFIER_nondet_uchar(); input_47 = __VERIFIER_nondet_uchar(); // Assuming invariants ... // Asserting properties ... SORT_7 var_11_arg_0 = state_9; SORT_1 var_11 = var_11_arg_0 >> 2; var_11 = var_11 & mask_SORT_1; SORT_1 var_13_arg_0 = var_11; SORT_1 var_13_arg_1 = var_12; SORT_1 var_13 = var_13_arg_0 == var_13_arg_1; SORT_7 var_15_arg_0 = state_9; SORT_14 var_15 = var_15_arg_0 >> 0; var_15 = var_15 & mask_SORT_14; SORT_14 var_17_arg_0 = var_15; SORT_14 var_17_arg_1 = var_16; SORT_1 var_17 = var_17_arg_0 == var_17_arg_1; SORT_1 var_18_arg_0 = var_13; SORT_1 var_18_arg_1 = var_17; SORT_1 var_18 = var_18_arg_0 | var_18_arg_1; SORT_1 var_22_arg_0 = var_18; SORT_1 var_22 = ~var_22_arg_0; SORT_1 var_23_arg_0 = var_21; SORT_1 var_23_arg_1 = var_22; SORT_1 var_23 = var_23_arg_0 & var_23_arg_1; var_23 = var_23 & mask_SORT_1; SORT_1 bad_24_arg_0 = var_23; __VERIFIER_assert(!(bad_24_arg_0)); // Computing next states ... SORT_7 var_53_arg_0 = state_9; SORT_7 var_53_arg_1 = var_52; SORT_1 var_53 = var_53_arg_0 == var_53_arg_1; SORT_7 var_51_arg_0 = state_9; SORT_7 var_51_arg_1 = var_50; SORT_7 var_51 = var_51_arg_0 + var_51_arg_1; SORT_1 var_54_arg_0 = var_53; SORT_7 var_54_arg_1 = var_8; SORT_7 var_54_arg_2 = var_51; SORT_7 var_54 = var_54_arg_0 ? var_54_arg_1 : var_54_arg_2; var_54 = var_54 & mask_SORT_7; SORT_7 next_55_arg_1 = var_54; // Assigning next states ... state_9 = next_55_arg_1; } return 0; }