예제 #1
0
void TcasKO33(int Cur_Vertical_Sep,int High_Confidence,int Two_of_Three_Reports_Valid,int Own_Tracked_Alt,int Own_Tracked_Alt_Rate,int Other_Tracked_Alt,int Alt_Layer_Value,int Up_Separation,int Down_Separation,int Other_RAC,int Other_Capability,int Climb_Inhibit)
	{ __CPROVER_assume((Cur_Vertical_Sep==718) &&(High_Confidence==1)&&(Two_of_Three_Reports_Valid==0) && (Own_Tracked_Alt == 717)&&(Own_Tracked_Alt_Rate == 34)&&(Other_Tracked_Alt == 1153)&&(Alt_Layer_Value == 0)&&(Up_Separation == 299)&&(Down_Separation == 126)&&(Other_RAC == 1)&&(Other_Capability == 0)&&(Climb_Inhibit == 1));int Positive_RA_Alt_Thresh[4];
        int OLEV;
	int MAXALTDIFF;
	int MINSEP;
	int NOZCROSS;
	int NO_INTENT;
	int TCAS_TA;
	int UNRESOLVED;
	int UPWARD_RA;
	int DOWNWARD_RA; 
        int enabled;
	int tcas_equipped;
	int intent_not_known;
	int need_upward_RA;
	int need_downward_RA;
	int alt_sep;
	int upward_preferred;
	int upward_crossing_situation;
	int resultat;    
        int Inhibit_Biased_Climb;
	int upward_crossing_situation;
        OLEV = 600;
	MAXALTDIFF = 600;
	MINSEP = 300;
	NOZCROSS = 100;
	NO_INTENT = 0;
	TCAS_TA = 1;
	UNRESOLVED = 0;
	UPWARD_RA = 1;
	DOWNWARD_RA = 2;
        Positive_RA_Alt_Thresh[1] = 400; /* error, the instruction should be : Positive_RA_Alt_Thresh[0] = 400; */ 
        Positive_RA_Alt_Thresh[2] = 500; /* error, the instruction should be : Positive_RA_Alt_Thresh[1] = 500; */
        Positive_RA_Alt_Thresh[3] = 640; /* error, the instruction should be : Positive_RA_Alt_Thresh[2] = 640; */
        Positive_RA_Alt_Thresh[4] = 740; /* error, the instruction should be : Positive_RA_Alt_Thresh[3] = 740; */
        enabled = (High_Confidence) && (Own_Tracked_Alt_Rate <= OLEV) && (Cur_Vertical_Sep > MAXALTDIFF);
	tcas_equipped = (Other_Capability == TCAS_TA);
	intent_not_known = ((Two_of_Three_Reports_Valid) && (Other_RAC == NO_INTENT));
	alt_sep = UNRESOLVED;
        if ((enabled) && (((tcas_equipped) && (intent_not_known)) || !(tcas_equipped)))
	    { 
		if (Climb_Inhibit){
		    Inhibit_Biased_Climb=Up_Separation + NOZCROSS;
		}
		else{
		    Inhibit_Biased_Climb=Up_Separation;
		}
		
		
		if (Inhibit_Biased_Climb > Down_Separation)
		    {  
			resultat = (!(Own_Tracked_Alt < Other_Tracked_Alt) || ((Own_Tracked_Alt < Other_Tracked_Alt) && !(Down_Separation >= Positive_RA_Alt_Thresh[Alt_Layer_Value])));
		    }
		else
		    {  
			resultat = (Other_Tracked_Alt < Own_Tracked_Alt) && (Cur_Vertical_Sep >= MINSEP) && (Up_Separation >= Positive_RA_Alt_Thresh[Alt_Layer_Value]);
		    }  
		
		need_upward_RA= (resultat) && (Own_Tracked_Alt < Other_Tracked_Alt);
		if (Climb_Inhibit){
		    Inhibit_Biased_Climb=Up_Separation + NOZCROSS; 
		}
		else{
		    Inhibit_Biased_Climb=Up_Separation;
		} 
		
		if (Inhibit_Biased_Climb > Down_Separation)
		    {
			resultat = (Own_Tracked_Alt < Other_Tracked_Alt) && (Cur_Vertical_Sep >= MINSEP) && (Down_Separation >= Positive_RA_Alt_Thresh[Alt_Layer_Value]);
		    }
		else
		    {
			resultat = !(Other_Tracked_Alt < Own_Tracked_Alt) || (((Other_Tracked_Alt < Own_Tracked_Alt)) && (Up_Separation >= Positive_RA_Alt_Thresh[Alt_Layer_Value]));
		    } 
		
		need_downward_RA=(resultat) && (Other_Tracked_Alt < Own_Tracked_Alt);
		if ((need_upward_RA)  && (need_downward_RA)){
		    //         unreachable: requires Own_Below_Threat and Own_Above_Threat
		    //           to both be 1 - that requires Own_Tracked_Alt < Other_Tracked_Alt
		    //           and Other_Tracked_Alt < Own_Tracked_Alt, which isn't possible 
		    alt_sep = UNRESOLVED; 
                }
		else if (need_upward_RA){
		    alt_sep = UPWARD_RA; 
		}
		else if (need_downward_RA)
		    {alt_sep = DOWNWARD_RA;}
		else 
		    {alt_sep = UNRESOLVED;}
	    }
	
assert(alt_sep == 1);
}
                                        void *P3_0(void *__cs_param_P3_arg)
                                        {
IF(4,0,tP3_0_1)
                                        __CSEQ_atomic_begin();
tP3_0_1: IF(4,1,tP3_0_2)
                                        z = 1;
                                        __CSEQ_atomic_end();
tP3_0_2: IF(4,2,tP3_0_3)
                                        __CSEQ_atomic_begin();
tP3_0_3: IF(4,3,tP3_0_4)
                                        __unbuffered_p3_EAX = z;
                                        __CSEQ_atomic_end();
tP3_0_4: IF(4,4,tP3_0_5)
                                        __CSEQ_atomic_begin();
tP3_0_5: IF(4,5,tP3_0_6)
                                        weak$$choice0 = nondet_1();
tP3_0_6: IF(4,6,tP3_0_7)
                                        weak$$choice2 = nondet_1();
tP3_0_7: IF(4,7,tP3_0_8)
                                        a$flush_delayed = weak$$choice2;
tP3_0_8: IF(4,8,tP3_0_9)
                                        a$mem_tmp = a;
tP3_0_9: IF(4,9,tP3_0_10)
                                        a = ((!a$w_buff0_used) || ((!a$r_buff0_thd4) && (!a$w_buff1_used))) || ((!a$r_buff0_thd4) && (!a$r_buff1_thd4)) ? a : a$w_buff0_used && a$r_buff0_thd4 ? a$w_buff0 : a$w_buff1;
tP3_0_10: IF(4,10,tP3_0_11)
                                        a$w_buff0 = weak$$choice2 ? a$w_buff0 : ((!a$w_buff0_used) || ((!a$r_buff0_thd4) && (!a$w_buff1_used))) || ((!a$r_buff0_thd4) && (!a$r_buff1_thd4)) ? a$w_buff0 : a$w_buff0_used && a$r_buff0_thd4 ? a$w_buff0 : a$w_buff0;
tP3_0_11: IF(4,11,tP3_0_12)
                                        a$w_buff1 = weak$$choice2 ? a$w_buff1 : ((!a$w_buff0_used) || ((!a$r_buff0_thd4) && (!a$w_buff1_used))) || ((!a$r_buff0_thd4) && (!a$r_buff1_thd4)) ? a$w_buff1 : a$w_buff0_used && a$r_buff0_thd4 ? a$w_buff1 : a$w_buff1;
tP3_0_12: IF(4,12,tP3_0_13)
                                        a$w_buff0_used = weak$$choice2 ? a$w_buff0_used : ((!a$w_buff0_used) || ((!a$r_buff0_thd4) && (!a$w_buff1_used))) || ((!a$r_buff0_thd4) && (!a$r_buff1_thd4)) ? a$w_buff0_used : a$w_buff0_used && a$r_buff0_thd4 ? (_Bool) 0 : a$w_buff0_used;
tP3_0_13: IF(4,13,tP3_0_14)
                                        a$w_buff1_used = weak$$choice2 ? a$w_buff1_used : ((!a$w_buff0_used) || ((!a$r_buff0_thd4) && (!a$w_buff1_used))) || ((!a$r_buff0_thd4) && (!a$r_buff1_thd4)) ? a$w_buff1_used : a$w_buff0_used && a$r_buff0_thd4 ? (_Bool) 0 : (_Bool) 0;
tP3_0_14: IF(4,14,tP3_0_15)
                                        a$r_buff0_thd4 = weak$$choice2 ? a$r_buff0_thd4 : ((!a$w_buff0_used) || ((!a$r_buff0_thd4) && (!a$w_buff1_used))) || ((!a$r_buff0_thd4) && (!a$r_buff1_thd4)) ? a$r_buff0_thd4 : a$w_buff0_used && a$r_buff0_thd4 ? (_Bool) 0 : a$r_buff0_thd4;
tP3_0_15: IF(4,15,tP3_0_16)
                                        a$r_buff1_thd4 = weak$$choice2 ? a$r_buff1_thd4 : ((!a$w_buff0_used) || ((!a$r_buff0_thd4) && (!a$w_buff1_used))) || ((!a$r_buff0_thd4) && (!a$r_buff1_thd4)) ? a$r_buff1_thd4 : a$w_buff0_used && a$r_buff0_thd4 ? (_Bool) 0 : (_Bool) 0;
tP3_0_16: IF(4,16,tP3_0_17)
                                        __unbuffered_p3_EBX = a;
tP3_0_17: IF(4,17,tP3_0_18)
                                        a = a$flush_delayed ? a$mem_tmp : a;
tP3_0_18: IF(4,18,tP3_0_19)
                                        a$flush_delayed = (_Bool) 0;
                                        __CSEQ_atomic_end();
tP3_0_19: IF(4,19,tP3_0_20)
                                        __CSEQ_atomic_begin();
tP3_0_20: IF(4,20,tP3_0_21)
                                        a = a$w_buff0_used && a$r_buff0_thd4 ? a$w_buff0 : a$w_buff1_used && a$r_buff1_thd4 ? a$w_buff1 : a;
tP3_0_21: IF(4,21,tP3_0_22)
                                        a$w_buff0_used = a$w_buff0_used && a$r_buff0_thd4 ? (_Bool) 0 : a$w_buff0_used;
tP3_0_22: IF(4,22,tP3_0_23)
                                        a$w_buff1_used = (a$w_buff0_used && a$r_buff0_thd4) || (a$w_buff1_used && a$r_buff1_thd4) ? (_Bool) 0 : a$w_buff1_used;
tP3_0_23: IF(4,23,tP3_0_24)
                                        a$r_buff0_thd4 = a$w_buff0_used && a$r_buff0_thd4 ? (_Bool) 0 : a$r_buff0_thd4;
tP3_0_24: IF(4,24,tP3_0_25)
                                        a$r_buff1_thd4 = (a$w_buff0_used && a$r_buff0_thd4) || (a$w_buff1_used && a$r_buff1_thd4) ? (_Bool) 0 : a$r_buff1_thd4;
                                        __CSEQ_atomic_end();
tP3_0_25: IF(4,25,tP3_0_26)
                                        __CSEQ_atomic_begin();
tP3_0_26: IF(4,26,tP3_0_27)
                                        __unbuffered_cnt = __unbuffered_cnt + 1;
                                        __CSEQ_atomic_end();
                                        goto __exit_P3;
                                        		;
                                        __exit_P3:
                                        		__CPROVER_assume(__cs_pc_cs[4] >= 27);
                                        		;
                                        		;
tP3_0_27: 
                                        STOP_NONVOID(27);
                                        }
