3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-08-03 04:33:28 +00:00

Add global suppress_platform_verbose parameter (#10319)

## Summary

Adds a global configuration parameter **`suppress_platform_verbose`**
(bool, default `false`).

When set to `true`, memory and time information is suppressed from
verbose output — the same behavior as the `-V` flag proposed in #10301,
but driven by a global parameter instead of a dedicated command-line
switch. This yields deterministic, platform-independent verbose output
that is useful for testing and diffing.

Usage:
```
z3 -v:2 suppress_platform_verbose=true problem.smt2
```

## Approach

Instead of introducing a `-V` command-line flag (#10301), this registers
`suppress_platform_verbose` as a global parameter via `env_params`,
wired to a lightweight `get_suppress_platform_verbose()` flag in `util`.

Verbose output sites guard only their **memory** (`mem_stat`) and
**time** (`m_watch` / `:time` / `:before-memory` / `:after-memory`)
fields on this flag. Platform-independent counters (e.g. `:cost`,
`:threshold`, `:elim-vars`) are always emitted.

Affected sites:
- SAT: asymm-branch, probing, scc, simplifier (subsumer /
blocked-clauses / resolution), solver stats (`sat.stats`, `:memory`,
`mk_stat`)
- SMT: context stats (`smt.stats`)
- Tactic report (`:time`, `:before-memory`, `:after-memory`)

## Validation

- Release build succeeds.
- `suppress_platform_verbose` appears in `z3 -pd` with the correct
type/default, and is accepted on the command line.
- All 93 `test-z3 /a` unit tests pass.

Closes the need for the `-V` switch in #10301.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 57b9b87e-950a-49ea-bbb3-ed585646a5a9
This commit is contained in:
Nikolaj Bjorner 2026-07-30 20:08:25 -07:00 committed by GitHub
parent bffbe2475f
commit 87551f2bb0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 69 additions and 25 deletions

View file

@ -25,6 +25,7 @@ Notes:
void env_params::updt_params() {
params_ref const& p = gparams::get_ref();
set_verbosity_level(p.get_uint("verbose", get_verbosity_level()));
set_suppress_platform_verbose(p.get_bool("suppress_platform_verbose", get_suppress_platform_verbose()));
enable_warning_messages(p.get_bool("warning", true));
memory::set_max_size(megabytes_to_bytes(p.get_uint("memory_max_size", 0)));
memory::set_max_alloc_count(p.get_uint("memory_max_alloc_count", 0));
@ -36,6 +37,7 @@ void env_params::updt_params() {
void env_params::collect_param_descrs(param_descrs & d) {
d.insert("verbose", CPK_UINT, "be verbose, where the value is the verbosity level", "0");
d.insert("suppress_platform_verbose", CPK_BOOL, "suppress memory and time information from verbose output", "false");
d.insert("warning", CPK_BOOL, "enable/disable warning messages", "true");
d.insert("memory_max_size", CPK_UINT, "set hard upper limit for memory consumption (in megabytes), if 0 then there is no limit", "0");
d.insert("memory_max_alloc_count", CPK_UINT, "set hard upper limit for memory allocations, if 0 then there is no limit", "0");

View file

@ -30,6 +30,16 @@ unsigned get_verbosity_level() {
return g_verbosity_level;
}
static bool g_suppress_platform_verbose = false;
void set_suppress_platform_verbose(bool suppress) {
g_suppress_platform_verbose = suppress;
}
bool get_suppress_platform_verbose() {
return g_suppress_platform_verbose;
}
static std::ostream* g_verbose_stream = &std::cerr;
void set_verbose_stream(std::ostream& str) {

View file

@ -197,6 +197,8 @@ struct delete_proc {
void set_verbosity_level(unsigned lvl);
unsigned get_verbosity_level();
void set_suppress_platform_verbose(bool suppress);
bool get_suppress_platform_verbose();
std::ostream& verbose_stream();
void set_verbose_stream(std::ostream& str);