// 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", "mul4.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 int SORT_3; // BV with 32 bits const SORT_3 mask_SORT_3 = (SORT_3)-1 >> (sizeof(SORT_3) * 8 - 32); const SORT_3 msb_SORT_3 = (SORT_3)1 << (32 - 1); typedef unsigned long SORT_10; // BV with 64 bits const SORT_10 mask_SORT_10 = (SORT_10)-1 >> (sizeof(SORT_10) * 8 - 64); const SORT_10 msb_SORT_10 = (SORT_10)1 << (64 - 1); typedef unsigned char SORT_64; // BV with 4 bits const SORT_64 mask_SORT_64 = (SORT_64)-1 >> (sizeof(SORT_64) * 8 - 4); const SORT_64 msb_SORT_64 = (SORT_64)1 << (4 - 1); typedef unsigned long SORT_66; // BV with 60 bits const SORT_66 mask_SORT_66 = (SORT_66)-1 >> (sizeof(SORT_66) * 8 - 60); const SORT_66 msb_SORT_66 = (SORT_66)1 << (60 - 1); // Initializing constants ... const SORT_10 var_11 = 0; const SORT_1 var_14 = 0; const SORT_3 var_24 = 0; const SORT_1 var_51 = 1; const SORT_64 var_65 = 0; // Collecting input declarations ... SORT_1 input_2; SORT_3 input_4; SORT_3 input_5; SORT_1 input_6; SORT_1 input_7; SORT_1 input_8; SORT_1 input_9; // Collecting state declarations ... SORT_10 state_12 = __VERIFIER_nondet_ulong() & mask_SORT_10; SORT_1 state_15 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_10 state_18 = __VERIFIER_nondet_ulong() & mask_SORT_10; SORT_1 state_20 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_3 state_25 = __VERIFIER_nondet_uint() & mask_SORT_3; SORT_1 state_27 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_3 state_30 = __VERIFIER_nondet_uint() & mask_SORT_3; SORT_1 state_32 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_3 state_37 = __VERIFIER_nondet_uint() & mask_SORT_3; SORT_1 state_39 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_3 state_42 = __VERIFIER_nondet_uint() & mask_SORT_3; SORT_1 state_44 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_69 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_74 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_87 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_92 = __VERIFIER_nondet_uchar() & mask_SORT_1; // Initializing states ... SORT_10 init_13_arg_1 = var_11; state_12 = init_13_arg_1; SORT_1 init_16_arg_1 = var_14; state_15 = init_16_arg_1; SORT_10 init_19_arg_1 = var_11; state_18 = init_19_arg_1; SORT_1 init_21_arg_1 = var_14; state_20 = init_21_arg_1; SORT_3 init_26_arg_1 = var_24; state_25 = init_26_arg_1; SORT_1 init_28_arg_1 = var_14; state_27 = init_28_arg_1; SORT_3 init_31_arg_1 = var_24; state_30 = init_31_arg_1; SORT_1 init_33_arg_1 = var_14; state_32 = init_33_arg_1; SORT_3 init_38_arg_1 = var_24; state_37 = init_38_arg_1; SORT_1 init_40_arg_1 = var_14; state_39 = init_40_arg_1; SORT_3 init_43_arg_1 = var_24; state_42 = init_43_arg_1; SORT_1 init_45_arg_1 = var_14; state_44 = init_45_arg_1; SORT_1 init_70_arg_1 = var_14; state_69 = init_70_arg_1; SORT_1 init_75_arg_1 = var_14; state_74 = init_75_arg_1; SORT_1 init_88_arg_1 = var_14; state_87 = init_88_arg_1; SORT_1 init_93_arg_1 = var_14; state_92 = init_93_arg_1; for (;;) { // Getting external input values ... input_2 = __VERIFIER_nondet_uchar(); input_4 = __VERIFIER_nondet_uint(); input_5 = __VERIFIER_nondet_uint(); input_6 = __VERIFIER_nondet_uchar(); input_6 = input_6 & mask_SORT_1; input_7 = __VERIFIER_nondet_uchar(); input_7 = input_7 & mask_SORT_1; input_8 = __VERIFIER_nondet_uchar(); input_8 = input_8 & mask_SORT_1; input_9 = __VERIFIER_nondet_uchar(); input_9 = input_9 & mask_SORT_1; // Assuming invariants ... // Asserting properties ... SORT_1 var_17_arg_0 = state_15; SORT_10 var_17_arg_1 = state_12; SORT_10 var_17_arg_2 = var_11; SORT_10 var_17 = var_17_arg_0 ? var_17_arg_1 : var_17_arg_2; var_17 = var_17 & mask_SORT_10; SORT_1 var_22_arg_0 = state_20; SORT_10 var_22_arg_1 = state_18; SORT_10 var_22_arg_2 = var_11; SORT_10 var_22 = var_22_arg_0 ? var_22_arg_1 : var_22_arg_2; var_22 = var_22 & mask_SORT_10; SORT_10 var_23_arg_0 = var_17; SORT_10 var_23_arg_1 = var_22; SORT_1 var_23 = var_23_arg_0 == var_23_arg_1; SORT_1 var_29_arg_0 = state_27; SORT_3 var_29_arg_1 = state_25; SORT_3 var_29_arg_2 = var_24; SORT_3 var_29 = var_29_arg_0 ? var_29_arg_1 : var_29_arg_2; var_29 = var_29 & mask_SORT_3; SORT_1 var_34_arg_0 = state_32; SORT_3 var_34_arg_1 = state_30; SORT_3 var_34_arg_2 = var_24; SORT_3 var_34 = var_34_arg_0 ? var_34_arg_1 : var_34_arg_2; var_34 = var_34 & mask_SORT_3; SORT_3 var_35_arg_0 = var_29; SORT_3 var_35_arg_1 = var_34; SORT_1 var_35 = var_35_arg_0 == var_35_arg_1; SORT_1 var_36_arg_0 = var_23; SORT_1 var_36_arg_1 = var_35; SORT_1 var_36 = var_36_arg_0 & var_36_arg_1; SORT_1 var_41_arg_0 = state_39; SORT_3 var_41_arg_1 = state_37; SORT_3 var_41_arg_2 = var_24; SORT_3 var_41 = var_41_arg_0 ? var_41_arg_1 : var_41_arg_2; var_41 = var_41 & mask_SORT_3; SORT_1 var_46_arg_0 = state_44; SORT_3 var_46_arg_1 = state_42; SORT_3 var_46_arg_2 = var_24; SORT_3 var_46 = var_46_arg_0 ? var_46_arg_1 : var_46_arg_2; var_46 = var_46 & mask_SORT_3; SORT_3 var_47_arg_0 = var_41; SORT_3 var_47_arg_1 = var_46; SORT_1 var_47 = var_47_arg_0 == var_47_arg_1; SORT_1 var_48_arg_0 = var_36; SORT_1 var_48_arg_1 = var_47; SORT_1 var_48 = var_48_arg_0 & var_48_arg_1; SORT_1 var_52_arg_0 = var_48; SORT_1 var_52 = ~var_52_arg_0; SORT_1 var_53_arg_0 = var_51; SORT_1 var_53_arg_1 = var_52; SORT_1 var_53 = var_53_arg_0 & var_53_arg_1; var_53 = var_53 & mask_SORT_1; SORT_1 bad_54_arg_0 = var_53; __VERIFIER_assert(!(bad_54_arg_0)); // Computing next states ... SORT_3 var_61_arg_0 = state_25; var_61_arg_0 = var_61_arg_0 & mask_SORT_3; SORT_10 var_61 = var_61_arg_0; SORT_3 var_62_arg_0 = state_37; var_62_arg_0 = var_62_arg_0 & mask_SORT_3; SORT_10 var_62 = var_62_arg_0; SORT_10 var_63_arg_0 = var_61; SORT_10 var_63_arg_1 = var_62; SORT_10 var_63 = var_63_arg_0 * var_63_arg_1; SORT_10 var_67_arg_0 = var_63; SORT_66 var_67 = var_67_arg_0 >> 2; var_67 = var_67 & mask_SORT_66; SORT_64 var_68_arg_0 = var_65; SORT_66 var_68_arg_1 = var_67; SORT_10 var_68 = ((SORT_10)var_68_arg_0 << 60) | var_68_arg_1; SORT_1 var_71_arg_0 = state_69; SORT_10 var_71_arg_1 = var_68; SORT_10 var_71_arg_2 = var_11; SORT_10 var_71 = var_71_arg_0 ? var_71_arg_1 : var_71_arg_2; SORT_10 next_95_arg_1 = var_71; SORT_1 next_96_arg_1 = state_74; SORT_3 var_82_arg_0 = state_30; var_82_arg_0 = var_82_arg_0 & mask_SORT_3; SORT_10 var_82 = var_82_arg_0; SORT_3 var_83_arg_0 = state_42; var_83_arg_0 = var_83_arg_0 & mask_SORT_3; SORT_10 var_83 = var_83_arg_0; SORT_10 var_84_arg_0 = var_82; SORT_10 var_84_arg_1 = var_83; SORT_10 var_84 = var_84_arg_0 * var_84_arg_1; SORT_10 var_85_arg_0 = var_84; SORT_66 var_85 = var_85_arg_0 >> 2; var_85 = var_85 & mask_SORT_66; SORT_64 var_86_arg_0 = var_65; SORT_66 var_86_arg_1 = var_85; SORT_10 var_86 = ((SORT_10)var_86_arg_0 << 60) | var_86_arg_1; SORT_1 var_89_arg_0 = state_87; SORT_10 var_89_arg_1 = var_86; SORT_10 var_89_arg_2 = var_11; SORT_10 var_89 = var_89_arg_0 ? var_89_arg_1 : var_89_arg_2; SORT_1 var_97_arg_0 = state_92; SORT_10 var_97_arg_1 = var_89; SORT_10 var_97_arg_2 = state_18; SORT_10 var_97 = var_97_arg_0 ? var_97_arg_1 : var_97_arg_2; SORT_10 next_98_arg_1 = var_97; SORT_1 next_99_arg_1 = state_92; SORT_3 next_100_arg_1 = input_4; SORT_1 next_101_arg_1 = input_8; SORT_1 var_76_arg_0 = input_7; SORT_1 var_76_arg_1 = input_6; SORT_1 var_76 = var_76_arg_0 & var_76_arg_1; SORT_1 var_77_arg_0 = input_8; SORT_1 var_77_arg_1 = var_76; SORT_1 var_77 = var_77_arg_0 | var_77_arg_1; var_77 = var_77 & mask_SORT_1; SORT_1 var_102_arg_0 = var_77; SORT_3 var_102_arg_1 = input_4; SORT_3 var_102_arg_2 = state_30; SORT_3 var_102 = var_102_arg_0 ? var_102_arg_1 : var_102_arg_2; SORT_3 next_103_arg_1 = var_102; SORT_1 next_104_arg_1 = input_8; SORT_3 next_105_arg_1 = input_5; SORT_1 next_106_arg_1 = input_9; SORT_1 var_79_arg_0 = input_9; SORT_1 var_79_arg_1 = var_76; SORT_1 var_79 = var_79_arg_0 | var_79_arg_1; var_79 = var_79 & mask_SORT_1; SORT_1 var_107_arg_0 = var_79; SORT_3 var_107_arg_1 = input_5; SORT_3 var_107_arg_2 = state_42; SORT_3 var_107 = var_107_arg_0 ? var_107_arg_1 : var_107_arg_2; SORT_3 next_108_arg_1 = var_107; SORT_1 next_109_arg_1 = input_9; SORT_1 next_110_arg_1 = input_6; SORT_1 next_111_arg_1 = input_7; SORT_1 next_112_arg_1 = input_6; SORT_1 next_113_arg_1 = input_7; // Assigning next states ... state_12 = next_95_arg_1; state_15 = next_96_arg_1; state_18 = next_98_arg_1; state_20 = next_99_arg_1; state_25 = next_100_arg_1; state_27 = next_101_arg_1; state_30 = next_103_arg_1; state_32 = next_104_arg_1; state_37 = next_105_arg_1; state_39 = next_106_arg_1; state_42 = next_108_arg_1; state_44 = next_109_arg_1; state_69 = next_110_arg_1; state_74 = next_111_arg_1; state_87 = next_112_arg_1; state_92 = next_113_arg_1; } return 0; }