File tree Expand file tree Collapse file tree 4 files changed +32
-3
lines changed Expand file tree Collapse file tree 4 files changed +32
-3
lines changed Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ struct test
4+ {
5+ unsigned int a ;
6+ unsigned int b ;
7+ };
8+
9+ int main ()
10+ {
11+ struct test t ;
12+ if (t .a > 10 )
13+ assert (t .a > 0 );
14+ }
Original file line number Diff line number Diff line change 1+ CORE
2+ main.c
3+ --trace --z3
4+ ^EXIT=0$
5+ ^SIGNAL=0$
6+ ^VERIFICATION SUCCESSFUL$
7+ --
8+ ^map::at:
9+ key not found
10+ --
11+ This test checks the encoding of C `struct`s using SMT2 data types.
Original file line number Diff line number Diff line change @@ -4890,8 +4890,10 @@ void smt2_convt::find_symbols_rec(
48904890
48914891 if (recstack.find (id) == recstack.end ())
48924892 {
4893+ const auto &base_struct = ns.follow_tag (struct_tag);
48934894 recstack.insert (id);
4894- find_symbols_rec (ns.follow_tag (struct_tag), recstack);
4895+ find_symbols_rec (base_struct, recstack);
4896+ datatype_map[type] = datatype_map[base_struct];
48954897 }
48964898 }
48974899 else if (type.id () == ID_union_tag)
Original file line number Diff line number Diff line change @@ -209,8 +209,10 @@ class smt2_convt : public stack_decision_proceduret
209209
210210 identifier_mapt identifier_map;
211211
212- // for modeling structs as Z3 datatype, enabled when
213- // use_datatype is set
212+ // for modeling structs as SMT datatype when use_datatype is set
213+ //
214+ // it maintains a map of `struct_typet` or `struct_tag_typet`
215+ // to datatype names declared in SMT
214216 typedef std::map<typet, std::string> datatype_mapt;
215217 datatype_mapt datatype_map;
216218
You can’t perform that action at this time.
0 commit comments