Giter Site home page Giter Site logo

dafny-vmc's People

Contributors

barghouthi avatar fzaiser avatar jtristan avatar stefan-aws avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dafny-vmc's Issues

Simplify the definition of UniformPowerOfTwo model

I believe the current definition of UniformPowerOfTwo.Model.Sample is suboptimal and makes the proofs around it more painful than they'd have to be. Currently the correctness predicate has the precondition (n == 0 && k == 0) || (k != 0 && Helper.Power(2, k - 1) <= n < Helper.Power(2, k)), which is annoying because of the case split and (I believe) because of this we have the weird Helper.Log2 which computes something slightly different from the actual log2.
Instead I think it would be better if Sample were defined as follows:

function Sample(n: nat): Monad.Hurd<nat>
  requires n >= 1
{
  if n == 1 then Monad.Return(0) else Monad.Bind(Sample(n/2), UnifStep)
}

Then the correctness predicate would have the precondition Helper.Power(2, k) <= n < Helper.Power(2, k + 1) and the result range of return values m would be 0 <= m < Helper.Power(2, k). Then k would be the actual logarithm of base 2 rounded down. I think this would be much cleaner because it avoids the extra case split and the - 1 in the exponent, which could a priori lead to negative numbers and has to be proved impossible.

C# code potentially insecure?

I noticed that Java uses SecureRandom, but C# just Random. We should look into whether Random is actually secure enough in C#.

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.