Skip to content

Commit 18b8089

Browse files
Revert "remove unused random seed parameter on cmd_context"
This reverts commit e2a9cb8.
1 parent 4faaff5 commit 18b8089

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

src/cmd_context/basic_cmds.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ class set_get_option_cmd : public cmd {
323323
symbol m_produce_assertions;
324324
symbol m_regular_output_channel;
325325
symbol m_diagnostic_output_channel;
326+
symbol m_random_seed;
326327
symbol m_verbosity;
327328
symbol m_global_decls;
328329
symbol m_global_declarations;
@@ -337,7 +338,7 @@ class set_get_option_cmd : public cmd {
337338
s == m_interactive_mode || s == m_produce_proofs || s == m_produce_unsat_cores || s == m_produce_unsat_assumptions ||
338339
s == m_produce_models || s == m_produce_assignments ||
339340
s == m_regular_output_channel || s == m_diagnostic_output_channel ||
340-
s == m_verbosity || s == m_global_decls || s == m_global_declarations ||
341+
s == m_random_seed || s == m_verbosity || s == m_global_decls || s == m_global_declarations ||
341342
s == m_produce_assertions || s == m_reproducible_resource_limit;
342343
}
343344

@@ -358,6 +359,7 @@ class set_get_option_cmd : public cmd {
358359
m_produce_assertions(":produce-assertions"),
359360
m_regular_output_channel(":regular-output-channel"),
360361
m_diagnostic_output_channel(":diagnostic-output-channel"),
362+
m_random_seed(":random-seed"),
361363
m_verbosity(":verbosity"),
362364
m_global_decls(":global-decls"),
363365
m_global_declarations(":global-declarations"),
@@ -501,7 +503,10 @@ class set_option_cmd : public set_get_option_cmd {
501503
}
502504

503505
void set_next_arg(cmd_context & ctx, rational const & val) override {
504-
if (m_option == m_reproducible_resource_limit) {
506+
if (m_option == m_random_seed) {
507+
ctx.set_random_seed(to_unsigned(val));
508+
}
509+
else if (m_option == m_reproducible_resource_limit) {
505510
ctx.params().set_rlimit(to_unsigned(val));
506511
}
507512
else if (m_option == m_verbosity) {
@@ -589,6 +594,9 @@ class get_option_cmd : public set_get_option_cmd {
589594
else if (opt == m_global_decls || opt == m_global_declarations) {
590595
print_bool(ctx, ctx.global_decls());
591596
}
597+
else if (opt == m_random_seed) {
598+
print_unsigned(ctx, ctx.random_seed());
599+
}
592600
else if (opt == m_verbosity) {
593601
print_unsigned(ctx, get_verbosity_level());
594602
}

src/cmd_context/cmd_context.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ cmd_context::cmd_context(bool main_ctx, ast_manager * m, symbol const & l):
466466
m_interactive_mode(false),
467467
m_global_decls(false),
468468
m_print_success(m_params.m_smtlib2_compliant),
469+
m_random_seed(0),
469470
m_produce_unsat_cores(false),
470471
m_produce_unsat_assumptions(false),
471472
m_produce_assignments(false),

src/cmd_context/cmd_context.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ class cmd_context : public progress_callback, public tactic_manager, public ast_
185185
bool m_interactive_mode;
186186
bool m_global_decls;
187187
bool m_print_success;
188+
unsigned m_random_seed;
188189
bool m_produce_unsat_cores;
189190
bool m_produce_unsat_assumptions;
190191
bool m_produce_assignments;
@@ -336,6 +337,8 @@ class cmd_context : public progress_callback, public tactic_manager, public ast_
336337
void print_unsupported(symbol const & s, int line, int pos) { print_unsupported_msg(); print_unsupported_info(s, line, pos); }
337338
bool global_decls() const { return m_global_decls; }
338339
void set_global_decls(bool flag) { SASSERT(!has_manager()); m_global_decls = flag; }
340+
unsigned random_seed() const { return m_random_seed; }
341+
void set_random_seed(unsigned s) { m_random_seed = s; }
339342
bool produce_models() const;
340343
bool produce_proofs() const;
341344
bool produce_unsat_cores() const;

0 commit comments

Comments
 (0)