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
  • #1849
Closed
Open
Issue created May 29, 2013 by Allan Blanchard@blanchardMaintainer

Property does not work anymore when changed to predicate

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


Id Project Category View Due Date Updated
ID0001434 Frama-C Plug-in > wp public 2013-05-29 2013-05-30
Reporter Allan Blanchard Assigned To correnson Resolution no change required
Priority normal Severity minor Reproducibility always
Platform - OS - OS Version -
Product Version Frama-C Fluorine-20130501 Target Version - Fixed in Version -

Description :

I have this small program+spec :

#define SIZE 8 #define NUM 4

int table[NUM] = {0}; int pages[NUM*SIZE] = {0};

/@ predicate validindex(integer i) = \valid(table+i) && \forall integer j; 0 <= j < SIZE ==> \valid(pages+iSIZE+j); */

/@ predicate coherent_clean{L}(integer i) = \forall integer j; 0 <= j < table[i] <= SIZE ==> pages[iSIZE+j] == 0; */

/*@ requires \forall integer i; 0 <= i < NUM ==> validindex(i); / void init(void) { /@ loop invariant 0 <= i <= NUM; loop invariant \forall integer j; 0 <= j < i ==> coherent_clean(j); loop assigns i, table[0 .. NUM-1]; loop variant NUM - i; */ for(int i = 0; i < NUM; i++){ table[i] = 0; } }

This one is not proved by frama-C + WP. But if I inline the predicate, like this :

void init(void) { /@ loop invariant 0 <= i <= NUM; loop invariant \forall integer j; 0 <= j < i ==> \forall integer k; 0 <= k < table[j] <= SIZE ==> pages[jSIZE+k] == 0; loop assigns i, table[0 .. NUM-1]; loop variant NUM - i; */ for(int i = 0; i < NUM; i++){ table[i] = 0; } }

It perfectly works

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