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