-
Notifications
You must be signed in to change notification settings - Fork 102
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
unregistered verification error: [application.precondition:insufficient.permission; 0] #729
Comments
I believe this is an instance of #364: the postcondition requires A temporary workaround should be to move |
Thanks for the suggested work-around, that works nicely :) The only change I had to make was: #[pure]
pub const fn len(&self) -> usize {
self.inner.len()
}
#[pure]
#[ensures(forall(|i: usize| (result && index < self.len() && 0 <= i && i <= index) ==> (self.is_valid(i))) )]
pub fn test(&self, index: usize) -> bool { /* ... */ } // function body remained unchanged Would it be helpful if I add the failing example program to |
Yes, thanks. Since we decided to have |
I gave a better look at this bug. It's not exactly an instance of #364. It turns out that the fold-unfold algorithm generates the correct expression, but then the |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I'm currently looking a bit deeper into this one :) At a high level the problem seems to be that there is an implication One idea I have to fix this is not to pull the I'm planning to skip folding the entire implication in this case, because there could be multiple implications inside a forall, which all could potentially use Thanks! |
@Pointerbender FYI: This should be fixed in my refactoring (by completely getting rid of the problematic code). However, I am currently blocked waiting for @Aurel300 to finish his refactoring… |
Thanks for the heads up! In that case I'll just apply a temporary hack on my local version of Prusti to disable moving out the |
@vakaras just in case, in the upcoming refactoring, were the only removed optimizations in the |
All code that works with expressions will be affected in some way. Also, some code that works with statements. |
The program in the first message now panics:
|
For now this panic can be worked around by commenting out this statement and compile a custom build of Prusti: prusti-dev/prusti-viper/src/encoder/mir/pure/pure_functions/interface.rs Lines 288 to 294 in 75c09b9
|
…roject#729 to pass; bump specs version
The below program outputs a rather mysterious error:
The full error message is "
unregistered verification error: [application.precondition:insufficient.permission; 0] Precondition of function snap$__$TY$__struct$m_A$Snap$struct$m_A might not hold. There might be insufficient permission to access struct$m_A(_old$pre$0)
". The error message seems similar to the one in #25, however that example differs in using mutable borrows instead of immutable borrows in this new example.The above example succeeds if the
#[ensures]
post-condition is removed. It looks like it is related to the universal quantifierforall
. In the resulting Viper program forA::test
, the relevant statements look like this (verification fails on the non-trivialassert
statement):Am I doing something wrong/unsupported, or could this be a bug? Thanks!
The text was updated successfully, but these errors were encountered: