Skip to content

Use signed types for signed scalars - #1063

Merged
adpaco merged 2 commits into
model-checking:mainfrom
adpaco:constants-too-large
Apr 19, 2022
Merged

adpaco merged 2 commits into
model-checking:mainfrom
adpaco:constants-too-large

Conversation

@adpaco

@adpaco adpaco commented Apr 18, 2022

Copy link
Copy Markdown
Contributor

Description of changes:

I've debugged #996 and there are multiple causes:

  1. The creation of unsigned integer constants to encode signed scalars.
  2. The creation of unsigned integer constants for setting a discriminant.
  3. Something else?

This PR is the first step towards #996 by using signed integers to encode signed scalars. My guess is that the sign was stored somewhere else in previous versions, but this is not needed anymore.

In regards to (2), I was able to find the issue but I don't know what's the best approach to solve it.

With these changes, the assertion in cprover_bindings/src/irep/irep_id.rs:843 results in the following failures:

    [kani] kani/Cast/main.rs
    [kani] kani/CopyIntrinsics/main.rs
    [kani] kani/Enum/neg_discriminant.rs
    [kani] kani/Invariants/enum.rs
    [kani] kani/LexicographicCmp/main.rs
    [kani] kani/Vectors/push_u8.rs
    [kani] kani/Vectors/vector_extend.rs
    [kani] kani/Vectors/vector_extend_in_new.rs
    [kani] kani/Vectors/vector_extend_loop.rs
    [kani] kani/VolatileIntrinsics/main.rs

Resolved issues:

Towards #996

Testing:

  • How is this change tested? Existing regression.

  • Is this a refactor change? No.

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@adpaco
adpaco requested a review from a team as a code owner April 18, 2022 21:59

@zhassan-aws zhassan-aws left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Fix the comment

@danielsn

Copy link
Copy Markdown
Contributor

LGTM, modulo a small comment

@adpaco
adpaco force-pushed the constants-too-large branch from 5d95299 to f463b95 Compare April 19, 2022 13:10
@adpaco
adpaco force-pushed the constants-too-large branch from f463b95 to c4d3243 Compare April 19, 2022 13:10
@adpaco
adpaco merged commit 02bd3ca into model-checking:main Apr 19, 2022
tedinski pushed a commit to tedinski/rmc that referenced this pull request Apr 26, 2022
* Use signed types for signed scalars

* Remove outdated comment
tedinski pushed a commit that referenced this pull request Apr 27, 2022
* Use signed types for signed scalars

* Remove outdated comment
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