3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-08 18:31:49 +00:00
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2022-09-20 20:31:55 -07:00
parent 088898834c
commit 4518f4fe02

View file

@ -904,18 +904,16 @@ namespace datatype {
bool util::is_well_founded(unsigned num_types, sort* const* sorts) {
buffer<bool> well_founded(num_types, false);
obj_map<sort, unsigned> sort2id;
for (unsigned i = 0; i < num_types; ++i) {
for (unsigned i = 0; i < num_types; ++i)
sort2id.insert(sorts[i], i);
}
unsigned num_well_founded = 0, id = 0;
bool changed;
ptr_vector<sort> subsorts;
do {
changed = false;
for (unsigned tid = 0; tid < num_types; tid++) {
if (well_founded[tid]) {
if (well_founded[tid])
continue;
}
sort* s = sorts[tid];
def const& d = get_def(s);
for (constructor const* c : d) {
@ -923,9 +921,12 @@ namespace datatype {
subsorts.reset();
get_subsorts(a->range(), subsorts);
for (sort* srt : subsorts) {
if (sort2id.find(srt, id) && !well_founded[id]) {
goto next_constructor;
if (sort2id.find(srt, id)) {
if (!well_founded[id])
goto next_constructor;
}
else if (is_datatype(srt))
break;
}
}
changed = true;