@@ -40,6 +40,60 @@ TEST_CASE("SMT core theory implies.", "[core][smt2_incremental]")
40
40
CHECK_THROWS (smt_core_theoryt::implies (true_term, two));
41
41
}
42
42
43
+ TEST_CASE (" SMT core theory \" and\" ." , " [core][smt2_incremental]" )
44
+ {
45
+ const smt_bool_literal_termt true_term{true };
46
+ const smt_bool_literal_termt false_term{false };
47
+ const auto implies = smt_core_theoryt::make_and (true_term, false_term);
48
+ CHECK (implies.get_sort () == smt_bool_sortt{});
49
+ CHECK (
50
+ implies.function_identifier () ==
51
+ smt_identifier_termt{" and" , smt_bool_sortt{}});
52
+ REQUIRE (implies.arguments ().size () == 2 );
53
+ CHECK (implies.arguments ()[0 ].get () == true_term);
54
+ CHECK (implies.arguments ()[1 ].get () == false_term);
55
+ cbmc_invariants_should_throwt invariants_throw;
56
+ const smt_bit_vector_constant_termt two{2 , 8 };
57
+ CHECK_THROWS (smt_core_theoryt::make_and (two, false_term));
58
+ CHECK_THROWS (smt_core_theoryt::make_and (true_term, two));
59
+ }
60
+
61
+ TEST_CASE (" SMT core theory \" or\" ." , " [core][smt2_incremental]" )
62
+ {
63
+ const smt_bool_literal_termt true_term{true };
64
+ const smt_bool_literal_termt false_term{false };
65
+ const auto implies = smt_core_theoryt::make_or (true_term, false_term);
66
+ CHECK (implies.get_sort () == smt_bool_sortt{});
67
+ CHECK (
68
+ implies.function_identifier () ==
69
+ smt_identifier_termt{" or" , smt_bool_sortt{}});
70
+ REQUIRE (implies.arguments ().size () == 2 );
71
+ CHECK (implies.arguments ()[0 ].get () == true_term);
72
+ CHECK (implies.arguments ()[1 ].get () == false_term);
73
+ cbmc_invariants_should_throwt invariants_throw;
74
+ const smt_bit_vector_constant_termt two{2 , 8 };
75
+ CHECK_THROWS (smt_core_theoryt::make_or (two, false_term));
76
+ CHECK_THROWS (smt_core_theoryt::make_or (true_term, two));
77
+ }
78
+
79
+ TEST_CASE (" SMT core theory \" xor\" ." , " [core][smt2_incremental]" )
80
+ {
81
+ const smt_bool_literal_termt true_term{true };
82
+ const smt_bool_literal_termt false_term{false };
83
+ const auto implies = smt_core_theoryt::make_xor (true_term, false_term);
84
+ CHECK (implies.get_sort () == smt_bool_sortt{});
85
+ CHECK (
86
+ implies.function_identifier () ==
87
+ smt_identifier_termt{" xor" , smt_bool_sortt{}});
88
+ REQUIRE (implies.arguments ().size () == 2 );
89
+ CHECK (implies.arguments ()[0 ].get () == true_term);
90
+ CHECK (implies.arguments ()[1 ].get () == false_term);
91
+ cbmc_invariants_should_throwt invariants_throw;
92
+ const smt_bit_vector_constant_termt two{2 , 8 };
93
+ CHECK_THROWS (smt_core_theoryt::make_xor (two, false_term));
94
+ CHECK_THROWS (smt_core_theoryt::make_xor (true_term, two));
95
+ }
96
+
43
97
TEST_CASE (" SMT core theory \" =\" ." , " [core][smt2_incremental]" )
44
98
{
45
99
SECTION (" Bool sorted term comparison" )
0 commit comments