Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • F frama-c
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 204
    • Issues 204
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • pub
  • frama-c
  • Issues
  • #634
Closed
Open
Created Jun 01, 2015 by mantis-gitlab-migration@mantis-gitlab-migration

Redefintion of variables in same scope is allowed in annotations

ID0002125: This issue was created automatically from Mantis Issue 2125. Further discussion may take place here.


Id Project Category View Due Date Updated
ID0002125 Frama-C Kernel > ACSL implementation public 2015-06-01 2015-06-02
Reporter gaggarwal Assigned To virgile Resolution open
Priority normal Severity minor Reproducibility always
Platform - OS - OS Version -
Product Version Frama-C Neon-20140301 Target Version - Fixed in Version -

Description :

Consider an example:

/@ predicate is_valid(int n, int n) = (0 <= n) ; */

Frama-C doesn't throw any exception for the above predicate, even though variable "n" is defined twice in the same scope and it uses n as of Type int and allows comparison 0 <= n.

If I change the above predicate to following: /@ predicate is_valid_int_range(int n, int n) = (0 <= n) ; / Frama-c complains "[kernel] user error: comparison of incompatible types: ℤ and int * in annotation" for comparison 0 <= n in above example, which means that it treats n of type int.

Similarly, redefinition of variable in same scope is allowed in quantifier expressions like: loop invariant \forall int k, char k; 0 <= k && k< i ==> a[k] == b[k];

In C language it is not allowed to redefine variable in same scope. Is this an intentional behavior? And if so that is the purpose behind it? I don't see this matter is discussed in ACSL document.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking