Skip to content

Skip simple nondet initialization for arrays of bool #3827

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

Merged
merged 1 commit into from
Jan 18, 2019

Conversation

allredj
Copy link
Contributor

@allredj allredj commented Jan 17, 2019

Nondeterministic arrays of Booleans must go through cell-wise initialization, because they are treated in a special way to cope with the discrepancy between the Java representation of Bools (as bytes) and the solver representation (as single bit literals).

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • White-space or formatting changes outside the feature-related changed lines are in commits of their own.

Nondeterministic arrays of Booleans must go through cell-wise
initialization, because they are treated in a special way to cope with
the discrepancy between the Java representation of Bools (as bytes) and
the solver representation (as single bit literals).
Copy link
Contributor

@smowton smowton left a comment

Choose a reason for hiding this comment

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

Makes sense except the comment should clarify we're talking about primitive bools.

@@ -1441,6 +1441,9 @@ void java_object_factoryt::gen_nondet_array_init(
else
{
// Arrays of primitive types can be initialized with a single instruction
// We don't do this for arrays of Booleans, because Bools are represented
Copy link
Contributor

Choose a reason for hiding this comment

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

These are bools not Booleans (i.e. we're talking about the primitive type)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yes, I wanted to sound smart by correctly capitalising Boolean, but then of course we can confuse it with Boolean objects. Good catch. Since this is blocking TG, I will leave it as it is and do a PR on top of that to correct the typo.

Copy link
Contributor Author

@allredj allredj left a comment

Choose a reason for hiding this comment

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

🚫
This PR failed Diffblue compatibility checks (cbmc commit: 0304c32).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/97697479
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.

Common spurious failures:

  • the cbmc commit has disappeared in the mean time (e.g. in a force-push)
  • the author is not in the list of contributors (e.g. first-time contributors).

The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.

@allredj allredj merged commit dcbda65 into diffblue:develop Jan 18, 2019
@allredj
Copy link
Contributor Author

allredj commented Jan 18, 2019

test-gen/develop is momentarily pointing to this branch. DON'T DELETE

@allredj allredj deleted the disable-loopless-init-for-bool branch March 29, 2019 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants