mirror of
https://github.com/Z3Prover/z3
synced 2026-03-04 04:30:23 +00:00
Migrate iterator-based for loops to range-based for loops (#8231)
* Initial plan * Migrate iterator-based for loops to range-based for loops in 11 files Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Fix compilation error in aig_exporter.cpp - use correct iterator API Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> * Revert changes to z3++.h as requested Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
parent
58d3c29c9c
commit
eddb75b2e7
8 changed files with 33 additions and 57 deletions
|
|
@ -580,20 +580,19 @@ namespace datalog {
|
|||
scoped_ptr<rule_set> res = alloc(rule_set, m_context);
|
||||
bool done_something = false;
|
||||
|
||||
rule_set::iterator rend = rules->end();
|
||||
for (rule_set::iterator rit = rules->begin(); rit!=rend; ++rit) {
|
||||
rule_ref r(*rit, m_rm);
|
||||
for (rule* r : *rules) {
|
||||
rule_ref rl(r, m_rm);
|
||||
|
||||
rule_ref replacement(m_rm);
|
||||
while (r && do_eager_inlining(r, *rules, replacement)) {
|
||||
r = replacement;
|
||||
while (rl && do_eager_inlining(rl, *rules, replacement)) {
|
||||
rl = replacement;
|
||||
done_something = true;
|
||||
}
|
||||
|
||||
if (!r) {
|
||||
if (!rl) {
|
||||
continue;
|
||||
}
|
||||
res->add_rule(r);
|
||||
res->add_rule(rl);
|
||||
}
|
||||
if (done_something) {
|
||||
rules = res.detach();
|
||||
|
|
|
|||
|
|
@ -100,9 +100,7 @@ namespace datalog {
|
|||
//(discovering a total relation might reveal other total relations)
|
||||
do {
|
||||
new_discovered = false;
|
||||
rule_set::iterator rend = rules.end();
|
||||
for(rule_set::iterator rit = rules.begin(); rit!=rend; ++rit) {
|
||||
rule * r = *rit;
|
||||
for (rule* r : rules) {
|
||||
func_decl * head_pred = r->get_decl();
|
||||
if(is_total_rule(r) && !m_total_relations.contains(head_pred)) {
|
||||
on_discovered_total_relation(head_pred, r);
|
||||
|
|
@ -261,9 +259,7 @@ namespace datalog {
|
|||
|
||||
func_decl_set const& candidate_preds = m_context.get_predicates();
|
||||
|
||||
func_decl_set::iterator end = candidate_preds.end();
|
||||
for(func_decl_set::iterator it = candidate_preds.begin(); it!=end; ++it) {
|
||||
func_decl * pred = *it;
|
||||
for (func_decl* pred : candidate_preds) {
|
||||
unsigned rel_sz;
|
||||
|
||||
if (m_total_relations.contains(pred)) { continue; } // already total
|
||||
|
|
@ -306,9 +302,7 @@ namespace datalog {
|
|||
|
||||
void mk_subsumption_checker::collect_ground_unconditional_rule_heads(const rule_set & rules)
|
||||
{
|
||||
rule_set::iterator rend = rules.end();
|
||||
for(rule_set::iterator rit = rules.begin(); rit!=rend; ++rit) {
|
||||
rule * r = *rit;
|
||||
for (rule* r : rules) {
|
||||
func_decl * pred = r->get_decl();
|
||||
|
||||
if(r->get_tail_size()!=0) { continue; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue