// 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_vsa16a_p3.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 short SORT_3; // BV with 16 bits const SORT_3 mask_SORT_3 = (SORT_3)-1 >> (sizeof(SORT_3) * 8 - 16); const SORT_3 msb_SORT_3 = (SORT_3)1 << (16 - 1); typedef unsigned char SORT_6; // BV with 3 bits const SORT_6 mask_SORT_6 = (SORT_6)-1 >> (sizeof(SORT_6) * 8 - 3); const SORT_6 msb_SORT_6 = (SORT_6)1 << (3 - 1); typedef unsigned char SORT_12; // BV with 2 bits const SORT_12 mask_SORT_12 = (SORT_12)-1 >> (sizeof(SORT_12) * 8 - 2); const SORT_12 msb_SORT_12 = (SORT_12)1 << (2 - 1); typedef unsigned short SORT_35; // BV with 12 bits const SORT_35 mask_SORT_35 = (SORT_35)-1 >> (sizeof(SORT_35) * 8 - 12); const SORT_35 msb_SORT_35 = (SORT_35)1 << (12 - 1); // Initializing constants ... const SORT_6 var_7 = 0; const SORT_12 var_14 = 0; const SORT_1 var_19 = 1; const SORT_6 var_49 = 1; const SORT_6 var_51 = 4; // Collecting input declarations ... SORT_1 input_2; SORT_3 input_4; SORT_3 input_5; SORT_3 input_23; SORT_3 input_25; SORT_3 input_27; SORT_1 input_29; SORT_3 input_31; SORT_3 input_33; SORT_35 input_36; SORT_35 input_38; SORT_3 input_40; SORT_3 input_42; SORT_3 input_44; SORT_3 input_46; // Collecting state declarations ... SORT_6 state_8 = __VERIFIER_nondet_uchar() & mask_SORT_6; // Initializing states ... SORT_6 init_9_arg_1 = var_7; state_8 = init_9_arg_1; for (;;) { // Getting external input values ... input_2 = __VERIFIER_nondet_uchar(); input_4 = __VERIFIER_nondet_ushort(); input_5 = __VERIFIER_nondet_ushort(); input_23 = __VERIFIER_nondet_ushort(); input_25 = __VERIFIER_nondet_ushort(); input_27 = __VERIFIER_nondet_ushort(); input_29 = __VERIFIER_nondet_uchar(); input_31 = __VERIFIER_nondet_ushort(); input_33 = __VERIFIER_nondet_ushort(); input_36 = __VERIFIER_nondet_ushort(); input_38 = __VERIFIER_nondet_ushort(); input_40 = __VERIFIER_nondet_ushort(); input_42 = __VERIFIER_nondet_ushort(); input_44 = __VERIFIER_nondet_ushort(); input_46 = __VERIFIER_nondet_ushort(); // Assuming invariants ... // Asserting properties ... SORT_6 var_10_arg_0 = state_8; SORT_1 var_10 = var_10_arg_0 >> 2; SORT_1 var_11_arg_0 = var_10; SORT_1 var_11 = ~var_11_arg_0; SORT_6 var_13_arg_0 = state_8; SORT_12 var_13 = var_13_arg_0 >> 0; var_13 = var_13 & mask_SORT_12; SORT_12 var_15_arg_0 = var_13; SORT_12 var_15_arg_1 = var_14; SORT_1 var_15 = var_15_arg_0 == var_15_arg_1; SORT_1 var_16_arg_0 = var_11; SORT_1 var_16_arg_1 = var_15; SORT_1 var_16 = var_16_arg_0 | var_16_arg_1; SORT_1 var_20_arg_0 = var_16; SORT_1 var_20 = ~var_20_arg_0; SORT_1 var_21_arg_0 = var_19; SORT_1 var_21_arg_1 = var_20; SORT_1 var_21 = var_21_arg_0 & var_21_arg_1; var_21 = var_21 & mask_SORT_1; SORT_1 bad_22_arg_0 = var_21; __VERIFIER_assert(!(bad_22_arg_0)); // Computing next states ... SORT_6 var_52_arg_0 = state_8; SORT_6 var_52_arg_1 = var_51; SORT_1 var_52 = var_52_arg_0 == var_52_arg_1; SORT_6 var_50_arg_0 = state_8; SORT_6 var_50_arg_1 = var_49; SORT_6 var_50 = var_50_arg_0 + var_50_arg_1; SORT_1 var_53_arg_0 = var_52; SORT_6 var_53_arg_1 = var_7; SORT_6 var_53_arg_2 = var_50; SORT_6 var_53 = var_53_arg_0 ? var_53_arg_1 : var_53_arg_2; var_53 = var_53 & mask_SORT_6; SORT_6 next_54_arg_1 = var_53; // Assigning next states ... state_8 = next_54_arg_1; } return 0; }