Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

random traces: set random initial state #517

Merged
merged 1 commit into from
May 22, 2024
Merged

random traces: set random initial state #517

merged 1 commit into from
May 22, 2024

Conversation

kroening
Copy link
Member

Instead of relying on the user to initialize the state, we use random constraints.

@kroening kroening marked this pull request as ready for review May 21, 2024 10:20
auto symbol_in_timeframe = instantiate(symbol, 0, 1, ns);
auto constraint =
equal_exprt(symbol_in_timeframe, random_value(symbol.type()));
result.push_back(constraint);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit pick: could use std::move(constraint)

@@ -0,0 +1,10 @@
CORE
initial_state1.v
--random-trace --trace-steps 1 --numbered-trace
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest to either explicitly add --random-seed 0 as command line option or add a comment at the bottom that 0 is the default random seed. Else it is not that obvious that random traces will always produce those "random" initial states.

Instead of relying on the user to initialize the state, we use random
constraints.
@kroening kroening merged commit 44a1b82 into main May 22, 2024
5 checks passed
@kroening kroening deleted the random-initial branch May 22, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants