Git Product home page Git Product logo

Comments (4)

fpoli avatar fpoli commented on May 20, 2024

Prusti no longer crashes, and the output is now the following:

error: [Prusti: unsupported feature] the encoding of this reference copy has not been implemented
  --> tmp/program.rs:34:16
   |
34 |     set.remove(&3);
   |                ^^

error: [Prusti internal error] generating fold-unfold Viper statements failed (FailedToObtain(Pred(Local(_2: Ref(__TYPARAM__$T$__), Position { line: 18, column: 15, id: 168 }), read)))
  --> tmp/program.rs:19:5
   |
19 | /     pub fn insert(&mut self, value: T) {
20 | |         self.set.insert(value);
21 | |     }
   | |_____^

error: [Prusti: verification error] postcondition might not hold.
  --> tmp/program.rs:23:15
   |
23 |     #[ensures(!self.contains(&value))]
   |               ^^^^^^^^^^^^^^^^^^^^^^
   |
note: the error originates here
  --> tmp/program.rs:24:5
   |
24 | /     pub fn remove(&mut self, value: &T) -> bool {
25 | |         self.set.remove(value)
26 | |     }
   | |_____^

The "Prusti internal error" is still a bug.

from prusti-dev.

fpoli avatar fpoli commented on May 20, 2024

The contract of insert is problematic: we would like to express #[ensures(self.contains(&old(value)))], but since value is of a generic type then old(value) raises an internal error. This should be fixed by #187.

from prusti-dev.

fpoli avatar fpoli commented on May 20, 2024

Related to #418

from prusti-dev.

Aurel300 avatar Aurel300 commented on May 20, 2024

Things work here except for the constants like &3. The workaround is to put the constant into a variable, then reference that variable.

from prusti-dev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.