Skip to content
GitLab
Projects Groups Topics 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
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 168
    • Issues 168
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
    • Model experiments
  • 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
  • #2094

assigns nothing is not possible to proof, if malloc is not in a same function

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


Id Project Category View Due Date Updated
ID0001032 Frama-C Plug-in > jessie public 2011-11-29 2011-11-29
Reporter jessie_user Assigned To cmarche Resolution open
Priority normal Severity feature Reproducibility always
Platform - OS - OS Version -
Product Version Frama-C Nitrogen-20111001 Target Version - Fixed in Version -

Description :

The assigns \nothing clausel is not provable with Jessie, if you use malloc in another function. And it is provable if it is in the same function. Ex1: /@ assigns \nothing;/ // assigns ok int* assigns_tm(){ int* a = malloc (sizeof(int)*10); a[0] = 42; return a; }

Ex2: /@assigns \nothing; ensures \valid_range (\result, 0, 10);/ int* create_ints(){ return malloc (sizeof(int)10); } /@ assigns \nothing; //Not possible to prove ! / int assigns_t (){ int* a = create_ints(); a[0] = 42; return a; }

Proof for Ex1 with coq is attached.

What possibilities do you have, if you want to prove this function? I know only 3:

  1. rewrite my code
  2. define yourself something like malloc
  3. use \fresh (or \separated)

The best one is 3, but unfortunately Jessie does not implement \fresh and \separated.

Attachments

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