|
30 | 30 | #include <goto-symex/path_storage.h>
|
31 | 31 | #include <solvers/smt2_incremental/smt_to_smt2_string.h>
|
32 | 32 |
|
| 33 | +#include "string_constant.h" |
| 34 | + |
33 | 35 | #include <deque>
|
34 | 36 |
|
35 | 37 | class analysis_execption_with_messaget
|
@@ -683,6 +685,53 @@ TEST_CASE(
|
683 | 685 | }
|
684 | 686 | }
|
685 | 687 |
|
| 688 | +TEST_CASE( |
| 689 | + "smt2_incremental_decision_proceduret string literal commands.", |
| 690 | + "[core][smt2_incremental]") |
| 691 | +{ |
| 692 | + auto test = decision_procedure_test_environmentt::make(); |
| 693 | + const string_constantt constant{"Chips"}; |
| 694 | + const typet array_type = constant.to_array_expr().type(); |
| 695 | + const symbolt fish{"fish", array_type, ID_C}; |
| 696 | + test.symbol_table.insert(fish); |
| 697 | + test.sent_commands.clear(); |
| 698 | + test.procedure.set_to(equal_exprt{fish.symbol_expr(), constant}, true); |
| 699 | + const smt_array_sortt expected_sort{ |
| 700 | + smt_bit_vector_sortt{32}, smt_bit_vector_sortt{8}}; |
| 701 | + const smt_identifier_termt expected_fish{"fish", expected_sort}; |
| 702 | + const smt_identifier_termt expected_chips{"array_0", expected_sort}; |
| 703 | + const std::vector<smt_commandt> expected_commands{ |
| 704 | + smt_declare_function_commandt{expected_fish, {}}, |
| 705 | + smt_declare_function_commandt{expected_chips, {}}, |
| 706 | + smt_assert_commandt{smt_core_theoryt::equal( |
| 707 | + smt_array_theoryt::select( |
| 708 | + expected_chips, smt_bit_vector_constant_termt{0, 32}), |
| 709 | + smt_bit_vector_constant_termt{'C', 8})}, |
| 710 | + smt_assert_commandt{smt_core_theoryt::equal( |
| 711 | + smt_array_theoryt::select( |
| 712 | + expected_chips, smt_bit_vector_constant_termt{1, 32}), |
| 713 | + smt_bit_vector_constant_termt{'h', 8})}, |
| 714 | + smt_assert_commandt{smt_core_theoryt::equal( |
| 715 | + smt_array_theoryt::select( |
| 716 | + expected_chips, smt_bit_vector_constant_termt{2, 32}), |
| 717 | + smt_bit_vector_constant_termt{'i', 8})}, |
| 718 | + smt_assert_commandt{smt_core_theoryt::equal( |
| 719 | + smt_array_theoryt::select( |
| 720 | + expected_chips, smt_bit_vector_constant_termt{3, 32}), |
| 721 | + smt_bit_vector_constant_termt{'p', 8})}, |
| 722 | + smt_assert_commandt{smt_core_theoryt::equal( |
| 723 | + smt_array_theoryt::select( |
| 724 | + expected_chips, smt_bit_vector_constant_termt{4, 32}), |
| 725 | + smt_bit_vector_constant_termt{'s', 8})}, |
| 726 | + smt_assert_commandt{smt_core_theoryt::equal( |
| 727 | + smt_array_theoryt::select( |
| 728 | + expected_chips, smt_bit_vector_constant_termt{5, 32}), |
| 729 | + smt_bit_vector_constant_termt{'\0', 8})}, |
| 730 | + smt_assert_commandt{ |
| 731 | + smt_core_theoryt::equal(expected_fish, expected_chips)}}; |
| 732 | + REQUIRE(test.sent_commands == expected_commands); |
| 733 | +} |
| 734 | + |
686 | 735 | TEST_CASE(
|
687 | 736 | "smt2_incremental_decision_proceduret multi-ary with_exprt introduces "
|
688 | 737 | "correct number of indexes.",
|
|
0 commit comments