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
  • #627
Closed
Open
Created Jun 04, 2015 by mantis-gitlab-migration@mantis-gitlab-migration

Range of remainder of two positive integers, wrong and missing assertions.

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


Id Project Category View Due Date Updated
ID0002129 Frama-C Plug-in > wp public 2015-06-04 2015-06-29
Reporter loic Assigned To correnson Resolution no change required
Priority normal Severity major Reproducibility always
Platform Linux OS Ubuntu OS Version 12.04.5 LTS
Product Version - Target Version - Fixed in Version -

Description :

Nitrogen-20111001 alt-ergo 0.94

False negative and false positive int the following code.

/@ requires 0 <= n; / void modulo_testcase_0(unsigned n) { /@ ghost unsigned q = n / 2; / /@ ghost unsigned r = n % 2; / /@ assert 0 <= n; / / OK / /@ assert n == 2q + r; / / OK / /@ assert 0 <= q; / / OK / /@ assert 0 <= r < 1; / / NOK, cannot be proven */ }

/*@ requires 0 <= n && 0 < d; / void modulo_testcase_1(int n, int d) { /@ assert n <= d * (n / d); / / NOK, cannot be proven / /@ ghost int q = n / d; / / OK / /@ ghost int r = n % d; / / OK / /@ assert 0 <= r < 1; / / NOK, r < d is true / /@ assert n <= d * (n / d); / / OK */ }

Steps To Reproduce :

frama-c -wp -wp-rte on the code above (also as attachment).

Attachments

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