예제 #3
0
파일: main.c 프로젝트: olivo/BP
mailbox_t *await(unsigned long long mmb)
{
	__CPROVER_assume(result < 64 && ((1ULL << result) & mmb));
	mailbox_t *_ret = (1ULL << result);
	return _ret;
}
                                        void *P1_0(void *__cs_param_P1_arg)
                                        {
IF(2,0,tP1_0_1)
                                        __CSEQ_atomic_begin();
tP1_0_1: IF(2,1,tP1_0_2)
                                        x = 1;
                                        __CSEQ_atomic_end();
tP1_0_2: IF(2,2,tP1_0_3)
                                        __CSEQ_atomic_begin();
tP1_0_3: IF(2,3,tP1_0_4)
                                        x = x$w_buff0_used && x$r_buff0_thd2 ? x$w_buff0 : x$w_buff1_used && x$r_buff1_thd2 ? x$w_buff1 : x;
tP1_0_4: IF(2,4,tP1_0_5)
                                        x$w_buff0_used = x$w_buff0_used && x$r_buff0_thd2 ? (_Bool) 0 : x$w_buff0_used;
tP1_0_5: IF(2,5,tP1_0_6)
                                        x$w_buff1_used = (x$w_buff0_used && x$r_buff0_thd2) || (x$w_buff1_used && x$r_buff1_thd2) ? (_Bool) 0 : x$w_buff1_used;
tP1_0_6: IF(2,6,tP1_0_7)
                                        x$r_buff0_thd2 = x$w_buff0_used && x$r_buff0_thd2 ? (_Bool) 0 : x$r_buff0_thd2;
tP1_0_7: IF(2,7,tP1_0_8)
                                        x$r_buff1_thd2 = (x$w_buff0_used && x$r_buff0_thd2) || (x$w_buff1_used && x$r_buff1_thd2) ? (_Bool) 0 : x$r_buff1_thd2;
                                        __CSEQ_atomic_end();
tP1_0_8: IF(2,8,tP1_0_9)
                                        __CSEQ_atomic_begin();
tP1_0_9: IF(2,9,tP1_0_10)
                                        weak$$choice0 = nondet_0();
tP1_0_10: IF(2,10,tP1_0_11)
                                        weak$$choice2 = nondet_0();
tP1_0_11: IF(2,11,tP1_0_12)
                                        x$flush_delayed = weak$$choice2;
tP1_0_12: IF(2,12,tP1_0_13)
                                        x$mem_tmp = x;
tP1_0_13: IF(2,13,tP1_0_14)
                                        x = ((!x$w_buff0_used) || ((!x$r_buff0_thd2) && (!x$w_buff1_used))) || ((!x$r_buff0_thd2) && (!x$r_buff1_thd2)) ? x : x$w_buff0_used && x$r_buff0_thd2 ? x$w_buff0 : x$w_buff1;
tP1_0_14: IF(2,14,tP1_0_15)
                                        x$w_buff0 = weak$$choice2 ? x$w_buff0 : ((!x$w_buff0_used) || ((!x$r_buff0_thd2) && (!x$w_buff1_used))) || ((!x$r_buff0_thd2) && (!x$r_buff1_thd2)) ? x$w_buff0 : x$w_buff0_used && x$r_buff0_thd2 ? x$w_buff0 : x$w_buff0;
tP1_0_15: IF(2,15,tP1_0_16)
                                        x$w_buff1 = weak$$choice2 ? x$w_buff1 : ((!x$w_buff0_used) || ((!x$r_buff0_thd2) && (!x$w_buff1_used))) || ((!x$r_buff0_thd2) && (!x$r_buff1_thd2)) ? x$w_buff1 : x$w_buff0_used && x$r_buff0_thd2 ? x$w_buff1 : x$w_buff1;
tP1_0_16: IF(2,16,tP1_0_17)
                                        x$w_buff0_used = weak$$choice2 ? x$w_buff0_used : ((!x$w_buff0_used) || ((!x$r_buff0_thd2) && (!x$w_buff1_used))) || ((!x$r_buff0_thd2) && (!x$r_buff1_thd2)) ? x$w_buff0_used : x$w_buff0_used && x$r_buff0_thd2 ? (_Bool) 0 : x$w_buff0_used;
tP1_0_17: IF(2,17,tP1_0_18)
                                        x$w_buff1_used = weak$$choice2 ? x$w_buff1_used : ((!x$w_buff0_used) || ((!x$r_buff0_thd2) && (!x$w_buff1_used))) || ((!x$r_buff0_thd2) && (!x$r_buff1_thd2)) ? x$w_buff1_used : x$w_buff0_used && x$r_buff0_thd2 ? (_Bool) 0 : (_Bool) 0;
tP1_0_18: IF(2,18,tP1_0_19)
                                        x$r_buff0_thd2 = weak$$choice2 ? x$r_buff0_thd2 : ((!x$w_buff0_used) || ((!x$r_buff0_thd2) && (!x$w_buff1_used))) || ((!x$r_buff0_thd2) && (!x$r_buff1_thd2)) ? x$r_buff0_thd2 : x$w_buff0_used && x$r_buff0_thd2 ? (_Bool) 0 : x$r_buff0_thd2;
tP1_0_19: IF(2,19,tP1_0_20)
                                        x$r_buff1_thd2 = weak$$choice2 ? x$r_buff1_thd2 : ((!x$w_buff0_used) || ((!x$r_buff0_thd2) && (!x$w_buff1_used))) || ((!x$r_buff0_thd2) && (!x$r_buff1_thd2)) ? x$r_buff1_thd2 : x$w_buff0_used && x$r_buff0_thd2 ? (_Bool) 0 : (_Bool) 0;
tP1_0_20: IF(2,20,tP1_0_21)
                                        __unbuffered_p1_EAX = x;
tP1_0_21: IF(2,21,tP1_0_22)
                                        x = x$flush_delayed ? x$mem_tmp : x;
tP1_0_22: IF(2,22,tP1_0_23)
                                        x$flush_delayed = (_Bool) 0;
                                        __CSEQ_atomic_end();
tP1_0_23: IF(2,23,tP1_0_24)
                                        __CSEQ_atomic_begin();
tP1_0_24: IF(2,24,tP1_0_25)
                                        x = x$w_buff0_used && x$r_buff0_thd2 ? x$w_buff0 : x$w_buff1_used && x$r_buff1_thd2 ? x$w_buff1 : x;
tP1_0_25: IF(2,25,tP1_0_26)
                                        x$w_buff0_used = x$w_buff0_used && x$r_buff0_thd2 ? (_Bool) 0 : x$w_buff0_used;
tP1_0_26: IF(2,26,tP1_0_27)
                                        x$w_buff1_used = (x$w_buff0_used && x$r_buff0_thd2) || (x$w_buff1_used && x$r_buff1_thd2) ? (_Bool) 0 : x$w_buff1_used;
tP1_0_27: IF(2,27,tP1_0_28)
                                        x$r_buff0_thd2 = x$w_buff0_used && x$r_buff0_thd2 ? (_Bool) 0 : x$r_buff0_thd2;
tP1_0_28: IF(2,28,tP1_0_29)
                                        x$r_buff1_thd2 = (x$w_buff0_used && x$r_buff0_thd2) || (x$w_buff1_used && x$r_buff1_thd2) ? (_Bool) 0 : x$r_buff1_thd2;
                                        __CSEQ_atomic_end();
tP1_0_29: IF(2,29,tP1_0_30)
                                        __CSEQ_atomic_begin();
tP1_0_30: IF(2,30,tP1_0_31)
                                        __unbuffered_cnt = __unbuffered_cnt + 1;
                                        __CSEQ_atomic_end();
                                        goto __exit_P1;
                                        		;
                                        __exit_P1:
                                        		__CPROVER_assume(__cs_pc_cs[2] >= 31);
                                        		;
                                        		;
tP1_0_31: 
                                        STOP_NONVOID(31);
                                        }
예제 #5
0
파일: main.c 프로젝트: olivo/BP
int f(int a){ 
	int r;
	__CPROVER_assume(r != a);
	return r; 
}
                                        int main(void)
                                        {
                                        unsigned __CPROVER_bitvector[5] __cs_tmp_t0_r0 = (unsigned __CPROVER_bitvector[5])nondet_uint();
                                        unsigned __CPROVER_bitvector[3] __cs_tmp_t1_r0 = (unsigned __CPROVER_bitvector[3])nondet_uint();
                                        unsigned __CPROVER_bitvector[3] __cs_tmp_t2_r0 = (unsigned __CPROVER_bitvector[3])nondet_uint();
                                        unsigned __CPROVER_bitvector[5] __cs_tmp_t3_r0 = (unsigned __CPROVER_bitvector[5])nondet_uint();
                                        unsigned __CPROVER_bitvector[5] __cs_tmp_t4_r0 = (unsigned __CPROVER_bitvector[5])nondet_uint();
                                        unsigned __CPROVER_bitvector[5] __cs_tmp_t0_r1 = (unsigned __CPROVER_bitvector[5])nondet_uint();
                                        unsigned __CPROVER_bitvector[3] __cs_tmp_t1_r1 = (unsigned __CPROVER_bitvector[3])nondet_uint();
                                        unsigned __CPROVER_bitvector[3] __cs_tmp_t2_r1 = (unsigned __CPROVER_bitvector[3])nondet_uint();
                                        unsigned __CPROVER_bitvector[5] __cs_tmp_t3_r1 = (unsigned __CPROVER_bitvector[5])nondet_uint();
                                        unsigned __CPROVER_bitvector[5] __cs_tmp_t4_r1 = (unsigned __CPROVER_bitvector[5])nondet_uint();
                                        unsigned __CPROVER_bitvector[5] __cs_tmp_t0_r2 = (unsigned __CPROVER_bitvector[5])nondet_uint();
/* round  0 */
                                        __CPROVER_assume(__cs_tmp_t0_r0 > 0);
                                        __cs_thread_index = 0;
                                        __cs_pc_cs[0] = __cs_pc[0] + __cs_tmp_t0_r0;
                                        __CPROVER_assume(__cs_pc_cs[0] > 0);
                                        __CPROVER_assume(__cs_pc_cs[0] <= 16);
                                        main_thread();
                                        __cs_pc[0] = __cs_pc_cs[0];
                                        if (__cs_active_thread[1] == 1)
                                        		{
                                        __cs_thread_index = 1;
                                        __cs_pc_cs[1] = __cs_pc[1] + __cs_tmp_t1_r0;
                                        __CPROVER_assume(__cs_pc_cs[1] <= 7);
                                        P0_0(__cs_threadargs[1]);
                                        __cs_pc[1] = __cs_pc_cs[1];
                                        		}
                                        if (__cs_active_thread[2] == 1)
                                        		{
                                        __cs_thread_index = 2;
                                        __cs_pc_cs[2] = __cs_pc[2] + __cs_tmp_t2_r0;
                                        __CPROVER_assume(__cs_pc_cs[2] <= 7);
                                        P1_0(__cs_threadargs[2]);
                                        __cs_pc[2] = __cs_pc_cs[2];
                                        		}
                                        if (__cs_active_thread[3] == 1)
                                        		{
                                        __cs_thread_index = 3;
                                        __cs_pc_cs[3] = __cs_pc[3] + __cs_tmp_t3_r0;
                                        __CPROVER_assume(__cs_pc_cs[3] <= 20);
                                        P2_0(__cs_threadargs[3]);
                                        __cs_pc[3] = __cs_pc_cs[3];
                                        		}
                                        if (__cs_active_thread[4] == 1)
                                        		{
                                        __cs_thread_index = 4;
                                        __cs_pc_cs[4] = __cs_pc[4] + __cs_tmp_t4_r0;
                                        __CPROVER_assume(__cs_pc_cs[4] <= 22);
                                        P3_0(__cs_threadargs[4]);
                                        __cs_pc[4] = __cs_pc_cs[4];
                                        		}
/* round  1 */
                                        if (__cs_active_thread[0] == 1)
                                        		{
                                        				__cs_thread_index = 0;
                                        __cs_pc_cs[0] = __cs_pc[0] + __cs_tmp_t0_r1;
                                        __CPROVER_assume(__cs_pc_cs[0] >= __cs_pc[0]);
                                        __CPROVER_assume(__cs_pc_cs[0] <= 16);
                                        main_thread();
                                        __cs_pc[0] = __cs_pc_cs[0];
                                        		}
                                        if (__cs_active_thread[1] == 1)
                                        		{
                                        __cs_thread_index = 1;
                                        __cs_pc_cs[1] = __cs_pc[1] + __cs_tmp_t1_r1;
                                        __CPROVER_assume(__cs_pc_cs[1] >= __cs_pc[1]);
                                        __CPROVER_assume(__cs_pc_cs[1] <= 7);
                                        P0_0(__cs_threadargs[__cs_thread_index]);
                                        __cs_pc[1] = __cs_pc_cs[1];
                                        		}
                                        if (__cs_active_thread[2] == 1)
                                        		{
                                        __cs_thread_index = 2;
                                        __cs_pc_cs[2] = __cs_pc[2] + __cs_tmp_t2_r1;
                                        __CPROVER_assume(__cs_pc_cs[2] >= __cs_pc[2]);
                                        __CPROVER_assume(__cs_pc_cs[2] <= 7);
                                        P1_0(__cs_threadargs[__cs_thread_index]);
                                        __cs_pc[2] = __cs_pc_cs[2];
                                        		}
                                        if (__cs_active_thread[3] == 1)
                                        		{
                                        __cs_thread_index = 3;
                                        __cs_pc_cs[3] = __cs_pc[3] + __cs_tmp_t3_r1;
                                        __CPROVER_assume(__cs_pc_cs[3] >= __cs_pc[3]);
                                        __CPROVER_assume(__cs_pc_cs[3] <= 20);
                                        P2_0(__cs_threadargs[__cs_thread_index]);
                                        __cs_pc[3] = __cs_pc_cs[3];
                                        		}
                                        if (__cs_active_thread[4] == 1)
                                        		{
                                        __cs_thread_index = 4;
                                        __cs_pc_cs[4] = __cs_pc[4] + __cs_tmp_t4_r1;
                                        __CPROVER_assume(__cs_pc_cs[4] >= __cs_pc[4]);
                                        __CPROVER_assume(__cs_pc_cs[4] <= 22);
                                        P3_0(__cs_threadargs[__cs_thread_index]);
                                        __cs_pc[4] = __cs_pc_cs[4];
                                        		}
                                        if (__cs_active_thread[0] == 1)
                                        		{
                                        __cs_thread_index = 0;
                                        __cs_pc_cs[0] = __cs_pc[0] + __cs_tmp_t0_r2;
                                        __CPROVER_assume(__cs_pc_cs[0] >= __cs_pc[0]);
                                        __CPROVER_assume(__cs_pc_cs[0] <= 16);
                                        main_thread();
                                        		}
                                        return 0;
                                        }
 int __cs_join(__cs_t __cs_id, void **__cs_value_ptr)
 {
 __CPROVER_assume(__cs_pc[__cs_id] == __cs_thread_lines[__cs_id]);
 return 0;
 }
