@@ -615,4 +615,34 @@ TEST_CASE(
615
615
foo_term, smt_array_theoryt::select (array_term, index_term))}};
616
616
REQUIRE (test.sent_commands == expected_commands);
617
617
}
618
+ SECTION (" array_of_exprt - all elements set to a given value" )
619
+ {
620
+ const array_of_exprt array_of_expr{
621
+ from_integer (42 , value_type), array_type};
622
+ test.sent_commands .clear ();
623
+ test.procedure .set_to (
624
+ equal_exprt{
625
+ foo.symbol_expr (), index_exprt{array_of_expr, index.symbol_expr ()}},
626
+ true );
627
+ const auto foo_term = smt_identifier_termt{" foo" , smt_bit_vector_sortt{8 }};
628
+ const auto array_term = smt_identifier_termt{
629
+ " array_0" ,
630
+ smt_array_sortt{smt_bit_vector_sortt{32 }, smt_bit_vector_sortt{8 }}};
631
+ const auto index_term =
632
+ smt_identifier_termt{" index" , smt_bit_vector_sortt{32 }};
633
+ const auto forall_term =
634
+ smt_identifier_termt{" array_0_index" , smt_bit_vector_sortt{32 }};
635
+ const std::vector<smt_commandt> expected_commands{
636
+ smt_declare_function_commandt{foo_term, {}},
637
+ smt_declare_function_commandt{array_term, {}},
638
+ smt_assert_commandt{smt_forall_termt{
639
+ {forall_term},
640
+ smt_core_theoryt::equal (
641
+ smt_array_theoryt::select (array_term, forall_term),
642
+ smt_bit_vector_constant_termt{42 , 8 })}},
643
+ smt_declare_function_commandt{index_term, {}},
644
+ smt_assert_commandt{smt_core_theoryt::equal (
645
+ foo_term, smt_array_theoryt::select (array_term, index_term))}};
646
+ REQUIRE (test.sent_commands == expected_commands);
647
+ }
618
648
}
0 commit comments