3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-09 02:25:38 +00:00
z3/src/ast
Copilot 6c90b7ec3f
Add [[nodiscard]] to AST factory functions and modernize iterator loops (#8143)
* Initial plan

* Add [[nodiscard]] to AST factory functions and modernize iterator loops

- Added [[nodiscard]] attribute to key factory functions in ast.h:
  - All mk_app() variants for creating application nodes
  - All mk_func_decl() variants for creating function declarations
  - All mk_const() variants for creating constants
  - All mk_sort() variants for creating sorts
  - mk_var() for creating variables
  - mk_quantifier(), mk_forall(), mk_exists(), mk_lambda() for quantifiers
  - mk_label(), mk_pattern() and related functions

- Converted iterator loops to range-based for loops in:
  - src/util/region.cpp: pop_scope()
  - src/util/dec_ref_util.h: dec_ref_key_values(), dec_ref_keys(), dec_ref_values()
  - src/util/mpf.h: dispose()
  - src/util/numeral_buffer.h: reset()

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Modernize additional iterator loops to range-based for loops

- Converted iterator loops to range-based for loops in:
  - src/api/api_ast_map.cpp: Z3_ast_map_keys() and Z3_ast_map_to_string()
  - src/api/c++/z3++.h: optimize copy constructor and add() method
  - src/opt/wmax.cpp: mk_assumptions()

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Revert changes to z3++.h for C++ version compatibility

Revert the range-based for loop changes in src/api/c++/z3++.h to maintain
compatibility with older C++ versions that users may rely on. The C++ API
wrapper must support down-level C++ standards for backward compatibility.

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Trigger CI build

[skip ci] is not used to ensure CI runs

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
2026-01-11 09:58:25 -08:00
..
converters remove model converter operator on expr_ref& 2025-09-07 16:42:20 -07:00
euf fix build warnings 2025-11-26 09:43:52 -08:00
fpa fix #8097 2025-12-21 10:02:47 -08:00
macros Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
normal_forms fixing the order 2025-10-06 13:44:19 -07:00
pattern Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
proofs Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
rewriter fix #8109 2026-01-07 10:56:50 -08:00
simplifiers fix build warnings 2025-11-26 09:43:52 -08:00
sls check cancelation in invariant checker 2025-11-23 09:09:55 -08:00
substitution nits 2025-06-30 08:37:39 -07:00
act_cache.cpp
act_cache.h
arith_decl_plugin.cpp fix #8024 2025-11-16 10:08:21 -08:00
arith_decl_plugin.h fix #8024 2025-11-16 10:08:21 -08:00
array_decl_plugin.cpp remove set cardinality operators from array theory. Make final-check use priority levels 2025-11-26 15:35:19 -08:00
array_decl_plugin.h remove set cardinality operators from array theory. Make final-check use priority levels 2025-11-26 15:35:19 -08:00
array_peq.cpp code simplification 2025-02-18 19:07:58 -08:00
array_peq.h code simplification 2025-02-18 19:07:58 -08:00
ast.cpp turn on ho-matcher for completion 2025-07-07 14:08:51 +02:00
ast.h Add [[nodiscard]] to AST factory functions and modernize iterator loops (#8143) 2026-01-11 09:58:25 -08:00
ast_ll_pp.cpp added API to monitor clause inferences 2022-10-19 08:34:55 -07:00
ast_ll_pp.h remove '#include <iostream>' from headers and from unneeded places 2022-06-17 14:10:19 +01:00
ast_lt.cpp remove unnecessary parameter copies 2023-12-22 16:11:06 +00:00
ast_lt.h
ast_pp.h remove a few string copies 2023-12-20 16:55:09 +00:00
ast_pp_dot.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
ast_pp_dot.h remove '#include <iostream>' from headers and from unneeded places 2022-06-17 14:10:19 +01:00
ast_pp_util.cpp fixes to mbqi in the new core based on #6575 2023-02-10 16:56:06 -08:00
ast_pp_util.h wip - proof hints 2022-10-08 20:12:57 +02:00
ast_printer.cpp Remove empty leaf destructors. (#6211) 2022-07-30 10:07:03 +01:00
ast_printer.h Use = default for virtual constructors. 2022-08-05 18:11:46 +03:00
ast_smt2_pp.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
ast_smt2_pp.h #6555 2023-01-26 21:39:52 -08:00
ast_smt_pp.cpp fix #7331 2024-08-06 03:54:25 -07:00
ast_smt_pp.h
ast_trail.h remove default destructors 2024-10-02 22:20:12 +01:00
ast_translation.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
ast_translation.h
ast_util.cpp bug in flatten/and/or introduced when skipping sub-expressions 2021-12-22 07:43:37 -08:00
ast_util.h convert reduce-args to a simplifier 2023-01-28 20:12:14 -08:00
bv_decl_plugin.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
bv_decl_plugin.h fix #7572 and fix #7574 2025-03-07 10:46:29 -08:00
char_decl_plugin.cpp Typo Fixes (#6803) 2023-07-09 11:56:10 -07:00
char_decl_plugin.h Typo Fixes (#6803) 2023-07-09 11:56:10 -07:00
CMakeLists.txt QEL: Fast Approximated Quantifier Elimination (#6820) 2023-08-02 09:34:06 -07:00
cost_evaluator.cpp
cost_evaluator.h
datatype_decl_plugin.cpp fix build break introduced when adding support for polymorphic datatypes 2025-10-28 18:55:47 -07:00
datatype_decl_plugin.h Fix O(n²) performance issue in CLI datatype declaration processing (#7712) 2025-07-02 09:54:36 -07:00
decl_collector.cpp fixes to mbqi in the new core based on #6575 2023-02-10 16:56:06 -08:00
decl_collector.h fixes to mbqi in the new core based on #6575 2023-02-10 16:56:06 -08:00
display_dimacs.cpp fixes for #6577 2023-02-11 09:33:42 -08:00
display_dimacs.h
dl_decl_plugin.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
dl_decl_plugin.h Remove empty leaf destructors. (#6211) 2022-07-30 10:07:03 +01:00
expr2polynomial.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
expr2polynomial.h remove default destructors 2024-10-02 22:20:12 +01:00
expr2var.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
expr2var.h
expr_abstract.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
expr_abstract.h wip - throttle AC completion, enable congruences over bound bodies 2025-07-11 12:48:27 +02:00
expr_delta_pair.h
expr_functors.cpp
expr_functors.h Use = default for virtual constructors. 2022-08-05 18:11:46 +03:00
expr_map.cpp
expr_map.h
expr_stat.cpp
expr_stat.h
expr_substitution.cpp bugfix to elim_uncnstr to ensure nodes are created. Prepare smt_internalizer to replay unit literals 2024-12-04 15:32:15 -08:00
expr_substitution.h wip - testing solve-eqs2, added as tactic 2022-11-05 22:42:59 -07:00
for_each_ast.cpp
for_each_ast.h Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
for_each_expr.cpp remove unneeded iterator functions 2024-09-23 12:59:04 +01:00
for_each_expr.h remove unneeded iterator functions 2024-09-23 12:59:04 +01:00
format.cpp fix #6530 2023-01-10 13:43:17 -08:00
format.h
fpa_decl_plugin.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
fpa_decl_plugin.h remove default destructors 2024-10-02 22:20:12 +01:00
func_decl_dependencies.cpp
func_decl_dependencies.h
has_free_vars.cpp fixup std-order / inv-order 2024-10-03 19:35:16 -07:00
has_free_vars.h
is_variable_test.h
justified_expr.h move from justified_expr to dependent_expr by aligning datatypes 2025-01-22 11:46:10 -08:00
macro_substitution.cpp
macro_substitution.h
num_occurs.cpp
num_occurs.h
occurs.cpp AIX compat (#8113) 2026-01-05 07:23:05 -08:00
occurs.h #6805 2023-07-11 09:41:29 -07:00
pb_decl_plugin.cpp working on python make for arm 2022-04-07 13:36:23 +02:00
pb_decl_plugin.h Remove empty leaf destructors. (#6211) 2022-07-30 10:07:03 +01:00
polymorphism_inst.cpp fix #7049 2023-12-08 13:05:21 -08:00
polymorphism_inst.h wip - alpha support for polymorphism 2023-07-12 18:09:02 -07:00
polymorphism_util.cpp remove unnecessary parameter copies 2023-12-22 16:11:06 +00:00
polymorphism_util.h wip - alpha support for polymorphism 2023-07-12 18:09:02 -07:00
pp.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
pp.h
pp_params.pyg print lemmas2console faster 2023-03-20 17:07:04 +01:00
quantifier_stat.cpp
quantifier_stat.h
recfun_decl_plugin.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
recfun_decl_plugin.h remove default destructors 2024-10-02 22:20:12 +01:00
recurse_expr.h
recurse_expr_def.h
reg_decl_plugins.cpp
reg_decl_plugins.h
scoped_proof.h overhaul of proof format for new solver 2022-08-28 17:44:33 -07:00
seq_decl_plugin.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
seq_decl_plugin.h Performance improvements for seq-sls (#7519) 2025-01-21 08:01:59 -08:00
shared_occs.cpp
shared_occs.h cleanup 2022-11-24 22:46:35 +07:00
special_relations_decl_plugin.cpp add EUF plugin framework. 2023-11-30 13:58:30 -08:00
special_relations_decl_plugin.h add EUF plugin framework. 2023-11-30 13:58:30 -08:00
static_features.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
static_features.h disable new code until pre-condition gets fixed 2022-11-30 22:29:59 -08:00
used_symbols.h
used_vars.cpp
used_vars.h
value_generator.cpp Mark override methods appropriately. (#6207) 2022-07-29 23:29:15 +02:00
value_generator.h Use = default for virtual constructors. 2022-08-05 18:11:46 +03:00
well_sorted.cpp Centralize and document TRACE tags using X-macros (#7657) 2025-05-28 14:31:25 +01:00
well_sorted.h