unsigned int zeroTon(unsigned int n) {
    unsigned int result = nondet_uint();
    __CPROVER_assume(result >=0 && result <=n);
    return result ;
};
int  main()
 
 {    

    unsigned int pos, i, j, k, l, w, x, y , iVal, jVal, g, g0, gl, lastg, ng, nl, nl2 ;
    unsigned int edgePos = 0, bagNo = 0, colorNode = 0 , minColor, cPos = 0 , tComp, result;
    unsigned int  ticks, valj, vali , calc;
    unsigned int connectedArray[N] = {}, edgeCount = 0;
    _Bool Ck=0, Cf = 1, C0, C1, C2 = 1, C3 = 1, C4, C5, C6 , C7; 

    bitvector Vnodes[N];
    bitvector Tnodes[N] ;

    bitvector  fareTotal, inTotal, outTotal , outVSnareTotal , inVSnareTotal , outTSnareTotal , inTSnareTotal ;
    snareVector total, cond2Total, cond2fareTotal, centTotal, placeHolder, v, vl, vl2, t, f, v2, lastv, lastv2 ,nv, nv2, v0, v02 ;
    snareVector Tedge[N][N], Vedge[N][N] , Vedge2[N][N] , Tedge2[N][N] , fComp , bComp;    
    snareVector friendMatrix[snareLength];     
    snareVector onOffMatrix[N], stCorres;
  
    unsigned int graph[N][N]; 

	edgeCount = 0;
    for (i = 0; i < N; i++) {
        for (j = 0; j < N; j++) {
			if(i != j) {
				__CPROVER_assume(graph[i][j] >= 0 && graph[i][j] <=2);
			    if (graph[i][j] == 1)
                    edgeCount += 1;	
                else if (graph[i][j] == 2) 
					edgeCount += 2;

            }
             else  
				__CPROVER_assume(graph[i][j] == 0); 

			} 
    }


     __CPROVER_assume(edgeCount == len);

    C5 = 1;

    for ( i = 0; i < N; i++) {
        for (j = 0; j < N ; j++) {
            if ( graph[i][j] >= 1 && (i != j)) {  // if there is Direct edge we are done
                C5 = C5 && 1;
             }
            else if (i != j) {  // Else case
                unsigned int nub;  // Define max hop
                __CPROVER_assume( nub >= 1 && (nub <= N-2));
                unsigned int gPath[nub];
                
                for (k = 0; k < nub; k++) {   // zdynamic N - 2 iteration
                     gPath[k] = zeroTon(N-1);
                 }
                 
                //  Make sure first edge is connected to i  and last edge is connected to j
                if( (graph[i][gPath[0]] >= 1) && (graph[gPath[nub - 1]][j] >= 1))   
                     C5 = C5 && 1;
                else 
                     C5 = 0;

               // rest Of the case is just checking edge btw consecutive array elements
                 for (l = 0; l < nub - 1; l++) {         //Dynamic N - 3  iteration
                       if ( graph[gPath[l]][gPath[l+1]] >= 1 ) 
                               C5 = C5 && 1;
                        else 
                            C5 = 0;
                     }

            }
        }
    }
   

    //  Define the Container as Basis of our work  --------------------------
     struct EdgeBag edgeBag[len];
     //  Fill the Container values with i, j, edgeWeigth, vsnare, tsnare Values.
     edgePos = 0;
     for  (i = 0; i < N; i++) {
             for  (j = 0; j < N; j++) {
               if ((graph[i][j] == 1) || (graph[i][j] == 2)) {
                   edgeBag[edgePos].ith = i;     // Record the source node
                   edgeBag[edgePos].jth = j;     // Record the target Node
 
                   // Only molecule present at the nodes are allowed to fly out.
                   __CPROVER_assume((edgeBag[edgePos].vSnare  & (~ Vnodes[i])) == 0);
                   __CPROVER_assume((edgeBag[edgePos].tSnare  & (~ Tnodes[i])) == 0); ;
 
                   // Additional Vedge[i][j] and Tedge[i][j] is used to be lookup value in global steady state check condition.
                   Vedge[i][j] = edgeBag[edgePos].vSnare;
                   Tedge[i][j] = edgeBag[edgePos].tSnare;
                   edgePos = edgePos + 1;
             }
 
             if ((graph[i][j] == 2)) {
                  edgeBag[edgePos].ith = i;      // Record the Source Node  
                  edgeBag[edgePos].jth = j;      // Record the Target Node
 
                 // Only molecule present at the nodes are allowed to fly out.
                   __CPROVER_assume((edgeBag[edgePos].vSnare  & (~ Vnodes[i])) == 0);
                   __CPROVER_assume((edgeBag[edgePos].tSnare  & (~ Tnodes[i])) == 0);
                    // Additional Vedge2[i][j] and Tedge2[i][j] is used to be lookup value in global steady state check condition.
                   Vedge2[i][j] = edgeBag[edgePos].vSnare;
                   Tedge2[i][j] = edgeBag[edgePos].tSnare;
                   edgePos = edgePos + 1;
             }

          }
     }
     

         C4 = 0;
         for ( i = 0; i < N ; i++) {
             calc = 0;
             for ( j = 0 ; j < len; j++) {              
                if ( (edgeBag[j].ith == i) || (edgeBag[j].jth == i) ){
                     calc = calc + 1;
                }
               }
             __CPROVER_assume(calc >= 3);
             if(calc < 4) {
                 C4 = 1;
             }
         }

     
    C0 = 1; 
    
	for (j = 0; j < len; j++) {   
         C0 = (C0 && (edgeBag[j].vSnare != 0));
         C0 = (C0 && (edgeBag[j].tSnare != 0));
     }

    for ( i = 0; i < N; i++) {
              __CPROVER_assume(Vnodes[i] != 0);
    }
    
    C1 = 1;
// No.1 : Steady State Condition For VSnares	
   for (i = 0; i < len; i++ ) {      // For each Edge  
       for (j = 0; j < snareLength; j++) {       // for each molecule               
           if(edgeBag[i].vSnare & (1 << j)) {     // Present molecules   
                vali = edgeBag[i].ith;   // store the source node
                valj = edgeBag[i].jth;   // Store the target node
                // If there is a back edge from taget to source we are done.
                if (((graph[valj][vali] >= 1) && (Vedge[valj][vali] & (1 << j) )) || ((graph[valj][vali] == 2) && (Vedge2[valj][vali] & (1 << j)  )) )   {
                      C1 = C1 && 1;
                }
                // Else continue checking for the cycle
                else { 
         		// g0 is unsigned int checks if there is an edge btw two nodes
                //  It should be on some cycle, So assume that it'll be between 0 and N-2
                //  As we are Only considering elementary cycles.
                unsigned int big;
                __CPROVER_assume( big >= 1 && big <= (N - 2));
                 unsigned int path[big];   // An array to store the path taken by molecule.
             
               //  Make sure every int is between 0 and N-1 that represent the node
                for (l = 0; l < big; l++) {           // Dynamic
                      path[l] = zeroTon(N - 1);
                } 
               
	            g0  = graph[valj][path[0]];    // g0 is unsigned int checks if there is an edge btw two nodes
	            v0  = Vedge[valj][path[0]];    // snareVector gets the edgeweight of the corresponding edge.
                v2  = Vedge2[valj][path[0]];
               
                gl  = graph[path[big - 1]][vali];
	            vl  = Vedge[path[big - 1]][vali];    // snareVector gets the edgeweight of the corresponding edge.
                vl2 = Vedge2[path[big - 1]][vali];

               if ( ( (( g0 == 1) && (v0 & (1 << j))) ||  ( (g0 == 2) &&  ( (v0 & (1 << j)) || ( v2 & (1 << j)) ) )) &&  ((( gl == 1) && (vl & (1 << j))) ||  ( (gl == 2) &&  ( (vl & ( 1 << j)) || ( vl2 & (1 << j)) ) )))  {                  
                   C1 = C1 && 1;
               }

               else {
                   C1 = 0;
               }
           
           
           if ( big > 1 ) {
               for (k = 0; k < big - 1 ; k++)  {                  // Dynamic 				    	 
		           ng  = graph[path[k]][path[k+1]];
		           nv  = Vedge[path[k]][path[k+1]];
		           nv2 = Vedge2[path[k]][path[k+1]];	
                   if ( ((ng == 1) && (nv & (1 << j))) ||  ( (ng == 2) && ((nv & (1 << j)) || (nv2 & (1 << j)))) ) {
                           C1 = C1 && 1;
                   }
                   else {
                           C1 = 0;
                   }
               }
           }


           }  // else Outside closed
        }  // If closed
      }  // jth for closed    
    }   //  ith for closed 
  
  
  
// No.2 : Steady State Condition For VSnares	
   for (i = 0; i < len; i++ ) {      // For each Edge  
       for (j = 0; j < snareLength; j++) {       // for each molecule               
           if(edgeBag[i].tSnare & (1 << j)) {     // Present molecules   
                vali = edgeBag[i].ith;   // store the source node
                valj = edgeBag[i].jth;   // Store the target node
                
                if (((graph[valj][vali] >= 1) && (Tedge[valj][vali] & (1 << j) ))  || ((graph[valj][vali] == 2) && (Tedge2[valj][vali] & (1 << j) )))  {
                      C1 = C1 && 1;
                 }

                else { 
         		// g0 is unsigned int checks if there is an edge btw two nodes
                //  It should be on some cycle, So assume that it'll be between 0 and N-2
                //  As we are Only considering elementary cycles.
                unsigned int big;
                __CPROVER_assume( big >= 1 && big <= (N - 2));
     
                 unsigned int path[big];   // An array to store the path taken by molecule.
             
               //  Make sure every int is between 0 and N-1 that represent the node
                for (l = 0; l < big; l++) {           // Dynamic
                      path[l] = zeroTon(N - 1);
                } 
               
    	        g0  = graph[valj][path[0]];    // g0 is unsigned int checks if there is an edge btw two nodes
	            v0  = Tedge[valj][path[0]];    // snareVector gets the edgeweight of the corresponding edge.
                v2  = Tedge2[valj][path[0]];
               
                gl  = graph[path[big - 1]][vali];
	            vl  = Tedge[path[big - 1]][vali];    // snareVector gets the edgeweight of the corresponding edge.
                vl2 = Tedge2[path[big - 1]][vali];

               if ( ((( g0 == 1) && (v0 & (1 << j))) ||  ( (g0 == 2) &&  ( (v0 & ( 1 << j)) || ( v2 & (1 << j)) ) )) &&  ((( gl == 1) && (vl & (1 << j))) ||  ( (gl == 2) &&  ( (vl & ( 1 << j)) || ( vl2 & (1 << j)) ) )))  {                  
                   C1 = C1 && 1;
               }

               else {
                   C1 = 0;
               }
          if ( big > 1) {
               for (k = 0; k < big - 1 ; k++)  {                  // Dynamic 				    	 
		           ng  = graph[path[k]][path[k+1]];
		           nv  = Tedge[path[k]][path[k+1]];
		           nv2 = Tedge2[path[k]][path[k+1]];	
                   if (((ng == 1) && (nv & (1 << j))) ||  ( (ng == 2) && ((nv & (1 << j)) || (nv2 & (1 << j))) )) {
                           C1 = C1 && 1;
                   }
                   else {
                           C1 = 0;
                   }
               }
          }
           }  // else Outside closed
        } 
      }  // jth for closed    
    }   


    for  (i = 0; i < len; i++) {
        centTotal = 0b0;
        total = 0b0;
        ticks = 0;
		Ck = 0;
        
        //  Check if jth vSnare is present then check if all its t-snare frds are present on the edge. 
        //  If yes don't consider him as a cnadidate to check the fusion that happens btw current nodes.

        for  (j = 0; j < snareLength; j++) {
           v = edgeBag[i].vSnare;
           t = edgeBag[i].tSnare;
           f = friendMatrix[j];
           valj = edgeBag[i].jth;
           vali = edgeBag[i].ith;
          
           if( (v & (1 << j)) && ((t & f) != f) ){
              edgeBag[i].zebra[ticks] = f;
              centTotal = centTotal | f;
              ticks = ticks + 1;     
              if ( (((Tnodes[valj] & onOffMatrix[valj]) & f)  == f)  &&  ((onOffMatrix[vali] & f) != f)) {
                 Ck = Ck || 1 ;                                  
              }
           }
         }
           
         edgeBag[i].combinedMask = centTotal;
         edgeBag[i].count = ticks;

         if(Ck == 1) {
             C2 = C2 && 1;
         }
         else {
             C2 = C2 && 0;
         }

        for (k = 0; k < N; k++) {
			if( k != edgeBag[i].jth) {
				for ( l = 0; l < edgeBag[i].count ; l++) {
				    if (((onOffMatrix[k] & Tnodes[k]) & edgeBag[i].zebra[l]) != f){
					   C3 = C3 && 1;
				    }
				    else {
				       C3 = 0;
				   }
		        }
		    }
		} 

    }

    
//  BASIC BLOCK ENDS -----------------------------------------------------------------------------------------
   
    for  (i = 0; i < len; i++) {

        printf("The edge No.%d has this config : \n There is an edge between graph[%d][%d]" , i , edgeBag[i].ith, edgeBag[i].jth);

        printf (" vSnare =  %d \n tSnare = %d\n combinedMask = %d \n counts = %d " ,edgeBag[i].vSnare , edgeBag[i].tSnare, edgeBag[i].combinedMask, edgeBag[i].count);
   
   }

    for  (i = 0; i < N; i++){
        printf("T-Nodes[%d] = %d" , i , Tnodes[i]);
    }
    for  (i = 0; i < N; i++){
        printf("V-Nodes[%d] = %d" , i , Vnodes[i]);
    }
/*
    for  (i = 0; i < snareLength; i++) {
        printf( "\n The frindmatrix[%d] = %d ", i , friendMatrix[i]);
    }

    for  (i = 0; i < N; i++){
        printf(" \n The onOffMatrix[%d] = %d ", i, onOffMatrix[i]);
    }
*/

    for(i = 0;i < N ; i++) {
        for( j = 0;j < N; j++) {
            printf("Graph[%d][%d] = %d",i,j,graph[i][j]);
        }
    }

    printf("\nThe value of : \n C0 = %d \n C1 : %d \n C2 : %d , C3 : %d \n,C4 : %d , C5 : %d",C0,C1,C2,C3,C4,C5);
    printf(" the value of mr.Ticks is %d and len was %d ", ticks , len);
    
  // assert(0);
  __CPROVER_assert(!(C0 && C1 && C2 && C3 && C4 && C5) , "Graph that satisfy friendZoned model exists");  
 
}
                                        void *P2_0(void *__cs_param_P2_arg)
                                        {
IF(3,0,tP2_0_1)
                                        __CSEQ_atomic_begin();
tP2_0_1: IF(3,1,tP2_0_2)
                                        y = 2;
                                        __CSEQ_atomic_end();
tP2_0_2: IF(3,2,tP2_0_3)
                                        __CSEQ_atomic_begin();
tP2_0_3: IF(3,3,tP2_0_4)
                                        weak$$choice0 = nondet_1();
tP2_0_4: IF(3,4,tP2_0_5)
                                        weak$$choice2 = nondet_1();
tP2_0_5: IF(3,5,tP2_0_6)
                                        z$flush_delayed = weak$$choice2;
tP2_0_6: IF(3,6,tP2_0_7)
                                        z$mem_tmp = z;
tP2_0_7: IF(3,7,tP2_0_8)
                                        z = ((!z$w_buff0_used) || ((!z$r_buff0_thd3) && (!z$w_buff1_used))) || ((!z$r_buff0_thd3) && (!z$r_buff1_thd3)) ? z : z$w_buff0_used && z$r_buff0_thd3 ? z$w_buff0 : z$w_buff1;
tP2_0_8: IF(3,8,tP2_0_9)
                                        z$w_buff0 = weak$$choice2 ? z$w_buff0 : ((!z$w_buff0_used) || ((!z$r_buff0_thd3) && (!z$w_buff1_used))) || ((!z$r_buff0_thd3) && (!z$r_buff1_thd3)) ? z$w_buff0 : z$w_buff0_used && z$r_buff0_thd3 ? z$w_buff0 : z$w_buff0;
tP2_0_9: IF(3,9,tP2_0_10)
                                        z$w_buff1 = weak$$choice2 ? z$w_buff1 : ((!z$w_buff0_used) || ((!z$r_buff0_thd3) && (!z$w_buff1_used))) || ((!z$r_buff0_thd3) && (!z$r_buff1_thd3)) ? z$w_buff1 : z$w_buff0_used && z$r_buff0_thd3 ? z$w_buff1 : z$w_buff1;
tP2_0_10: IF(3,10,tP2_0_11)
                                        z$w_buff0_used = weak$$choice2 ? z$w_buff0_used : ((!z$w_buff0_used) || ((!z$r_buff0_thd3) && (!z$w_buff1_used))) || ((!z$r_buff0_thd3) && (!z$r_buff1_thd3)) ? z$w_buff0_used : z$w_buff0_used && z$r_buff0_thd3 ? (_Bool) 0 : z$w_buff0_used;
tP2_0_11: IF(3,11,tP2_0_12)
                                        z$w_buff1_used = weak$$choice2 ? z$w_buff1_used : ((!z$w_buff0_used) || ((!z$r_buff0_thd3) && (!z$w_buff1_used))) || ((!z$r_buff0_thd3) && (!z$r_buff1_thd3)) ? z$w_buff1_used : z$w_buff0_used && z$r_buff0_thd3 ? (_Bool) 0 : (_Bool) 0;
tP2_0_12: IF(3,12,tP2_0_13)
                                        z$r_buff0_thd3 = weak$$choice2 ? z$r_buff0_thd3 : ((!z$w_buff0_used) || ((!z$r_buff0_thd3) && (!z$w_buff1_used))) || ((!z$r_buff0_thd3) && (!z$r_buff1_thd3)) ? z$r_buff0_thd3 : z$w_buff0_used && z$r_buff0_thd3 ? (_Bool) 0 : z$r_buff0_thd3;
tP2_0_13: IF(3,13,tP2_0_14)
                                        z$r_buff1_thd3 = weak$$choice2 ? z$r_buff1_thd3 : ((!z$w_buff0_used) || ((!z$r_buff0_thd3) && (!z$w_buff1_used))) || ((!z$r_buff0_thd3) && (!z$r_buff1_thd3)) ? z$r_buff1_thd3 : z$w_buff0_used && z$r_buff0_thd3 ? (_Bool) 0 : (_Bool) 0;
tP2_0_14: IF(3,14,tP2_0_15)
                                        __unbuffered_p2_EAX = z;
tP2_0_15: IF(3,15,tP2_0_16)
                                        z = z$flush_delayed ? z$mem_tmp : z;
tP2_0_16: IF(3,16,tP2_0_17)
                                        z$flush_delayed = (_Bool) 0;
                                        __CSEQ_atomic_end();
tP2_0_17: IF(3,17,tP2_0_18)
                                        __CSEQ_atomic_begin();
tP2_0_18: IF(3,18,tP2_0_19)
                                        z = z$w_buff0_used && z$r_buff0_thd3 ? z$w_buff0 : z$w_buff1_used && z$r_buff1_thd3 ? z$w_buff1 : z;
tP2_0_19: IF(3,19,tP2_0_20)
                                        z$w_buff0_used = z$w_buff0_used && z$r_buff0_thd3 ? (_Bool) 0 : z$w_buff0_used;
tP2_0_20: IF(3,20,tP2_0_21)
                                        z$w_buff1_used = (z$w_buff0_used && z$r_buff0_thd3) || (z$w_buff1_used && z$r_buff1_thd3) ? (_Bool) 0 : z$w_buff1_used;
tP2_0_21: IF(3,21,tP2_0_22)
                                        z$r_buff0_thd3 = z$w_buff0_used && z$r_buff0_thd3 ? (_Bool) 0 : z$r_buff0_thd3;
tP2_0_22: IF(3,22,tP2_0_23)
                                        z$r_buff1_thd3 = (z$w_buff0_used && z$r_buff0_thd3) || (z$w_buff1_used && z$r_buff1_thd3) ? (_Bool) 0 : z$r_buff1_thd3;
                                        __CSEQ_atomic_end();
tP2_0_23: IF(3,23,tP2_0_24)
                                        __CSEQ_atomic_begin();
tP2_0_24: IF(3,24,tP2_0_25)
                                        __unbuffered_cnt = __unbuffered_cnt + 1;
                                        __CSEQ_atomic_end();
                                        goto __exit_P2;
                                        		;
                                        __exit_P2:
                                        		__CPROVER_assume(__cs_pc_cs[3] >= 25);
                                        		;
                                        		;
tP2_0_25: 
                                        STOP_NONVOID(25);
                                        }
