Skip to content

function / no_state / reads \nothing #50

Description

@davidcok

We need a method modifier that denotes methods that do not reference the heap.
This is an element of specification in that it lies at the interface of the method -- and can be used by clients and verified against the implementation.

A method marked this way is known to be independent of the heap -- so its value (for the same arguments) does not change when the heap changes. This means also that it does not depend on fields of any reference-type arguments.

All operations on builtin mathematical types are in this category.

Also, operations on 'immutable' types such as String and integer, whose heap state, if any, is unobservable by anything else.

The question is: how should this be specified in JML.

  1. OpenJML is using function
  2. I think KeY is using no_state
  3. And does reads \nothing (that is accessible \nothing;) accomplish the same goal, if more obscurely?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    syntaxdiscussion on how to notate/name a clause/expression in JML

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions