예제 #1
0
파일: tcas.c 프로젝트: JamMarHer/RepairBox
int alt_sep_test()
{
    bool enabled, tcas_equipped, intent_not_known;
    bool need_upward_RA, need_downward_RA;
    int alt_sep;

    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))
    {
	need_upward_RA = Non_Crossing_Biased_Climb() && Own_Below_Threat();
	need_downward_RA = Non_Crossing_Biased_Descend() && Own_Above_Threat();
	if (need_upward_RA && need_downward_RA)
        /* unreachable: requires Own_Below_Threat and Own_Above_Threat
           to both be true - 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;
    }
    
    return alt_sep;
}
예제 #2
0
파일: tcas.c 프로젝트: hmohit/compiler-701
bool Non_Crossing_Biased_Climb()
{
    int upward_preferred;
    int upward_crossing_situation;
    bool result;
    upward_preferred = Inhibit_Biased_Climb() > Down_Separation;
    if (upward_preferred)
    {
 result = !(Own_Below_Threat()) || ((Own_Below_Threat()) && (!(Down_Separation >= ALIM())));
    }
    else
    {
 result = Own_Above_Threat() && (Cur_Vertical_Sep >= 300) && (Up_Separation >= ALIM());
    }
    return result;
}
예제 #3
0
int Non_Crossing_Biased_Descend()
{
int upward_preferred;
int upward_crossing_situation;
int result;
CREST_int(Cur_Vertical_Sep);
CREST_int(High_Confidence);
CREST_int(Two_of_Three_Reports_Valid);
CREST_int(Own_Tracked_Alt);
CREST_int(Own_Tracked_Alt_Rate);
CREST_int(Other_Tracked_Alt);
CREST_int(Alt_Layer_Value);
CREST_int(Positive_RA_Alt_Thresh);
CREST_int(Up_Separation);
CREST_int(Down_Separation);


upward_preferred = Inhibit_Biased_Climb() > Down_Separation;
if (upward_preferred)
{
result = Own_Below_Threat() && (Cur_Vertical_Sep >= MINSEP) && (Down_Separation >= ALIM());
}
else
{
result = !(Own_Above_Threat()) || ((Own_Above_Threat()) && (Up_Separation >= ALIM()));
}
return result;
}
예제 #4
0
bool Non_Crossing_Biased_Climb()
{
    int* __CREST_p4 = (int*)malloc(sizeof(int)*10);
    addToArray((void**)&__CREST_p4,4);
    int upward_preferred;
    int upward_crossing_situation;
    bool result;

    upward_preferred = Inhibit_Biased_Climb() > Down_Separation;
    if (upward_preferred)
    {
	result = !(Own_Below_Threat()) || ((Own_Below_Threat()) && (!(Down_Separation >= ALIM())));
    }
    else
    {	
	result = Own_Above_Threat() && (Cur_Vertical_Sep >= MINSEP) && (Up_Separation >= ALIM());
    }
    return result;
}
예제 #5
0
파일: tcas_1a.c 프로젝트: tracer-x/tracer
bool Non_Crossing_Biased_Climb()
{
    unsigned upward_preferred /* = 0 */ ;
    unsigned upward_crossing_situation;
    //bool result = 0 ;
    // unsigned alim = ALIM() ;
    // New variables added ...
    bool result;
    unsigned alim;    
    unsigned temp1;
    bool temp2,temp3;

    upward_preferred = 0 ;
    /******************************************/
    /* Coded added due to compiler limitation */
    /******************************************/
    result=0;
    alim = ALIM() ;
    /******************************************/

    /******************************************/
    /* Coded added due to compiler limitation */
    /******************************************/
    // if ( Inhibit_Biased_Climb() > Down_Separation )
    temp1 = Inhibit_Biased_Climb();
    if (temp1 > Down_Separation )
    /***************************************/
      upward_preferred = 1 ;
    if (upward_preferred==1)
    {
      /******************************************/
      /* Coded added due to compiler limitation */
      /******************************************/
      //if ( !(Own_Below_Threat()) || ((Own_Below_Threat()) && (!(Down_Separation >= alim))) )
      temp2 = Own_Below_Threat();
      if ( !temp2 || (temp2 && (!(Down_Separation >= alim))) )      
      /***************************************/
        result = 1 ;
    }
    else
    {
      /******************************************/
      /* Coded added due to compiler limitation */
      /******************************************/
      //if ( Own_Above_Threat() && (Cur_Vertical_Sep >= 300) && (Up_Separation >= alim) )
      temp3= Own_Above_Threat();
        if ( temp3 && (Cur_Vertical_Sep >= 300) && (Up_Separation >= alim) )
      /***************************************/
          result = 1 ;
    }
    // LEAVING_NON_CROSSING_BIASED_CLIMB:
    return result;
}
예제 #6
0
파일: tcas.c 프로젝트: JamMarHer/RepairBox
bool Non_Crossing_Biased_Descend()
{
    int upward_preferred;
    int upward_crossing_situation;
    bool result;

    upward_preferred = (Up_Separation + NOZCROSS) > Down_Separation;
    if (upward_preferred)
    {
	result = Own_Below_Threat() && (Cur_Vertical_Sep >= MINSEP) && (Down_Separation >= ALIM());
    }
    else
    {
	result = !(Own_Above_Threat()) || ((Own_Above_Threat()) && (Up_Separation >= ALIM()));
    }
    return result;
}
예제 #7
0
파일: tcas.c 프로젝트: belolourenco/sniper
bool Non_Crossing_Biased_Descend()
{
    int upward_preferred;
    int upward_crossing_situation;
    bool result;

    upward_preferred = Inhibit_Biased_Climb() > Down_Separation;
    if (upward_preferred)
    {
	result = Own_Below_Threat() && (Cur_Vertical_Sep >= MINSEP) && (Down_Separation >= ALIM());
	result = result && (Other_Tracked_Alt < Own_Tracked_Alt);
    }
    else
    {
	result = !(Own_Above_Threat()) || ((Own_Above_Threat()) && (Up_Separation >= ALIM()));
	result = result && (Other_Tracked_Alt /* op */ <= Own_Tracked_Alt);
    }
    return result;
}
예제 #8
0
파일: tcas.c 프로젝트: hmohit/compiler-701
int alt_sep_test()
{
    bool enabled, tcas_equipped, intent_not_known;
    bool need_upward_RA, need_downward_RA;
    int alt_sep;
    enabled = High_Confidence && (Own_Tracked_Alt_Rate <= 600) && (Cur_Vertical_Sep > 600);
    tcas_equipped = Other_Capability == 1;
    intent_not_known = Two_of_Three_Reports_Valid && Other_RAC == 0;
    alt_sep = 0;
    if (enabled && ((tcas_equipped && intent_not_known) || !tcas_equipped))
    {
 need_upward_RA = Non_Crossing_Biased_Climb() && Own_Below_Threat();
 need_downward_RA = Non_Crossing_Biased_Descend() && Own_Above_Threat();
 if (need_upward_RA && need_downward_RA)
     alt_sep = 0;
 else if (need_upward_RA)
     alt_sep = 1;
 else if (need_downward_RA)
     alt_sep = 2;
 else
     alt_sep = 0;
    }
    return alt_sep;
}
예제 #9
0
파일: tcas_4b.c 프로젝트: tracer-x/tracer
unsigned alt_sep_test()
{
    bool enabled=0, tcas_equipped=0, intent_not_known=0;
    bool need_upward_RA=0, need_downward_RA=0;
    unsigned alt_sep;
    // The compiler fails here
    //unsigned alim = ALIM() ;
    unsigned alim;
    // New variables added ....
    bool temp1,temp2,temp3,temp4;

    alim = ALIM();
    if ( High_Confidence && (Own_Tracked_Alt_Rate <= 600) && (Cur_Vertical_Sep > 600) )
      enabled = 1 ;
    if ( Other_Capability == 0 )
      tcas_equipped = 1 ;
    if ( Two_of_Three_Reports_Valid && Other_RAC == 0 )
      intent_not_known = 1 ;

    alt_sep = 0;

    if (enabled && ((tcas_equipped && intent_not_known) || !tcas_equipped))
    {
      /******************************************/
      /* Coded added due to compiler limitation */
      /******************************************/
      temp1 = Non_Crossing_Biased_Climb();
      temp2 = Own_Below_Threat();
      //if ( Non_Crossing_Biased_Climb() && Own_Below_Threat() )
      /******************************************/
      if ( temp1 && temp2 )
        {
          need_upward_RA = 1 ;
        }
      /******************************************/
      /* Coded added due to compiler limitation */
      /******************************************/
      temp3 = Non_Crossing_Biased_Descend();
      temp4 = Own_Above_Threat();
      //if ( Non_Crossing_Biased_Descend() && Own_Above_Threat() )
      if ( temp3 && temp4 )
        {
          need_downward_RA = 1 ;
        }
      if (need_upward_RA && need_downward_RA)
        {
          alt_sep = 0;
        }
      else if (need_upward_RA)
        {
	  /*property1b(alim) ;*/
	  //	  _ABORT(Up_Separation < alim && Down_Separation >= alim);
	  /*property2b(alim) ;*/
	  //	  _ABORT(Up_Separation < alim && Down_Separation < alim && Up_Separation < Down_Separation);
	  /*property3b(alim) ;*/
	  //	  _ABORT(Up_Separation >= alim && Down_Separation >= alim && Own_Tracked_Alt > Other_Tracked_Alt);
	  /*property4b() ;*/
	  _TRACER_abort(Own_Tracked_Alt < Other_Tracked_Alt);
	  //_DECOMPILE_ABORT(Own_Tracked_Alt < Other_Tracked_Alt);
	  /*property5b() ;*/
	  //	  _ABORT(Up_Separation < Down_Separation);	 
	  alt_sep = 1;
        }
        else if (need_downward_RA)
        {

          /*property1a(alim) ;*/
	  //	  _ABORT( Up_Separation >= alim && Down_Separation < alim );                
	  /*property2a(alim) ;*/
	  //	  _ABORT(Up_Separation < alim && Down_Separation < alim && Up_Separation > Down_Separation);
	  /*property3a(alim) ;*/
	  //          _ABORT(Up_Separation >= alim && Down_Separation >= alim && Own_Tracked_Alt > Other_Tracked_Alt);
	  /*property4a() ;*/
	  //          _ABORT(Own_Tracked_Alt > Other_Tracked_Alt);
	  /* property5a() ;*/
	  //          _ABORT(Up_Separation > Down_Separation);
	  alt_sep = 2;
        }
        else
	  alt_sep = 0;
    }

    return alt_sep;
}