예제 #11
0
unsigned int  nondet (){  
  unsigned int num = nondet_uint();
  __CPROVER_assume( num>= 0 && num  <= 1);
   return num;
};
                                        void *P2_0(void *__cs_param_P2_arg)
                                        {
IF(3,0,tP2_0_1)
                                        __CSEQ_atomic_begin();
tP2_0_1: IF(3,1,tP2_0_2)
                                        y$w_buff1 = y$w_buff0;
tP2_0_2: IF(3,2,tP2_0_3)
                                        y$w_buff0 = 1;
tP2_0_3: IF(3,3,tP2_0_4)
                                        y$w_buff1_used = y$w_buff0_used;
tP2_0_4: IF(3,4,tP2_0_5)
                                        y$w_buff0_used = (_Bool) 1;
tP2_0_5: IF(3,5,tP2_0_6)
                                        assert(!(y$w_buff1_used && y$w_buff0_used));
tP2_0_6: IF(3,6,tP2_0_7)
                                        y$r_buff1_thd0 = y$r_buff0_thd0;
tP2_0_7: IF(3,7,tP2_0_8)
                                        y$r_buff1_thd1 = y$r_buff0_thd1;
tP2_0_8: IF(3,8,tP2_0_9)
                                        y$r_buff1_thd2 = y$r_buff0_thd2;
tP2_0_9: IF(3,9,tP2_0_10)
                                        y$r_buff1_thd3 = y$r_buff0_thd3;
tP2_0_10: IF(3,10,tP2_0_11)
                                        y$r_buff0_thd3 = (_Bool) 1;
                                        __CSEQ_atomic_end();
tP2_0_11: IF(3,11,tP2_0_12)
                                        __CSEQ_atomic_begin();
tP2_0_12: IF(3,12,tP2_0_13)
                                        weak$$choice0 = nondet_1();
tP2_0_13: IF(3,13,tP2_0_14)
                                        weak$$choice2 = nondet_1();
tP2_0_14: IF(3,14,tP2_0_15)
                                        y$flush_delayed = weak$$choice2;
tP2_0_15: IF(3,15,tP2_0_16)
                                        y$mem_tmp = y;
tP2_0_16: IF(3,16,tP2_0_17)
                                        y = ((!y$w_buff0_used) || ((!y$r_buff0_thd3) && (!y$w_buff1_used))) || ((!y$r_buff0_thd3) && (!y$r_buff1_thd3)) ? y : y$w_buff0_used && y$r_buff0_thd3 ? y$w_buff0 : y$w_buff1;
tP2_0_17: IF(3,17,tP2_0_18)
                                        y$w_buff0 = weak$$choice2 ? y$w_buff0 : ((!y$w_buff0_used) || ((!y$r_buff0_thd3) && (!y$w_buff1_used))) || ((!y$r_buff0_thd3) && (!y$r_buff1_thd3)) ? y$w_buff0 : y$w_buff0_used && y$r_buff0_thd3 ? y$w_buff0 : y$w_buff0;
tP2_0_18: IF(3,18,tP2_0_19)
                                        y$w_buff1 = weak$$choice2 ? y$w_buff1 : ((!y$w_buff0_used) || ((!y$r_buff0_thd3) && (!y$w_buff1_used))) || ((!y$r_buff0_thd3) && (!y$r_buff1_thd3)) ? y$w_buff1 : y$w_buff0_used && y$r_buff0_thd3 ? y$w_buff1 : y$w_buff1;
tP2_0_19: IF(3,19,tP2_0_20)
                                        y$w_buff0_used = weak$$choice2 ? y$w_buff0_used : ((!y$w_buff0_used) || ((!y$r_buff0_thd3) && (!y$w_buff1_used))) || ((!y$r_buff0_thd3) && (!y$r_buff1_thd3)) ? y$w_buff0_used : y$w_buff0_used && y$r_buff0_thd3 ? (_Bool) 0 : y$w_buff0_used;
tP2_0_20: IF(3,20,tP2_0_21)
                                        y$w_buff1_used = weak$$choice2 ? y$w_buff1_used : ((!y$w_buff0_used) || ((!y$r_buff0_thd3) && (!y$w_buff1_used))) || ((!y$r_buff0_thd3) && (!y$r_buff1_thd3)) ? y$w_buff1_used : y$w_buff0_used && y$r_buff0_thd3 ? (_Bool) 0 : (_Bool) 0;
tP2_0_21: IF(3,21,tP2_0_22)
                                        y$r_buff0_thd3 = weak$$choice2 ? y$r_buff0_thd3 : ((!y$w_buff0_used) || ((!y$r_buff0_thd3) && (!y$w_buff1_used))) || ((!y$r_buff0_thd3) && (!y$r_buff1_thd3)) ? y$r_buff0_thd3 : y$w_buff0_used && y$r_buff0_thd3 ? (_Bool) 0 : y$r_buff0_thd3;
tP2_0_22: IF(3,22,tP2_0_23)
                                        y$r_buff1_thd3 = weak$$choice2 ? y$r_buff1_thd3 : ((!y$w_buff0_used) || ((!y$r_buff0_thd3) && (!y$w_buff1_used))) || ((!y$r_buff0_thd3) && (!y$r_buff1_thd3)) ? y$r_buff1_thd3 : y$w_buff0_used && y$r_buff0_thd3 ? (_Bool) 0 : (_Bool) 0;
tP2_0_23: IF(3,23,tP2_0_24)
                                        __unbuffered_p2_EAX = y;
tP2_0_24: IF(3,24,tP2_0_25)
                                        y = y$flush_delayed ? y$mem_tmp : y;
tP2_0_25: IF(3,25,tP2_0_26)
                                        y$flush_delayed = (_Bool) 0;
                                        __CSEQ_atomic_end();
tP2_0_26: IF(3,26,tP2_0_27)
                                        __CSEQ_atomic_begin();
tP2_0_27: IF(3,27,tP2_0_28)
                                        __unbuffered_p2_EBX = z;
                                        __CSEQ_atomic_end();
tP2_0_28: IF(3,28,tP2_0_29)
                                        __CSEQ_atomic_begin();
tP2_0_29: IF(3,29,tP2_0_30)
                                        y = y$w_buff0_used && y$r_buff0_thd3 ? y$w_buff0 : y$w_buff1_used && y$r_buff1_thd3 ? y$w_buff1 : y;
tP2_0_30: IF(3,30,tP2_0_31)
                                        y$w_buff0_used = y$w_buff0_used && y$r_buff0_thd3 ? (_Bool) 0 : y$w_buff0_used;
tP2_0_31: IF(3,31,tP2_0_32)
                                        y$w_buff1_used = (y$w_buff0_used && y$r_buff0_thd3) || (y$w_buff1_used && y$r_buff1_thd3) ? (_Bool) 0 : y$w_buff1_used;
tP2_0_32: IF(3,32,tP2_0_33)
                                        y$r_buff0_thd3 = y$w_buff0_used && y$r_buff0_thd3 ? (_Bool) 0 : y$r_buff0_thd3;
tP2_0_33: IF(3,33,tP2_0_34)
                                        y$r_buff1_thd3 = (y$w_buff0_used && y$r_buff0_thd3) || (y$w_buff1_used && y$r_buff1_thd3) ? (_Bool) 0 : y$r_buff1_thd3;
                                        __CSEQ_atomic_end();
tP2_0_34: IF(3,34,tP2_0_35)
                                        __CSEQ_atomic_begin();
tP2_0_35: IF(3,35,tP2_0_36)
                                        __unbuffered_cnt = __unbuffered_cnt + 1;
                                        __CSEQ_atomic_end();
                                        goto __exit_P2;
                                        		;
                                        __exit_P2:
                                        		__CPROVER_assume(__cs_pc_cs[3] >= 36);
                                        		;
                                        		;
tP2_0_36: 
                                        STOP_NONVOID(36);
                                        }
                                        void *P0_0(void *__cs_param_P0_arg)
                                        {
IF(1,0,tP0_0_1)
                                        __CSEQ_atomic_begin();
tP0_0_1: IF(1,1,tP0_0_2)
                                        a$w_buff1 = a$w_buff0;
tP0_0_2: IF(1,2,tP0_0_3)
                                        a$w_buff0 = 1;
tP0_0_3: IF(1,3,tP0_0_4)
                                        a$w_buff1_used = a$w_buff0_used;
tP0_0_4: IF(1,4,tP0_0_5)
                                        a$w_buff0_used = (_Bool) 1;
tP0_0_5: IF(1,5,tP0_0_6)
                                        assert(!(a$w_buff1_used && a$w_buff0_used));
tP0_0_6: IF(1,6,tP0_0_7)
                                        a$r_buff1_thd0 = a$r_buff0_thd0;
tP0_0_7: IF(1,7,tP0_0_8)
                                        a$r_buff1_thd1 = a$r_buff0_thd1;
tP0_0_8: IF(1,8,tP0_0_9)
                                        a$r_buff1_thd2 = a$r_buff0_thd2;
tP0_0_9: IF(1,9,tP0_0_10)
                                        a$r_buff1_thd3 = a$r_buff0_thd3;
tP0_0_10: IF(1,10,tP0_0_11)
                                        a$r_buff0_thd1 = (_Bool) 1;
                                        __CSEQ_atomic_end();
tP0_0_11: IF(1,11,tP0_0_12)
                                        __CSEQ_atomic_begin();
tP0_0_12: IF(1,12,tP0_0_13)
                                        x = 1;
                                        __CSEQ_atomic_end();
tP0_0_13: IF(1,13,tP0_0_14)
                                        __CSEQ_atomic_begin();
tP0_0_14: IF(1,14,tP0_0_15)
                                        __unbuffered_p0_EAX = x;
                                        __CSEQ_atomic_end();
tP0_0_15: IF(1,15,tP0_0_16)
                                        __CSEQ_atomic_begin();
tP0_0_16: IF(1,16,tP0_0_17)
                                        __unbuffered_p0_EBX = y;
                                        __CSEQ_atomic_end();
tP0_0_17: IF(1,17,tP0_0_18)
                                        __CSEQ_atomic_begin();
tP0_0_18: IF(1,18,tP0_0_19)
                                        a = a$w_buff0_used && a$r_buff0_thd1 ? a$w_buff0 : a$w_buff1_used && a$r_buff1_thd1 ? a$w_buff1 : a;
tP0_0_19: IF(1,19,tP0_0_20)
                                        a$w_buff0_used = a$w_buff0_used && a$r_buff0_thd1 ? (_Bool) 0 : a$w_buff0_used;
tP0_0_20: IF(1,20,tP0_0_21)
                                        a$w_buff1_used = (a$w_buff0_used && a$r_buff0_thd1) || (a$w_buff1_used && a$r_buff1_thd1) ? (_Bool) 0 : a$w_buff1_used;
tP0_0_21: IF(1,21,tP0_0_22)
                                        a$r_buff0_thd1 = a$w_buff0_used && a$r_buff0_thd1 ? (_Bool) 0 : a$r_buff0_thd1;
tP0_0_22: IF(1,22,tP0_0_23)
                                        a$r_buff1_thd1 = (a$w_buff0_used && a$r_buff0_thd1) || (a$w_buff1_used && a$r_buff1_thd1) ? (_Bool) 0 : a$r_buff1_thd1;
                                        __CSEQ_atomic_end();
tP0_0_23: IF(1,23,tP0_0_24)
                                        __CSEQ_atomic_begin();
tP0_0_24: IF(1,24,tP0_0_25)
                                        __unbuffered_cnt = __unbuffered_cnt + 1;
                                        __CSEQ_atomic_end();
                                        goto __exit_P0;
                                        		;
                                        __exit_P0:
                                        		__CPROVER_assume(__cs_pc_cs[1] >= 25);
                                        		;
                                        		;
tP0_0_25: 
                                        STOP_NONVOID(25);
                                        }
                                        void *P2_0(void *__cs_param_P2_arg)
                                        {
IF(3,0,tP2_0_1)
                                        __CSEQ_atomic_begin();
tP2_0_1: IF(3,1,tP2_0_2)
                                        y$w_buff1 = y$w_buff0;
tP2_0_2: IF(3,2,tP2_0_3)
                                        y$w_buff0 = 2;
tP2_0_3: IF(3,3,tP2_0_4)
                                        y$w_buff1_used = y$w_buff0_used;
tP2_0_4: IF(3,4,tP2_0_5)
                                        y$w_buff0_used = (_Bool) 1;
tP2_0_5: IF(3,5,tP2_0_6)
                                        assert(!(y$w_buff1_used && y$w_buff0_used));
tP2_0_6: IF(3,6,tP2_0_7)
                                        y$r_buff1_thd0 = y$r_buff0_thd0;
tP2_0_7: IF(3,7,tP2_0_8)
                                        y$r_buff1_thd1 = y$r_buff0_thd1;
tP2_0_8: IF(3,8,tP2_0_9)
                                        y$r_buff1_thd2 = y$r_buff0_thd2;
tP2_0_9: IF(3,9,tP2_0_10)
                                        y$r_buff1_thd3 = y$r_buff0_thd3;
tP2_0_10: IF(3,10,tP2_0_11)
                                        y$r_buff0_thd3 = (_Bool) 1;
                                        __CSEQ_atomic_end();
tP2_0_11: IF(3,11,tP2_0_12)
                                        __CSEQ_atomic_begin();
tP2_0_12: IF(3,12,tP2_0_13)
                                        z = 1;
                                        __CSEQ_atomic_end();
tP2_0_13: IF(3,13,tP2_0_14)
                                        __CSEQ_atomic_begin();
tP2_0_14: IF(3,14,tP2_0_15)
                                        __unbuffered_p2_EAX = z;
                                        __CSEQ_atomic_end();
tP2_0_15: IF(3,15,tP2_0_16)
                                        __CSEQ_atomic_begin();
tP2_0_16: IF(3,16,tP2_0_17)
                                        __unbuffered_p2_EBX = a;
                                        __CSEQ_atomic_end();
tP2_0_17: IF(3,17,tP2_0_18)
                                        __CSEQ_atomic_begin();
tP2_0_18: IF(3,18,tP2_0_19)
                                        y = y$w_buff0_used && y$r_buff0_thd3 ? y$w_buff0 : y$w_buff1_used && y$r_buff1_thd3 ? y$w_buff1 : y;
tP2_0_19: IF(3,19,tP2_0_20)
                                        y$w_buff0_used = y$w_buff0_used && y$r_buff0_thd3 ? (_Bool) 0 : y$w_buff0_used;
tP2_0_20: IF(3,20,tP2_0_21)
                                        y$w_buff1_used = (y$w_buff0_used && y$r_buff0_thd3) || (y$w_buff1_used && y$r_buff1_thd3) ? (_Bool) 0 : y$w_buff1_used;
tP2_0_21: IF(3,21,tP2_0_22)
                                        y$r_buff0_thd3 = y$w_buff0_used && y$r_buff0_thd3 ? (_Bool) 0 : y$r_buff0_thd3;
tP2_0_22: IF(3,22,tP2_0_23)
                                        y$r_buff1_thd3 = (y$w_buff0_used && y$r_buff0_thd3) || (y$w_buff1_used && y$r_buff1_thd3) ? (_Bool) 0 : y$r_buff1_thd3;
                                        __CSEQ_atomic_end();
tP2_0_23: IF(3,23,tP2_0_24)
                                        __CSEQ_atomic_begin();
tP2_0_24: IF(3,24,tP2_0_25)
                                        __unbuffered_cnt = __unbuffered_cnt + 1;
                                        __CSEQ_atomic_end();
                                        goto __exit_P2;
                                        		;
                                        __exit_P2:
                                        		__CPROVER_assume(__cs_pc_cs[3] >= 25);
                                        		;
                                        		;
tP2_0_25: 
                                        STOP_NONVOID(25);
                                        }
                                        void *P1_0(void *__cs_param_P1_arg)
                                        {
IF(2,0,tP1_0_1)
                                        __CSEQ_atomic_begin();
tP1_0_1: IF(2,1,tP1_0_2)
                                        x = 1;
                                        __CSEQ_atomic_end();
tP1_0_2: IF(2,2,tP1_0_3)
                                        __CSEQ_atomic_begin();
tP1_0_3: IF(2,3,tP1_0_4)
                                        weak$$choice0 = nondet_1();
tP1_0_4: IF(2,4,tP1_0_5)
                                        weak$$choice2 = nondet_1();
tP1_0_5: IF(2,5,tP1_0_6)
                                        y$flush_delayed = weak$$choice2;
tP1_0_6: IF(2,6,tP1_0_7)
                                        y$mem_tmp = y;
tP1_0_7: IF(2,7,tP1_0_8)
                                        y = ((!y$w_buff0_used) || ((!y$r_buff0_thd2) && (!y$w_buff1_used))) || ((!y$r_buff0_thd2) && (!y$r_buff1_thd2)) ? y : y$w_buff0_used && y$r_buff0_thd2 ? y$w_buff0 : y$w_buff1;
tP1_0_8: IF(2,8,tP1_0_9)
                                        y$w_buff0 = weak$$choice2 ? y$w_buff0 : ((!y$w_buff0_used) || ((!y$r_buff0_thd2) && (!y$w_buff1_used))) || ((!y$r_buff0_thd2) && (!y$r_buff1_thd2)) ? y$w_buff0 : y$w_buff0_used && y$r_buff0_thd2 ? y$w_buff0 : y$w_buff0;
tP1_0_9: IF(2,9,tP1_0_10)
                                        y$w_buff1 = weak$$choice2 ? y$w_buff1 : ((!y$w_buff0_used) || ((!y$r_buff0_thd2) && (!y$w_buff1_used))) || ((!y$r_buff0_thd2) && (!y$r_buff1_thd2)) ? y$w_buff1 : y$w_buff0_used && y$r_buff0_thd2 ? y$w_buff1 : y$w_buff1;
tP1_0_10: IF(2,10,tP1_0_11)
                                        y$w_buff0_used = weak$$choice2 ? y$w_buff0_used : ((!y$w_buff0_used) || ((!y$r_buff0_thd2) && (!y$w_buff1_used))) || ((!y$r_buff0_thd2) && (!y$r_buff1_thd2)) ? y$w_buff0_used : y$w_buff0_used && y$r_buff0_thd2 ? (_Bool) 0 : y$w_buff0_used;
tP1_0_11: IF(2,11,tP1_0_12)
                                        y$w_buff1_used = weak$$choice2 ? y$w_buff1_used : ((!y$w_buff0_used) || ((!y$r_buff0_thd2) && (!y$w_buff1_used))) || ((!y$r_buff0_thd2) && (!y$r_buff1_thd2)) ? y$w_buff1_used : y$w_buff0_used && y$r_buff0_thd2 ? (_Bool) 0 : (_Bool) 0;
tP1_0_12: IF(2,12,tP1_0_13)
                                        y$r_buff0_thd2 = weak$$choice2 ? y$r_buff0_thd2 : ((!y$w_buff0_used) || ((!y$r_buff0_thd2) && (!y$w_buff1_used))) || ((!y$r_buff0_thd2) && (!y$r_buff1_thd2)) ? y$r_buff0_thd2 : y$w_buff0_used && y$r_buff0_thd2 ? (_Bool) 0 : y$r_buff0_thd2;
tP1_0_13: IF(2,13,tP1_0_14)
                                        y$r_buff1_thd2 = weak$$choice2 ? y$r_buff1_thd2 : ((!y$w_buff0_used) || ((!y$r_buff0_thd2) && (!y$w_buff1_used))) || ((!y$r_buff0_thd2) && (!y$r_buff1_thd2)) ? y$r_buff1_thd2 : y$w_buff0_used && y$r_buff0_thd2 ? (_Bool) 0 : (_Bool) 0;
tP1_0_14: IF(2,14,tP1_0_15)
                                        __unbuffered_p1_EAX = y;
tP1_0_15: IF(2,15,tP1_0_16)
                                        y = y$flush_delayed ? y$mem_tmp : y;
tP1_0_16: IF(2,16,tP1_0_17)
                                        y$flush_delayed = (_Bool) 0;
                                        __CSEQ_atomic_end();
tP1_0_17: IF(2,17,tP1_0_18)
                                        __CSEQ_atomic_begin();
tP1_0_18: IF(2,18,tP1_0_19)
                                        y = y$w_buff0_used && y$r_buff0_thd2 ? y$w_buff0 : y$w_buff1_used && y$r_buff1_thd2 ? y$w_buff1 : y;
tP1_0_19: IF(2,19,tP1_0_20)
                                        y$w_buff0_used = y$w_buff0_used && y$r_buff0_thd2 ? (_Bool) 0 : y$w_buff0_used;
tP1_0_20: IF(2,20,tP1_0_21)
                                        y$w_buff1_used = (y$w_buff0_used && y$r_buff0_thd2) || (y$w_buff1_used && y$r_buff1_thd2) ? (_Bool) 0 : y$w_buff1_used;
tP1_0_21: IF(2,21,tP1_0_22)
                                        y$r_buff0_thd2 = y$w_buff0_used && y$r_buff0_thd2 ? (_Bool) 0 : y$r_buff0_thd2;
tP1_0_22: IF(2,22,tP1_0_23)
                                        y$r_buff1_thd2 = (y$w_buff0_used && y$r_buff0_thd2) || (y$w_buff1_used && y$r_buff1_thd2) ? (_Bool) 0 : y$r_buff1_thd2;
                                        __CSEQ_atomic_end();
tP1_0_23: IF(2,23,tP1_0_24)
                                        __CSEQ_atomic_begin();
tP1_0_24: IF(2,24,tP1_0_25)
                                        __unbuffered_cnt = __unbuffered_cnt + 1;
                                        __CSEQ_atomic_end();
                                        goto __exit_P1;
                                        		;
                                        __exit_P1:
                                        		__CPROVER_assume(__cs_pc_cs[2] >= 25);
                                        		;
                                        		;
tP1_0_25: 
                                        STOP_NONVOID(25);
                                        }
