Created
June 14, 2017 07:59
-
-
Save codelion/eb19f96fe657e288d491b7995d875f12 to your computer and use it in GitHub Desktop.
Verifying shape property for modified version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct node{ | |
int val; | |
struct node* next; | |
}; | |
/*@ | |
list<> == self=null or self::node<_,q> * q::list<>; | |
*/ | |
int length(struct node* p) | |
/*@ | |
requires p::list<> | |
ensures p::list<>; | |
*/ | |
{ | |
if (p!=NULL) return 1 + length(p->next); | |
else return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment