/* This header file contains the core definitions of the CIVL-C language, * including standard types and function prototypes. */ #ifndef _CIVLC_ #define _CIVLC_ #pragma CIVL ACSL /* ********************* Standard Constants and Types ********************* */ #define $true 1 #define $false 0 #ifndef NULL #define NULL ((void*)0) #endif #ifndef __UNSIGNED_BOUND #define __UNSIGNED_BOUND 32 #endif #define $elaborate(x) for(int _i = 0; _i < (x); _i++) typedef unsigned long int size_t; /* ************************** Basic CIVL-C Types ************************** */ /* The CIVL-C process reference type */ typedef struct $proc $proc; /* The CIVL-C scope type, used to represent a scope */ typedef struct $scope $scope; /* The CIVL-C program state refrence type */ typedef struct $state $state; /* The CIVL-C dynamic type, used to represent a symbolic type */ typedef struct $dynamic $dynamic; /* **************************** Misc. Functions **************************** */ /* Wait for another process p to terminate. */ /*@ depends_on \nothing; @*/ $system void $wait($proc p); /* Blocks until all processes referred to by the given array terminates. */ /*@ depends_on \nothing; @*/ $system void $waitall($proc *procs, int numProcs); /* Terminate the calling process. */ /*@ depends_on \nothing; @ executes_when \true; @*/ $system void $exit(void); /* Checks if the given process has terminated. * * The result returned could change from false to true * if any transition in p executes. Currently we don't * have any way to say "depends on any transition in p". */ /*@ @ executes_when \true; @*/ $system _Bool $is_terminated($proc p); /* Nondeterministic choice of integer i, such that 0<=i