/* Generated by Frama-C */
#include "stddef.h"
#include "stdio.h"
#include "stdlib.h"
struct list {
   struct list *next ;
   int value ;
};
/*@
logic ℤ length_aux{L}(struct list *l, ℤ n) =
  \at(n < 0? -1:
        (l ≡ (struct list *)0? n:
           (n < 2147483647? length_aux(l->next, n + 1): -1)),
      L);
 */
/*@ logic ℤ length{L}(struct list *l) = \at(length_aux(l, 0),L);

*/
int main(void)
{
  int __retres;
  struct list node1;
  struct list node2;
  struct list node3;
  __e_acsl_memory_init((int *)0,(char ***)0,(size_t)8);
  __e_acsl_store_block((void *)(& node3),(size_t)16);
  __e_acsl_store_block((void *)(& node2),(size_t)16);
  __e_acsl_store_block((void *)(& node1),(size_t)16);
  __e_acsl_initialize((void *)(& node1.next),sizeof(struct list *));
  node1.next = & node2;
  __e_acsl_initialize((void *)(& node2.next),sizeof(struct list *));
  node2.next = & node3;
  struct list *l = & node1;
  __e_acsl_store_block((void *)(& l),(size_t)8);
  __e_acsl_full_init((void *)(& l));
  /*@ assert length(l) ≡ 3; */ ;
  __retres = 0;
  __e_acsl_delete_block((void *)(& l));
  __e_acsl_delete_block((void *)(& node3));
  __e_acsl_delete_block((void *)(& node2));
  __e_acsl_delete_block((void *)(& node1));
  __e_acsl_memory_clean();
  return __retres;
}


