Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • 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 208
    • Issues 208
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • pub
  • frama-c
  • Issues
  • #1031

Closed
Open
Created Feb 27, 2014 by mantis-gitlab-migration@mantis-gitlab-migration

WP: Assertion not proved -> conversion from float to int issue?

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


Id Project Category View Due Date Updated
ID0001655 Frama-C Plug-in > wp public 2014-02-27 2014-06-02
Reporter dharma Assigned To correnson Resolution fixed
Priority normal Severity major Reproducibility always
Platform Ubuntu OS Linux OS Version -
Product Version Frama-C Fluorine-20130601 Target Version - Fixed in Version -

Description :

I'm using Frama-C for my course at UMD. Found it pretty helpful.

I tried this puzzle, but cannot get WP to prove the assertion, which is true.

I ran through the GDB and found that the value of i is INT_MIN, satisfying the assert.

#include <limits.h>

/*@ requires x != 0; assigns \nothing; */ void assert(int x);

int main() { float f = INT_MAX; int i = f; assert(i == INT_MIN); return 0; }

Steps To Reproduce :

[formal_verification]$ frama-c -wp -wp-rte float_to_int_assert.c [kernel] preprocessing with "gcc -C -E -I. float_to_int_assert.c" [wp] Running WP plugin... [wp] Collecting axiomatic usage [rte] annotating function main [wp] 3 goals scheduled [wp] [Alt-Ergo] Goal typed_main_assert_rte_float_to_int_2 : Valid (8ms) [wp] [Alt-Ergo] Goal typed_main_assert_rte_float_to_int : Valid (12ms) [wp] [Alt-Ergo] Goal typed_main_call_assert_pre : Unknown

Attachments

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