remove parity_product and parity_product_or
* NEWS: document it * spot/twaalgos/parity.cc, spot/twaalgos/parity.hh, tests/core/parity.cc: here
This commit is contained in:
parent
8120587fbf
commit
1aaeccf1d3
4 changed files with 4 additions and 451 deletions
|
|
@ -385,75 +385,5 @@ int main()
|
|||
}
|
||||
}
|
||||
|
||||
std::random_shuffle(automata_tuples.begin(), automata_tuples.end());
|
||||
unsigned num_left = 15;
|
||||
unsigned num_right = 15;
|
||||
unsigned acc_index = 0;
|
||||
|
||||
unsigned nb = 0;
|
||||
// Parity product and sum
|
||||
for (unsigned left_index = 0; left_index < num_left; ++left_index)
|
||||
{
|
||||
auto& aut_tuple_first = automata_tuples[left_index % num_automata];
|
||||
auto& left = aut_tuple_first.first;
|
||||
auto aut_num_sets_first = aut_tuple_first.second;
|
||||
while (std::get<3>(acceptance_sets[acc_index]) < aut_num_sets_first)
|
||||
acc_index = (acc_index + 1) % num_acceptance;
|
||||
auto acc_tuple_first = acceptance_sets[acc_index];
|
||||
acc_index = (acc_index + 1) % num_acceptance;
|
||||
auto acc_first = std::get<0>(acc_tuple_first);
|
||||
auto acc_num_sets_first = std::get<3>(acc_tuple_first);
|
||||
left->set_acceptance(acc_num_sets_first, acc_first);
|
||||
for (unsigned right_index = 0; right_index < num_right; ++right_index)
|
||||
{
|
||||
auto& aut_tuple_second =
|
||||
automata_tuples[(num_left + right_index) % num_automata];
|
||||
auto& right = aut_tuple_second.first;
|
||||
auto aut_num_sets_second = aut_tuple_second.second;
|
||||
while (std::get<3>(acceptance_sets[acc_index]) < aut_num_sets_second)
|
||||
acc_index = (acc_index + 1) % num_acceptance;
|
||||
auto acc_tuple_second = acceptance_sets[acc_index];
|
||||
acc_index = (acc_index + 1) % num_acceptance;
|
||||
auto acc_second = std::get<0>(acc_tuple_second);
|
||||
auto acc_num_sets_second = std::get<3>(acc_tuple_second);
|
||||
right->set_acceptance(acc_num_sets_second, acc_second);
|
||||
auto result_prod = spot::parity_product(left, right);
|
||||
auto ref_prod = spot::product(left, right);
|
||||
if (!are_equiv(result_prod, ref_prod))
|
||||
{
|
||||
std::cerr << nb << ": parity_product: Not equivalent.\n"
|
||||
<< "=====First Automaton=====\n";
|
||||
spot::print_hoa(std::cerr, left);
|
||||
std::cerr << "=====Second Automaton=====\n";
|
||||
spot::print_hoa(std::cerr, right);
|
||||
assert(false && "parity_product: Not equivalent.\n");
|
||||
}
|
||||
assert(is_colored_printerr(result_prod)
|
||||
&& "parity_product: not colored.");
|
||||
assert(is_right_parity(result_prod, spot::parity_kind_any,
|
||||
spot::parity_style_any,
|
||||
true, true, 2)
|
||||
&& "parity_product: not a parity acceptance condition");
|
||||
|
||||
auto result_sum = spot::parity_product_or(left, right);
|
||||
auto ref_sum = spot::product_or(left, right);
|
||||
if (!are_equiv(result_sum, ref_sum))
|
||||
{
|
||||
std::cerr << nb << ": parity_product_or: Not equivalent.\n"
|
||||
<< "=====First Automaton=====\n";
|
||||
spot::print_hoa(std::cerr, left);
|
||||
std::cerr << "=====Second Automaton=====\n";
|
||||
spot::print_hoa(std::cerr, right);
|
||||
assert(false && "parity_product_or: Not equivalent.\n");
|
||||
}
|
||||
assert(is_colored_printerr(result_sum)
|
||||
&& "parity_product_or: not colored.");
|
||||
assert(is_right_parity(result_sum, spot::parity_kind_any,
|
||||
spot::parity_style_any,
|
||||
true, true, 2)
|
||||
&& "parity_product_or: not a parity acceptance condition");
|
||||
++nb;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue