Skip to content

Add support for Reals#119

Merged
JonasAlaif merged 31 commits intoAurel300:rewrite-2023from
ThomasMayerl:prusti-reals
Jan 27, 2026
Merged

Add support for Reals#119
JonasAlaif merged 31 commits intoAurel300:rewrite-2023from
ThomasMayerl:prusti-reals

Conversation

@ThomasMayerl
Copy link
Copy Markdown

This PR adds support for Reals to Prusti with support for all of the operation on Reals that SMTLIB exposes. I also created tests for these operations.

Comment thread prusti-contracts/prusti-contracts/src/lib.rs Outdated
Comment thread prusti-encoder/src/encoders/ty/rust_ty.rs Outdated
Comment thread prusti-encoder/src/encoders/mir_pure.rs Outdated
Copy link
Copy Markdown
Collaborator

@JonasAlaif JonasAlaif left a comment

Choose a reason for hiding this comment

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

Mostly tiny cosmetic/style changes

Comment thread prusti-encoder/src/encoders/ty/rust_ty.rs Outdated
Comment thread prusti-encoder/src/encoders/mir_pure.rs Outdated
Comment thread prusti-interface/src/environment/query.rs Outdated
Comment thread prusti-encoder/src/encoders/ty/rust_ty.rs Outdated
Comment thread prusti-encoder/src/encoders/ty/rust_ty.rs Outdated
@Aurel300
Copy link
Copy Markdown
Owner

@ThomasMayerl It seems there's two new failures compared to the main branch?

  • tests/verify/pass/equality/pure-post-5.rs - this now reaches unreachable.
  • tests/verify/pass/floats/reals.rs - there are now some failing cases here, too. This might be related to the float changes from Update Viper toolchain to 2025-11-19 #125 though.

@ThomasMayerl
Copy link
Copy Markdown
Author

Regarding this, two testcases in this file are currently failing because the current z3 versions seem to not be able to reason about that somehow. I've opened a z3 issue but haven't gotten a reply yet. @JonasAlaif said it's still okay for Prusti as long as it generates correct code since it's nothing that we can fix

@ThomasMayerl
Copy link
Copy Markdown
Author

  • tests/verify/pass/equality/pure-post-5.rs - this now reaches unreachable.

As for this, I tried to analyze this a bit and here is what I found out: I had to switch the check for function calls whether the function call is pure or a builtin so that it checks the builtin first (because some of the Real's builtins are also pure). However, if you call find_impl_of_trait_method_call (to check if it's a builtin) for the pure-post-5.rs testcase, an unreachable is reached. As I did not change that function, I think that the issue does not come from this PR but rather already existed previously and that the error was just not triggered

Comment thread prusti-interface/src/environment/query.rs Outdated
@ThomasMayerl ThomasMayerl requested a review from Aurel300 January 27, 2026 08:42
@JonasAlaif JonasAlaif merged commit 205e55f into Aurel300:rewrite-2023 Jan 27, 2026
5 of 7 checks passed
@Aurel300 Aurel300 mentioned this pull request Mar 12, 2026
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