void init_MEM(void)
{
		unsigned int TRACK_ADDRESS_tmp[13];
		TRACK_ADDRESS[0] = 0;
		TRACK_ADDRESS[1] = 1;
		TRACK_ADDRESS[2] = 2;
		TRACK_ADDRESS[3] = 3;
		TRACK_ADDRESS[4] = 4;
		TRACK_ADDRESS[5] = 5;
		TRACK_ADDRESS[6] = 6;
		TRACK_ADDRESS[7] = 7;
		TRACK_ADDRESS[8] = 8;
		TRACK_ADDRESS[9] = 9;
		TRACK_ADDRESS[10] = 10;
		TRACK_ADDRESS[11] = 11;
		TRACK_ADDRESS[12] = 12;
		TRACK_ADDRESS[13] = 13;
		TRACK_ADDRESS[14] = 14;
		TRACK_ADDRESS[15] = 15;
		TRACK_ADDRESS[16] = 16;
		num_malloc = 17;
		TRACK_ADDRESS[17] = TRACK_ADDRESS_tmp[0];
		__CPROVER_assume((TRACK_ADDRESS[17] <= 1000) & (TRACK_ADDRESS[17] > TRACK_ADDRESS[16]));
		TRACK_ADDRESS[18] = TRACK_ADDRESS_tmp[1];
		__CPROVER_assume((TRACK_ADDRESS[18] <= 1000) & (TRACK_ADDRESS[18] > TRACK_ADDRESS[17]));
		TRACK_ADDRESS[19] = TRACK_ADDRESS_tmp[2];
		__CPROVER_assume((TRACK_ADDRESS[19] <= 1000) & (TRACK_ADDRESS[19] > TRACK_ADDRESS[18]));
		TRACK_ADDRESS[20] = TRACK_ADDRESS_tmp[3];
		__CPROVER_assume((TRACK_ADDRESS[20] <= 1000) & (TRACK_ADDRESS[20] > TRACK_ADDRESS[19]));
		TRACK_ADDRESS[21] = TRACK_ADDRESS_tmp[4];
		__CPROVER_assume((TRACK_ADDRESS[21] <= 1000) & (TRACK_ADDRESS[21] > TRACK_ADDRESS[20]));
		TRACK_ADDRESS[22] = TRACK_ADDRESS_tmp[5];
		__CPROVER_assume((TRACK_ADDRESS[22] <= 1000) & (TRACK_ADDRESS[22] > TRACK_ADDRESS[21]));
		TRACK_ADDRESS[23] = TRACK_ADDRESS_tmp[6];
		__CPROVER_assume((TRACK_ADDRESS[23] <= 1000) & (TRACK_ADDRESS[23] > TRACK_ADDRESS[22]));
		TRACK_ADDRESS[24] = TRACK_ADDRESS_tmp[7];
		__CPROVER_assume((TRACK_ADDRESS[24] <= 1000) & (TRACK_ADDRESS[24] > TRACK_ADDRESS[23]));
		TRACK_ADDRESS[25] = TRACK_ADDRESS_tmp[8];
		__CPROVER_assume((TRACK_ADDRESS[25] <= 1000) & (TRACK_ADDRESS[25] > TRACK_ADDRESS[24]));
		TRACK_ADDRESS[26] = TRACK_ADDRESS_tmp[9];
		__CPROVER_assume((TRACK_ADDRESS[26] <= 1000) & (TRACK_ADDRESS[26] > TRACK_ADDRESS[25]));
		TRACK_ADDRESS[27] = TRACK_ADDRESS_tmp[10];
		__CPROVER_assume((TRACK_ADDRESS[27] <= 1000) & (TRACK_ADDRESS[27] > TRACK_ADDRESS[26]));
		TRACK_ADDRESS[28] = TRACK_ADDRESS_tmp[11];
		__CPROVER_assume((TRACK_ADDRESS[28] <= 1000) & (TRACK_ADDRESS[28] > TRACK_ADDRESS[27]));
		TRACK_ADDRESS[29] = TRACK_ADDRESS_tmp[12];
		__CPROVER_assume((TRACK_ADDRESS[29] <= 1000) & (TRACK_ADDRESS[29] > TRACK_ADDRESS[28]));
		TRACK_ADDRESS[30] = 1001;
}
                                        void *P1_0(void *__cs_param_P1_arg)
                                        {
IF(2,0,tP1_0_1)
                                        __CSEQ_atomic_begin();
tP1_0_1: IF(2,1,tP1_0_2)
                                        x$w_buff1 = x$w_buff0;
tP1_0_2: IF(2,2,tP1_0_3)
                                        x$w_buff0 = 2;
tP1_0_3: IF(2,3,tP1_0_4)
                                        x$w_buff1_used = x$w_buff0_used;
tP1_0_4: IF(2,4,tP1_0_5)
                                        x$w_buff0_used = (_Bool) 1;
tP1_0_5: IF(2,5,tP1_0_6)
                                        assert(!(x$w_buff1_used && x$w_buff0_used));
tP1_0_6: IF(2,6,tP1_0_7)
                                        x$r_buff1_thd0 = x$r_buff0_thd0;
tP1_0_7: IF(2,7,tP1_0_8)
                                        x$r_buff1_thd1 = x$r_buff0_thd1;
tP1_0_8: IF(2,8,tP1_0_9)
                                        x$r_buff1_thd2 = x$r_buff0_thd2;
tP1_0_9: IF(2,9,tP1_0_10)
                                        x$r_buff0_thd2 = (_Bool) 1;
                                        __CSEQ_atomic_end();
tP1_0_10: IF(2,10,tP1_0_11)
                                        __CSEQ_atomic_begin();
tP1_0_11: IF(2,11,tP1_0_12)
                                        y = 1;
                                        __CSEQ_atomic_end();
tP1_0_12: IF(2,12,tP1_0_13)
                                        __CSEQ_atomic_begin();
tP1_0_13: IF(2,13,tP1_0_14)
                                        __unbuffered_p1_EAX = y;
                                        __CSEQ_atomic_end();
tP1_0_14: IF(2,14,tP1_0_15)
                                        __CSEQ_atomic_begin();
tP1_0_15: IF(2,15,tP1_0_16)
                                        __unbuffered_p1_EBX = z;
                                        __CSEQ_atomic_end();
tP1_0_16: IF(2,16,tP1_0_17)
                                        __CSEQ_atomic_begin();
tP1_0_17: IF(2,17,tP1_0_18)
                                        x = x$w_buff0_used && x$r_buff0_thd2 ? x$w_buff0 : x$w_buff1_used && x$r_buff1_thd2 ? x$w_buff1 : x;
tP1_0_18: IF(2,18,tP1_0_19)
                                        x$w_buff0_used = x$w_buff0_used && x$r_buff0_thd2 ? (_Bool) 0 : x$w_buff0_used;
tP1_0_19: IF(2,19,tP1_0_20)
                                        x$w_buff1_used = (x$w_buff0_used && x$r_buff0_thd2) || (x$w_buff1_used && x$r_buff1_thd2) ? (_Bool) 0 : x$w_buff1_used;
tP1_0_20: IF(2,20,tP1_0_21)
                                        x$r_buff0_thd2 = x$w_buff0_used && x$r_buff0_thd2 ? (_Bool) 0 : x$r_buff0_thd2;
tP1_0_21: IF(2,21,tP1_0_22)
                                        x$r_buff1_thd2 = (x$w_buff0_used && x$r_buff0_thd2) || (x$w_buff1_used && x$r_buff1_thd2) ? (_Bool) 0 : x$r_buff1_thd2;
                                        __CSEQ_atomic_end();
tP1_0_22: IF(2,22,tP1_0_23)
                                        __CSEQ_atomic_begin();
tP1_0_23: IF(2,23,tP1_0_24)
                                        __unbuffered_cnt = __unbuffered_cnt + 1;
                                        __CSEQ_atomic_end();
                                        goto __exit_P1;
                                        		;
                                        __exit_P1:
                                        		__CPROVER_assume(__cs_pc_cs[2] >= 24);
                                        		;
                                        		;
tP1_0_24: 
                                        STOP_NONVOID(24);
                                        }
                                        void *P0_0(void *__cs_param_P0_arg)
                                        {
IF(1,0,tP0_0_1)
                                        __CSEQ_atomic_begin();
tP0_0_1: IF(1,1,tP0_0_2)
                                        weak$$choice0 = nondet_0();
tP0_0_2: IF(1,2,tP0_0_3)
                                        weak$$choice2 = nondet_0();
tP0_0_3: IF(1,3,tP0_0_4)
                                        y$flush_delayed = weak$$choice2;
tP0_0_4: IF(1,4,tP0_0_5)
                                        y$mem_tmp = y;
tP0_0_5: IF(1,5,tP0_0_6)
                                        weak$$choice1 = nondet_0();
tP0_0_6: IF(1,6,tP0_0_7)
                                        y = !y$w_buff0_used ? y : y$w_buff0_used && y$r_buff0_thd1 ? y$w_buff0 : ((y$w_buff0_used && (!y$r_buff1_thd1)) && y$w_buff1_used) && (!y$r_buff0_thd1) ? weak$$choice0 ? y : weak$$choice1 ? y$w_buff0 : y$w_buff1 : ((y$w_buff0_used && y$r_buff1_thd1) && y$w_buff1_used) && (!y$r_buff0_thd1) ? weak$$choice0 ? y$w_buff1 : y$w_buff0 : weak$$choice0 ? y$w_buff0 : y;
tP0_0_7: IF(1,7,tP0_0_8)
                                        y$w_buff0 = weak$$choice2 ? y$w_buff0 : !y$w_buff0_used ? y$w_buff0 : y$w_buff0_used && y$r_buff0_thd1 ? y$w_buff0 : ((y$w_buff0_used && (!y$r_buff1_thd1)) && y$w_buff1_used) && (!y$r_buff0_thd1) ? y$w_buff0 : ((y$w_buff0_used && y$r_buff1_thd1) && y$w_buff1_used) && (!y$r_buff0_thd1) ? y$w_buff0 : y$w_buff0;
tP0_0_8: IF(1,8,tP0_0_9)
                                        y$w_buff1 = weak$$choice2 ? y$w_buff1 : !y$w_buff0_used ? y$w_buff1 : y$w_buff0_used && y$r_buff0_thd1 ? y$w_buff1 : ((y$w_buff0_used && (!y$r_buff1_thd1)) && y$w_buff1_used) && (!y$r_buff0_thd1) ? y$w_buff1 : ((y$w_buff0_used && y$r_buff1_thd1) && y$w_buff1_used) && (!y$r_buff0_thd1) ? y$w_buff1 : y$w_buff1;
tP0_0_9: IF(1,9,tP0_0_10)
                                        y$w_buff0_used = weak$$choice2 ? y$w_buff0_used : !y$w_buff0_used ? y$w_buff0_used : y$w_buff0_used && y$r_buff0_thd1 ? (_Bool) 0 : ((y$w_buff0_used && (!y$r_buff1_thd1)) && y$w_buff1_used) && (!y$r_buff0_thd1) ? weak$$choice0 || (!weak$$choice1) : ((y$w_buff0_used && y$r_buff1_thd1) && y$w_buff1_used) && (!y$r_buff0_thd1) ? weak$$choice0 : weak$$choice0;
tP0_0_10: IF(1,10,tP0_0_11)
                                        y$w_buff1_used = weak$$choice2 ? y$w_buff1_used : !y$w_buff0_used ? y$w_buff1_used : y$w_buff0_used && y$r_buff0_thd1 ? (_Bool) 0 : ((y$w_buff0_used && (!y$r_buff1_thd1)) && y$w_buff1_used) && (!y$r_buff0_thd1) ? weak$$choice0 : ((y$w_buff0_used && y$r_buff1_thd1) && y$w_buff1_used) && (!y$r_buff0_thd1) ? (_Bool) 0 : (_Bool) 0;
tP0_0_11: IF(1,11,tP0_0_12)
                                        y$r_buff0_thd1 = weak$$choice2 ? y$r_buff0_thd1 : !y$w_buff0_used ? y$r_buff0_thd1 : y$w_buff0_used && y$r_buff0_thd1 ? (_Bool) 0 : ((y$w_buff0_used && (!y$r_buff1_thd1)) && y$w_buff1_used) && (!y$r_buff0_thd1) ? y$r_buff0_thd1 : ((y$w_buff0_used && y$r_buff1_thd1) && y$w_buff1_used) && (!y$r_buff0_thd1) ? (_Bool) 0 : (_Bool) 0;
tP0_0_12: IF(1,12,tP0_0_13)
                                        y$r_buff1_thd1 = weak$$choice2 ? y$r_buff1_thd1 : !y$w_buff0_used ? y$r_buff1_thd1 : y$w_buff0_used && y$r_buff0_thd1 ? (_Bool) 0 : ((y$w_buff0_used && (!y$r_buff1_thd1)) && y$w_buff1_used) && (!y$r_buff0_thd1) ? weak$$choice0 ? y$r_buff1_thd1 : (_Bool) 0 : ((y$w_buff0_used && y$r_buff1_thd1) && y$w_buff1_used) && (!y$r_buff0_thd1) ? (_Bool) 0 : (_Bool) 0;
tP0_0_13: IF(1,13,tP0_0_14)
                                        __unbuffered_p0_EAX$read_delayed = (_Bool) 1;
tP0_0_14: IF(1,14,tP0_0_15)
                                        __unbuffered_p0_EAX$read_delayed_var = &y;
tP0_0_15: IF(1,15,tP0_0_16)
                                        __unbuffered_p0_EAX = y;
tP0_0_16: IF(1,16,tP0_0_17)
                                        y = y$flush_delayed ? y$mem_tmp : y;
tP0_0_17: IF(1,17,tP0_0_18)
                                        y$flush_delayed = (_Bool) 0;
                                        __CSEQ_atomic_end();
tP0_0_18: IF(1,18,tP0_0_19)
                                        __CSEQ_atomic_begin();
tP0_0_19: IF(1,19,tP0_0_20)
                                        __unbuffered_p0_EBX = x;
                                        __CSEQ_atomic_end();
tP0_0_20: IF(1,20,tP0_0_21)
                                        __CSEQ_atomic_begin();
                                        __CSEQ_atomic_end();
tP0_0_21: IF(1,21,tP0_0_22)
                                        __CSEQ_atomic_begin();
tP0_0_22: IF(1,22,tP0_0_23)
                                        __unbuffered_cnt = __unbuffered_cnt + 1;
                                        __CSEQ_atomic_end();
                                        goto __exit_P0;
                                        		;
                                        __exit_P0:
                                        		__CPROVER_assume(__cs_pc_cs[1] >= 23);
                                        		;
                                        		;
tP0_0_23: 
                                        STOP_NONVOID(23);
                                        }
 void *__cs_safe_malloc(int __cs_size)
 {
 void *__cs_ptr = malloc(__cs_size);
 __CPROVER_assume(__cs_ptr);
 		return __cs_ptr;
 }
                                        void *P3_0(void *__cs_param_P3_arg)
                                        {
IF(4,0,tP3_0_1)
                                        __CSEQ_atomic_begin();
tP3_0_1: IF(4,1,tP3_0_2)
                                        z$w_buff1 = z$w_buff0;
tP3_0_2: IF(4,2,tP3_0_3)
                                        z$w_buff0 = 1;
tP3_0_3: IF(4,3,tP3_0_4)
                                        z$w_buff1_used = z$w_buff0_used;
tP3_0_4: IF(4,4,tP3_0_5)
                                        z$w_buff0_used = (_Bool) 1;
tP3_0_5: IF(4,5,tP3_0_6)
                                        assert(!(z$w_buff1_used && z$w_buff0_used));
tP3_0_6: IF(4,6,tP3_0_7)
                                        z$r_buff1_thd0 = z$r_buff0_thd0;
tP3_0_7: IF(4,7,tP3_0_8)
                                        z$r_buff1_thd1 = z$r_buff0_thd1;
tP3_0_8: IF(4,8,tP3_0_9)
                                        z$r_buff1_thd2 = z$r_buff0_thd2;
tP3_0_9: IF(4,9,tP3_0_10)
                                        z$r_buff1_thd3 = z$r_buff0_thd3;
tP3_0_10: IF(4,10,tP3_0_11)
                                        z$r_buff1_thd4 = z$r_buff0_thd4;
tP3_0_11: IF(4,11,tP3_0_12)
                                        z$r_buff0_thd4 = (_Bool) 1;
                                        __CSEQ_atomic_end();
tP3_0_12: IF(4,12,tP3_0_13)
                                        __CSEQ_atomic_begin();
tP3_0_13: IF(4,13,tP3_0_14)
                                        weak$$choice0 = nondet_1();
tP3_0_14: IF(4,14,tP3_0_15)
                                        weak$$choice2 = nondet_1();
tP3_0_15: IF(4,15,tP3_0_16)
                                        z$flush_delayed = weak$$choice2;
tP3_0_16: IF(4,16,tP3_0_17)
                                        z$mem_tmp = z;
tP3_0_17: IF(4,17,tP3_0_18)
                                        z = ((!z$w_buff0_used) || ((!z$r_buff0_thd4) && (!z$w_buff1_used))) || ((!z$r_buff0_thd4) && (!z$r_buff1_thd4)) ? z : z$w_buff0_used && z$r_buff0_thd4 ? z$w_buff0 : z$w_buff1;
tP3_0_18: IF(4,18,tP3_0_19)
                                        z$w_buff0 = weak$$choice2 ? z$w_buff0 : ((!z$w_buff0_used) || ((!z$r_buff0_thd4) && (!z$w_buff1_used))) || ((!z$r_buff0_thd4) && (!z$r_buff1_thd4)) ? z$w_buff0 : z$w_buff0_used && z$r_buff0_thd4 ? z$w_buff0 : z$w_buff0;
tP3_0_19: IF(4,19,tP3_0_20)
                                        z$w_buff1 = weak$$choice2 ? z$w_buff1 : ((!z$w_buff0_used) || ((!z$r_buff0_thd4) && (!z$w_buff1_used))) || ((!z$r_buff0_thd4) && (!z$r_buff1_thd4)) ? z$w_buff1 : z$w_buff0_used && z$r_buff0_thd4 ? z$w_buff1 : z$w_buff1;
tP3_0_20: IF(4,20,tP3_0_21)
                                        z$w_buff0_used = weak$$choice2 ? z$w_buff0_used : ((!z$w_buff0_used) || ((!z$r_buff0_thd4) && (!z$w_buff1_used))) || ((!z$r_buff0_thd4) && (!z$r_buff1_thd4)) ? z$w_buff0_used : z$w_buff0_used && z$r_buff0_thd4 ? (_Bool) 0 : z$w_buff0_used;
tP3_0_21: IF(4,21,tP3_0_22)
                                        z$w_buff1_used = weak$$choice2 ? z$w_buff1_used : ((!z$w_buff0_used) || ((!z$r_buff0_thd4) && (!z$w_buff1_used))) || ((!z$r_buff0_thd4) && (!z$r_buff1_thd4)) ? z$w_buff1_used : z$w_buff0_used && z$r_buff0_thd4 ? (_Bool) 0 : (_Bool) 0;
tP3_0_22: IF(4,22,tP3_0_23)
                                        z$r_buff0_thd4 = weak$$choice2 ? z$r_buff0_thd4 : ((!z$w_buff0_used) || ((!z$r_buff0_thd4) && (!z$w_buff1_used))) || ((!z$r_buff0_thd4) && (!z$r_buff1_thd4)) ? z$r_buff0_thd4 : z$w_buff0_used && z$r_buff0_thd4 ? (_Bool) 0 : z$r_buff0_thd4;
tP3_0_23: IF(4,23,tP3_0_24)
                                        z$r_buff1_thd4 = weak$$choice2 ? z$r_buff1_thd4 : ((!z$w_buff0_used) || ((!z$r_buff0_thd4) && (!z$w_buff1_used))) || ((!z$r_buff0_thd4) && (!z$r_buff1_thd4)) ? z$r_buff1_thd4 : z$w_buff0_used && z$r_buff0_thd4 ? (_Bool) 0 : (_Bool) 0;
tP3_0_24: IF(4,24,tP3_0_25)
                                        __unbuffered_p3_EAX = z;
tP3_0_25: IF(4,25,tP3_0_26)
                                        z = z$flush_delayed ? z$mem_tmp : z;
tP3_0_26: IF(4,26,tP3_0_27)
                                        z$flush_delayed = (_Bool) 0;
                                        __CSEQ_atomic_end();
tP3_0_27: IF(4,27,tP3_0_28)
                                        __CSEQ_atomic_begin();
tP3_0_28: IF(4,28,tP3_0_29)
                                        __unbuffered_p3_EBX = a;
                                        __CSEQ_atomic_end();
tP3_0_29: IF(4,29,tP3_0_30)
                                        __CSEQ_atomic_begin();
tP3_0_30: IF(4,30,tP3_0_31)
                                        z = z$w_buff0_used && z$r_buff0_thd4 ? z$w_buff0 : z$w_buff1_used && z$r_buff1_thd4 ? z$w_buff1 : z;
tP3_0_31: IF(4,31,tP3_0_32)
                                        z$w_buff0_used = z$w_buff0_used && z$r_buff0_thd4 ? (_Bool) 0 : z$w_buff0_used;
tP3_0_32: IF(4,32,tP3_0_33)
                                        z$w_buff1_used = (z$w_buff0_used && z$r_buff0_thd4) || (z$w_buff1_used && z$r_buff1_thd4) ? (_Bool) 0 : z$w_buff1_used;
tP3_0_33: IF(4,33,tP3_0_34)
                                        z$r_buff0_thd4 = z$w_buff0_used && z$r_buff0_thd4 ? (_Bool) 0 : z$r_buff0_thd4;
tP3_0_34: IF(4,34,tP3_0_35)
                                        z$r_buff1_thd4 = (z$w_buff0_used && z$r_buff0_thd4) || (z$w_buff1_used && z$r_buff1_thd4) ? (_Bool) 0 : z$r_buff1_thd4;
                                        __CSEQ_atomic_end();
tP3_0_35: IF(4,35,tP3_0_36)
                                        __CSEQ_atomic_begin();
tP3_0_36: IF(4,36,tP3_0_37)
                                        __unbuffered_cnt = __unbuffered_cnt + 1;
                                        __CSEQ_atomic_end();
                                        goto __exit_P3;
                                        		;
                                        __exit_P3:
                                        		__CPROVER_assume(__cs_pc_cs[4] >= 37);
                                        		;
                                        		;
tP3_0_37: 
                                        STOP_NONVOID(37);
                                        }
 int __cs_cond_wait_2(__cs_cond_t *__cs_cond_to_wait_for, __cs_mutex_t *__cs_m)
 {
 __CPROVER_assume((*__cs_cond_to_wait_for) == 1);
 __cs_mutex_lock(__cs_m);
 return 0;
 }
