// 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", "eq_sdp_v6.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 8 bits const SORT_1 mask_SORT_1 = (SORT_1)-1 >> (sizeof(SORT_1) * 8 - 8); const SORT_1 msb_SORT_1 = (SORT_1)1 << (8 - 1); typedef unsigned char SORT_5; // BV with 1 bits const SORT_5 mask_SORT_5 = (SORT_5)-1 >> (sizeof(SORT_5) * 8 - 1); const SORT_5 msb_SORT_5 = (SORT_5)1 << (1 - 1); // Initializing constants ... const SORT_1 var_9 = 0; const SORT_5 var_22 = 0; const SORT_5 var_31 = 1; const SORT_1 var_109 = 1; // Collecting input declarations ... SORT_1 input_2; SORT_1 input_3; SORT_1 input_4; SORT_5 input_6; SORT_5 input_7; SORT_5 input_8; SORT_5 input_35; SORT_5 input_37; SORT_5 input_39; SORT_5 input_51; // Collecting state declarations ... SORT_1 state_10 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_12 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_18 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_5 state_23 = __VERIFIER_nondet_uchar() & mask_SORT_5; SORT_1 state_26 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_5 state_41 = __VERIFIER_nondet_uchar() & mask_SORT_5; SORT_5 state_43 = __VERIFIER_nondet_uchar() & mask_SORT_5; SORT_1 state_45 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_47 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_49 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_5 state_53 = __VERIFIER_nondet_uchar() & mask_SORT_5; SORT_1 state_55 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_5 state_57 = __VERIFIER_nondet_uchar() & mask_SORT_5; SORT_1 state_59 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_62 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_64 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_66 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_68 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_70 = __VERIFIER_nondet_uchar() & mask_SORT_1; SORT_1 state_72 = __VERIFIER_nondet_uchar() & mask_SORT_1; // Initializing states ... SORT_1 init_11_arg_1 = var_9; state_10 = init_11_arg_1; SORT_1 init_13_arg_1 = var_9; state_12 = init_13_arg_1; SORT_1 init_19_arg_1 = var_9; state_18 = init_19_arg_1; SORT_5 init_24_arg_1 = var_22; state_23 = init_24_arg_1; SORT_1 init_27_arg_1 = var_9; state_26 = init_27_arg_1; SORT_5 init_42_arg_1 = var_22; state_41 = init_42_arg_1; SORT_5 init_44_arg_1 = var_22; state_43 = init_44_arg_1; SORT_1 init_46_arg_1 = var_9; state_45 = init_46_arg_1; SORT_1 init_48_arg_1 = var_9; state_47 = init_48_arg_1; SORT_1 init_50_arg_1 = var_9; state_49 = init_50_arg_1; SORT_5 init_54_arg_1 = var_22; state_53 = init_54_arg_1; SORT_1 init_56_arg_1 = var_9; state_55 = init_56_arg_1; SORT_5 init_58_arg_1 = var_22; state_57 = init_58_arg_1; SORT_1 init_60_arg_1 = var_9; state_59 = init_60_arg_1; SORT_1 init_63_arg_1 = var_9; state_62 = init_63_arg_1; SORT_1 init_65_arg_1 = var_9; state_64 = init_65_arg_1; SORT_1 init_67_arg_1 = var_9; state_66 = init_67_arg_1; SORT_1 init_69_arg_1 = var_9; state_68 = init_69_arg_1; SORT_1 init_71_arg_1 = var_9; state_70 = init_71_arg_1; SORT_1 init_73_arg_1 = var_9; state_72 = init_73_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_6 = __VERIFIER_nondet_uchar(); input_6 = input_6 & mask_SORT_5; input_7 = __VERIFIER_nondet_uchar(); input_7 = input_7 & mask_SORT_5; input_8 = __VERIFIER_nondet_uchar(); input_8 = input_8 & mask_SORT_5; input_35 = __VERIFIER_nondet_uchar(); input_35 = input_35 & mask_SORT_5; input_37 = __VERIFIER_nondet_uchar(); input_37 = input_37 & mask_SORT_5; input_39 = __VERIFIER_nondet_uchar(); input_39 = input_39 & mask_SORT_5; input_51 = __VERIFIER_nondet_uchar(); input_51 = input_51 & mask_SORT_5; // Assuming invariants ... // Asserting properties ... SORT_1 var_16_arg_0 = state_10; SORT_5 var_16 = var_16_arg_0 >> 0; var_16 = var_16 & mask_SORT_5; SORT_1 var_15_arg_0 = state_10; SORT_1 var_15_arg_1 = state_12; SORT_1 var_15 = var_15_arg_0 + var_15_arg_1; var_15 = var_15 & mask_SORT_1; SORT_1 var_14_arg_0 = state_10; SORT_1 var_14_arg_1 = state_12; SORT_1 var_14 = var_14_arg_0 - var_14_arg_1; var_14 = var_14 & mask_SORT_1; SORT_5 var_17_arg_0 = var_16; SORT_1 var_17_arg_1 = var_15; SORT_1 var_17_arg_2 = var_14; SORT_1 var_17 = var_17_arg_0 ? var_17_arg_1 : var_17_arg_2; SORT_1 var_21_arg_0 = var_17; SORT_1 var_21_arg_1 = state_18; SORT_1 var_21 = var_21_arg_0 + var_21_arg_1; var_21 = var_21 & mask_SORT_1; SORT_1 var_20_arg_0 = var_17; SORT_1 var_20_arg_1 = state_18; SORT_1 var_20 = var_20_arg_0 - var_20_arg_1; var_20 = var_20 & mask_SORT_1; SORT_5 var_25_arg_0 = state_23; SORT_1 var_25_arg_1 = var_21; SORT_1 var_25_arg_2 = var_20; SORT_1 var_25 = var_25_arg_0 ? var_25_arg_1 : var_25_arg_2; SORT_1 var_28_arg_0 = var_25; SORT_1 var_28_arg_1 = state_26; SORT_5 var_28 = var_28_arg_0 == var_28_arg_1; SORT_5 var_32_arg_0 = var_28; SORT_5 var_32 = ~var_32_arg_0; var_32 = var_32 & mask_SORT_5; SORT_5 var_33_arg_0 = var_31; SORT_5 var_33_arg_1 = var_32; SORT_5 var_33 = var_33_arg_0 & var_33_arg_1; var_33 = var_33 & mask_SORT_5; SORT_5 bad_34_arg_0 = var_33; __VERIFIER_assert(!(bad_34_arg_0)); // Computing next states ... SORT_5 var_76_arg_0 = input_8; SORT_5 var_76_arg_1 = var_31; SORT_5 var_76 = var_76_arg_0 == var_76_arg_1; SORT_5 var_77_arg_0 = var_76; SORT_1 var_77_arg_1 = var_9; SORT_1 var_77_arg_2 = state_64; SORT_1 var_77 = var_77_arg_0 ? var_77_arg_1 : var_77_arg_2; SORT_1 next_78_arg_1 = var_77; SORT_5 var_79_arg_0 = var_76; SORT_1 var_79_arg_1 = var_9; SORT_1 var_79_arg_2 = state_68; SORT_1 var_79 = var_79_arg_0 ? var_79_arg_1 : var_79_arg_2; SORT_1 next_80_arg_1 = var_79; SORT_5 var_81_arg_0 = var_76; SORT_1 var_81_arg_1 = var_9; SORT_1 var_81_arg_2 = state_72; SORT_1 var_81 = var_81_arg_0 ? var_81_arg_1 : var_81_arg_2; SORT_1 next_82_arg_1 = var_81; SORT_5 var_83_arg_0 = var_76; SORT_5 var_83_arg_1 = var_22; SORT_5 var_83_arg_2 = state_43; SORT_5 var_83 = var_83_arg_0 ? var_83_arg_1 : var_83_arg_2; SORT_5 next_84_arg_1 = var_83; SORT_5 var_88_arg_0 = input_8; SORT_5 var_88_arg_1 = var_31; SORT_5 var_88 = var_88_arg_0 == var_88_arg_1; SORT_1 var_86_arg_0 = state_59; SORT_1 var_86_arg_1 = state_55; SORT_1 var_86 = var_86_arg_0 + var_86_arg_1; var_86 = var_86 & mask_SORT_1; SORT_1 var_85_arg_0 = state_59; SORT_1 var_85_arg_1 = state_55; SORT_1 var_85 = var_85_arg_0 - var_85_arg_1; var_85 = var_85 & mask_SORT_1; SORT_5 var_87_arg_0 = state_57; SORT_1 var_87_arg_1 = var_86; SORT_1 var_87_arg_2 = var_85; SORT_1 var_87 = var_87_arg_0 ? var_87_arg_1 : var_87_arg_2; SORT_5 var_89_arg_0 = var_88; SORT_1 var_89_arg_1 = var_9; SORT_1 var_89_arg_2 = var_87; SORT_1 var_89 = var_89_arg_0 ? var_89_arg_1 : var_89_arg_2; SORT_1 next_90_arg_1 = var_89; SORT_5 var_91_arg_0 = var_76; SORT_5 var_91_arg_1 = var_22; SORT_5 var_91_arg_2 = input_7; SORT_5 var_91 = var_91_arg_0 ? var_91_arg_1 : var_91_arg_2; SORT_5 next_92_arg_1 = var_91; SORT_5 var_93_arg_0 = var_76; SORT_5 var_93_arg_1 = var_22; SORT_5 var_93_arg_2 = state_41; SORT_5 var_93 = var_93_arg_0 ? var_93_arg_1 : var_93_arg_2; SORT_5 next_94_arg_1 = var_93; SORT_5 var_95_arg_0 = var_88; SORT_1 var_95_arg_1 = var_9; SORT_1 var_95_arg_2 = input_2; SORT_1 var_95 = var_95_arg_0 ? var_95_arg_1 : var_95_arg_2; SORT_1 next_96_arg_1 = var_95; SORT_5 var_97_arg_0 = var_88; SORT_1 var_97_arg_1 = var_9; SORT_1 var_97_arg_2 = input_3; SORT_1 var_97 = var_97_arg_0 ? var_97_arg_1 : var_97_arg_2; SORT_1 next_98_arg_1 = var_97; SORT_5 var_99_arg_0 = var_88; SORT_1 var_99_arg_1 = var_9; SORT_1 var_99_arg_2 = input_4; SORT_1 var_99 = var_99_arg_0 ? var_99_arg_1 : var_99_arg_2; SORT_1 next_100_arg_1 = var_99; SORT_5 var_101_arg_0 = var_88; SORT_5 var_101_arg_1 = var_22; SORT_5 var_101_arg_2 = input_7; SORT_5 var_101 = var_101_arg_0 ? var_101_arg_1 : var_101_arg_2; SORT_5 next_102_arg_1 = var_101; SORT_5 var_103_arg_0 = var_88; SORT_1 var_103_arg_1 = var_9; SORT_1 var_103_arg_2 = state_49; SORT_1 var_103 = var_103_arg_0 ? var_103_arg_1 : var_103_arg_2; SORT_1 next_104_arg_1 = var_103; SORT_5 var_105_arg_0 = var_88; SORT_5 var_105_arg_1 = var_22; SORT_5 var_105_arg_2 = state_53; SORT_5 var_105 = var_105_arg_0 ? var_105_arg_1 : var_105_arg_2; SORT_5 next_106_arg_1 = var_105; SORT_1 var_110_arg_0 = state_45; SORT_1 var_110_arg_1 = var_109; SORT_1 var_110 = var_110_arg_0 & var_110_arg_1; var_110 = var_110 & mask_SORT_1; SORT_1 var_111_arg_0 = var_110; SORT_1 var_111_arg_1 = var_109; SORT_5 var_111 = var_111_arg_0 == var_111_arg_1; SORT_1 var_108_arg_0 = state_45; SORT_1 var_108_arg_1 = state_47; SORT_1 var_108 = var_108_arg_0 + var_108_arg_1; var_108 = var_108 & mask_SORT_1; SORT_1 var_107_arg_0 = state_45; SORT_1 var_107_arg_1 = state_47; SORT_1 var_107 = var_107_arg_0 - var_107_arg_1; var_107 = var_107 & mask_SORT_1; SORT_5 var_112_arg_0 = var_111; SORT_1 var_112_arg_1 = var_108; SORT_1 var_112_arg_2 = var_107; SORT_1 var_112 = var_112_arg_0 ? var_112_arg_1 : var_112_arg_2; SORT_5 var_113_arg_0 = var_88; SORT_1 var_113_arg_1 = var_9; SORT_1 var_113_arg_2 = var_112; SORT_1 var_113 = var_113_arg_0 ? var_113_arg_1 : var_113_arg_2; SORT_1 next_114_arg_1 = var_113; SORT_5 var_115_arg_0 = var_76; SORT_1 var_115_arg_1 = var_9; SORT_1 var_115_arg_2 = input_2; SORT_1 var_115 = var_115_arg_0 ? var_115_arg_1 : var_115_arg_2; SORT_1 next_116_arg_1 = var_115; SORT_5 var_117_arg_0 = var_76; SORT_1 var_117_arg_1 = var_9; SORT_1 var_117_arg_2 = state_62; SORT_1 var_117 = var_117_arg_0 ? var_117_arg_1 : var_117_arg_2; SORT_1 next_118_arg_1 = var_117; SORT_5 var_119_arg_0 = var_76; SORT_1 var_119_arg_1 = var_9; SORT_1 var_119_arg_2 = input_3; SORT_1 var_119 = var_119_arg_0 ? var_119_arg_1 : var_119_arg_2; SORT_1 next_120_arg_1 = var_119; SORT_5 var_121_arg_0 = var_76; SORT_1 var_121_arg_1 = var_9; SORT_1 var_121_arg_2 = state_66; SORT_1 var_121 = var_121_arg_0 ? var_121_arg_1 : var_121_arg_2; SORT_1 next_122_arg_1 = var_121; SORT_5 var_123_arg_0 = var_76; SORT_1 var_123_arg_1 = var_9; SORT_1 var_123_arg_2 = input_4; SORT_1 var_123 = var_123_arg_0 ? var_123_arg_1 : var_123_arg_2; SORT_1 next_124_arg_1 = var_123; SORT_5 var_125_arg_0 = var_76; SORT_1 var_125_arg_1 = var_9; SORT_1 var_125_arg_2 = state_70; SORT_1 var_125 = var_125_arg_0 ? var_125_arg_1 : var_125_arg_2; SORT_1 next_126_arg_1 = var_125; // Assigning next states ... state_10 = next_78_arg_1; state_12 = next_80_arg_1; state_18 = next_82_arg_1; state_23 = next_84_arg_1; state_26 = next_90_arg_1; state_41 = next_92_arg_1; state_43 = next_94_arg_1; state_45 = next_96_arg_1; state_47 = next_98_arg_1; state_49 = next_100_arg_1; state_53 = next_102_arg_1; state_55 = next_104_arg_1; state_57 = next_106_arg_1; state_59 = next_114_arg_1; state_62 = next_116_arg_1; state_64 = next_118_arg_1; state_66 = next_120_arg_1; state_68 = next_122_arg_1; state_70 = next_124_arg_1; state_72 = next_126_arg_1; } return 0; }