3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-06-01 06:37:49 +00:00

Readded depth limit

This commit is contained in:
CEisenhofer 2026-03-26 11:30:54 +01:00
parent fa4cd37c07
commit 17ca44b351
2 changed files with 11 additions and 4 deletions

View file

@ -1380,10 +1380,15 @@ namespace seq {
} }
} }
nielsen_graph::search_result nielsen_graph::search_dfs(nielsen_node* node, ptr_vector<nielsen_edge>& cur_path) { nielsen_graph::search_result nielsen_graph::search_dfs(nielsen_node* node,
ptr_vector<nielsen_edge>& cur_path, unsigned depth) {
++m_stats.m_num_dfs_nodes; ++m_stats.m_num_dfs_nodes;
// std::cout << m_stats.m_num_dfs_nodes << std::endl; // std::cout << m_stats.m_num_dfs_nodes << std::endl;
auto depth = cur_path.size(); // depth is NOT necessarily the length of the path
// Reason: Progress nodes are not counted towards the depth limit
// Otw. problems with a lot of variables would barely terminate
SASSERT(depth <= cur_path.size());
m_stats.m_max_depth = std::max(m_stats.m_max_depth, depth); m_stats.m_max_depth = std::max(m_stats.m_max_depth, depth);
// check for external cancellation (timeout, user interrupt) // check for external cancellation (timeout, user interrupt)
@ -1507,7 +1512,9 @@ namespace seq {
// Bump modification counts for the child's context. // Bump modification counts for the child's context.
inc_edge_mod_counts(e); inc_edge_mod_counts(e);
const search_result r = search_dfs(e->tgt(), cur_path); const search_result r = search_dfs(e->tgt(), cur_path,
e->is_progress() ? depth : (depth + 1)
);
// Restore modification counts on backtrack. // Restore modification counts on backtrack.
dec_edge_mod_counts(e); dec_edge_mod_counts(e);

View file

@ -939,7 +939,7 @@ namespace seq {
// collect dependency information from conflicting constraints // collect dependency information from conflicting constraints
dep_tracker collect_conflict_deps() const; dep_tracker collect_conflict_deps() const;
search_result search_dfs(nielsen_node *node, ptr_vector<nielsen_edge>& path); search_result search_dfs(nielsen_node *node, ptr_vector<nielsen_edge>& path, unsigned depth = 0);
// Regex widening: overapproximate `str` by replacing variables with // Regex widening: overapproximate `str` by replacing variables with
// the intersection of their primitive regex constraints (or Σ* if // the intersection of their primitive regex constraints (or Σ* if