예제 #22
0
파일: unit_vc.c 프로젝트: ahorn/benchmarks
static void vc_combine_upper_bound_cbmc(void)
{
  unsigned size1, size2;
  __CPROVER_assume(size1 <= VC_PREALLOCATED/2);
  __CPROVER_assume(size2 <= VC_PREALLOCATED/2);

  VectorClock vc1;
  VCElem vc1elem[size1];

  VectorClock vc2;
  VCElem vc2elem[size2];

  VectorClock vc1_copy;
  VCElem vc1_copyelem[size1];

  VC_PRE(vc1elem, size1)
  VC_PRE(vc2elem, size2)

  DRD_(vc_init)(&vc1, vc1elem, size1);
  DRD_(vc_init)(&vc2, vc2elem, size2);

  if (0 < size1) __CPROVER_assume(vc1elem[0].threadid == vc1_copyelem[0].threadid);
  if (0 < size1) __CPROVER_assume(vc1elem[0].count == vc1_copyelem[0].count);

  if (1 < size1) __CPROVER_assume(vc1elem[1].threadid == vc1_copyelem[1].threadid);
  if (1 < size1) __CPROVER_assume(vc1elem[1].count == vc1_copyelem[1].count);

  if (2 < size1) __CPROVER_assume(vc1elem[2].threadid == vc1_copyelem[2].threadid);
  if (2 < size1) __CPROVER_assume(vc1elem[2].count == vc1_copyelem[2].count);

  if (3 < size1) __CPROVER_assume(vc1elem[3].threadid == vc1_copyelem[3].threadid);
  if (3 < size1) __CPROVER_assume(vc1elem[3].count == vc1_copyelem[3].count);

  if (4 < size1) __CPROVER_assume(vc1elem[4].threadid == vc1_copyelem[4].threadid);
  if (4 < size1) __CPROVER_assume(vc1elem[4].count == vc1_copyelem[4].count);

  if (5 < size1) __CPROVER_assume(vc1elem[5].threadid == vc1_copyelem[5].threadid);
  if (5 < size1) __CPROVER_assume(vc1elem[5].count == vc1_copyelem[5].count);

  if (6 < size1) __CPROVER_assume(vc1elem[6].threadid == vc1_copyelem[6].threadid);
  if (6 < size1) __CPROVER_assume(vc1elem[6].count == vc1_copyelem[6].count);

  if (7 < size1) __CPROVER_assume(vc1elem[7].threadid == vc1_copyelem[7].threadid);
  if (7 < size1) __CPROVER_assume(vc1elem[7].count == vc1_copyelem[7].count);

  DRD_(vc_init)(&vc1_copy, vc1_copyelem, size1);

  assert(vc1.capacity == vc1_copy.capacity);
  assert(vc1.size == vc1_copy.size);

  // make vc1_copy an upper bound of vc1 and vc2
  DRD_(vc_combine)(&vc1_copy, &vc2);

  assert(DRD_(vc_lte)(&vc1, &vc1_copy) == 1);
  assert(DRD_(vc_lte)(&vc2, &vc1_copy) == 1);
}
                                        int main_thread(void)
                                        {
                                        		;
IF(0,0,tmain_1)
                                        __cs_create(0, 0, P0_0, 0, 1);
tmain_1: IF(0,1,tmain_2)
                                        __cs_create(0, 0, P1_0, 0, 2);
tmain_2: IF(0,2,tmain_3)
                                        __cs_create(0, 0, P2_0, 0, 3);
tmain_3: IF(0,3,tmain_4)
                                        __CSEQ_atomic_begin();
tmain_4: IF(0,4,tmain_5)
                                        main$tmp_guard0 = __unbuffered_cnt == 3;
                                        __CSEQ_atomic_end();
tmain_5: IF(0,5,tmain_6)
                                        __CPROVER_assume(main$tmp_guard0);
tmain_6: IF(0,6,tmain_7)
                                        __CSEQ_atomic_begin();
tmain_7: IF(0,7,tmain_8)
                                        x = x$w_buff0_used && x$r_buff0_thd0 ? x$w_buff0 : x$w_buff1_used && x$r_buff1_thd0 ? x$w_buff1 : x;
tmain_8: IF(0,8,tmain_9)
                                        x$w_buff0_used = x$w_buff0_used && x$r_buff0_thd0 ? (_Bool) 0 : x$w_buff0_used;
tmain_9: IF(0,9,tmain_10)
                                        x$w_buff1_used = (x$w_buff0_used && x$r_buff0_thd0) || (x$w_buff1_used && x$r_buff1_thd0) ? (_Bool) 0 : x$w_buff1_used;
tmain_10: IF(0,10,tmain_11)
                                        x$r_buff0_thd0 = x$w_buff0_used && x$r_buff0_thd0 ? (_Bool) 0 : x$r_buff0_thd0;
tmain_11: IF(0,11,tmain_12)
                                        x$r_buff1_thd0 = (x$w_buff0_used && x$r_buff0_thd0) || (x$w_buff1_used && x$r_buff1_thd0) ? (_Bool) 0 : x$r_buff1_thd0;
                                        __CSEQ_atomic_end();
tmain_12: IF(0,12,tmain_13)
                                        __CSEQ_atomic_begin();
tmain_13: IF(0,13,tmain_14)
                                        weak$$choice0 = nondet_0();
tmain_14: IF(0,14,tmain_15)
                                        weak$$choice2 = nondet_0();
tmain_15: IF(0,15,tmain_16)
                                        x$flush_delayed = weak$$choice2;
tmain_16: IF(0,16,tmain_17)
                                        x$mem_tmp = x;
tmain_17: IF(0,17,tmain_18)
                                        x = ((!x$w_buff0_used) || ((!x$r_buff0_thd0) && (!x$w_buff1_used))) || ((!x$r_buff0_thd0) && (!x$r_buff1_thd0)) ? x : x$w_buff0_used && x$r_buff0_thd0 ? x$w_buff0 : x$w_buff1;
tmain_18: IF(0,18,tmain_19)
                                        x$w_buff0 = weak$$choice2 ? x$w_buff0 : ((!x$w_buff0_used) || ((!x$r_buff0_thd0) && (!x$w_buff1_used))) || ((!x$r_buff0_thd0) && (!x$r_buff1_thd0)) ? x$w_buff0 : x$w_buff0_used && x$r_buff0_thd0 ? x$w_buff0 : x$w_buff0;
tmain_19: IF(0,19,tmain_20)
                                        x$w_buff1 = weak$$choice2 ? x$w_buff1 : ((!x$w_buff0_used) || ((!x$r_buff0_thd0) && (!x$w_buff1_used))) || ((!x$r_buff0_thd0) && (!x$r_buff1_thd0)) ? x$w_buff1 : x$w_buff0_used && x$r_buff0_thd0 ? x$w_buff1 : x$w_buff1;
tmain_20: IF(0,20,tmain_21)
                                        x$w_buff0_used = weak$$choice2 ? x$w_buff0_used : ((!x$w_buff0_used) || ((!x$r_buff0_thd0) && (!x$w_buff1_used))) || ((!x$r_buff0_thd0) && (!x$r_buff1_thd0)) ? x$w_buff0_used : x$w_buff0_used && x$r_buff0_thd0 ? (_Bool) 0 : x$w_buff0_used;
tmain_21: IF(0,21,tmain_22)
                                        x$w_buff1_used = weak$$choice2 ? x$w_buff1_used : ((!x$w_buff0_used) || ((!x$r_buff0_thd0) && (!x$w_buff1_used))) || ((!x$r_buff0_thd0) && (!x$r_buff1_thd0)) ? x$w_buff1_used : x$w_buff0_used && x$r_buff0_thd0 ? (_Bool) 0 : (_Bool) 0;
tmain_22: IF(0,22,tmain_23)
                                        x$r_buff0_thd0 = weak$$choice2 ? x$r_buff0_thd0 : ((!x$w_buff0_used) || ((!x$r_buff0_thd0) && (!x$w_buff1_used))) || ((!x$r_buff0_thd0) && (!x$r_buff1_thd0)) ? x$r_buff0_thd0 : x$w_buff0_used && x$r_buff0_thd0 ? (_Bool) 0 : x$r_buff0_thd0;
tmain_23: IF(0,23,tmain_24)
                                        x$r_buff1_thd0 = weak$$choice2 ? x$r_buff1_thd0 : ((!x$w_buff0_used) || ((!x$r_buff0_thd0) && (!x$w_buff1_used))) || ((!x$r_buff0_thd0) && (!x$r_buff1_thd0)) ? x$r_buff1_thd0 : x$w_buff0_used && x$r_buff0_thd0 ? (_Bool) 0 : (_Bool) 0;
tmain_24: IF(0,24,tmain_25)
                                        main$tmp_guard1 = !((((x == 2) && (y == 2)) && (__unbuffered_p0_EAX == 0)) && (__unbuffered_p1_EAX == 1));
tmain_25: IF(0,25,tmain_26)
                                        x = x$flush_delayed ? x$mem_tmp : x;
tmain_26: IF(0,26,tmain_27)
                                        x$flush_delayed = (_Bool) 0;
                                        __CSEQ_atomic_end();
tmain_27: IF(0,27,tmain_28)
                                        assert(main$tmp_guard1);
                                        goto __exit_main;
                                        		;
                                        __exit_main:
                                        		__CPROVER_assume(__cs_pc_cs[0] >= 28);
                                        		;
                                        		;
tmain_28: 
                                        STOP_NONVOID(28);
                                        }
예제 #24
0
void lock(){
  __CPROVER_atomic_begin();
  __CPROVER_assume(_lock==0);
  _lock = 1;
  __CPROVER_atomic_end();
};