Git Product home page Git Product logo

Comments (4)

vprevosto avatar vprevosto commented on June 12, 2024

@jensgerlach @pbaudin @backtracking for comments

I'd rather leave them undefined (as they are for any invalid pointer), but if they are to be defined, I'd go for \base_addr(\null) == -1, as they are (or were) systems where 0 is a valid numeric address. There aren't any (valid) memory blocks of size 0, thus \block_length(\null) == 0 would be OK.

from acsl.

pbaudin avatar pbaudin commented on June 12, 2024

First point, \base_addr doesn't return a numerical value but a char* pointer:
\base_addr{L}(p): void* -> char*. It cannot be -1, perhaps (char*)-1. It seems to be a better choice than (char*)0:

Looking at the ACSL definition of \offset and \valid_read (in the same section than \base_addr)
the following values are consistent with \valid_read(\null)<==>\false:

  • \base_addr(\null) == char*(-1)
  • \block_length(\null)==0
  • \offset(\null) == 1
    what ever is the positive or null value of sizeof(void*).

Choosing \base_addr(\null) = (char*)0 = \null gives \offset(null)==0. To ensures \valid_read(\null)<==>\false, the following constraint sizeof(void*)>0 has be to true! It is not a good choice to get such a constraint. I won't be able to infer that and rather prefer to keep sizeof(void*) completely undefined.

from acsl.

pbaudin avatar pbaudin commented on June 12, 2024

Any way, as @vprevosto, I'd rather leave these 3 constructs undefined.

from acsl.

yakobowski avatar yakobowski commented on June 12, 2024

So would I (leave undefined). If not, I would strongly vote for not having \base_addr(\null) == char*(-1), as a negative pointer seems like a bad idea.

from acsl.

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.