亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? to_t_system.cpp

?? vxworks的系統故障診斷項目
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
// Create a clause if it is in the background

void to_t_system::createBackground(const L2rClause *pL2rClause) {
  if (pL2rClause->isInBackground()) {
    // background clauses are 'state' constraints by definition
    expandClause(pL2rClause, true);
  }
}

// Handle a Clause with any number of Variable1 == Variable2 Propositions

void to_t_system::expandClauseEquality(const Slist<const L2rPropVarVar*>&
				       equality,
				       T_system::Proto_assignment_list& pos,
				       T_system::Proto_assignment_list& neg,
				       bool state_constr) {
  Slist<Partition*> stack; // stack of Partition to avoid recursion
  stack.push_front(new Partition(pos, neg, equality)); // the initial Partition
  while (!stack.empty()) {
    // Pop the top element from the stack; note that this takes two operations.
    Partition* pPartition = stack.front(); stack.pop_front();
    // Extract the lists of Propositions
    T_system::Proto_assignment_list& positiveSingles =
      pPartition->getPositiveSingles();
    T_system::Proto_assignment_list& negativeSingles =
      pPartition->getNegativeSingles();
    const Slist<const L2rPropVarVar*>& duals = pPartition->getDuals();
    if (duals.empty()) { // the base step; create the Clause
      t_system->create_constraint(positiveSingles, negativeSingles, false,
				  true, state_constr);
    } else { // a recursive step
      // Non-destructively retrieve the first L2rPropVarVar
      const L2rPropVarVar* pL2rPropVarVar = duals.front();
      // Take the "cdr" of the duals list; note that this takes two operations.
      Slist<const L2rPropVarVar*> tail(duals); tail.pop_front();
      // The two Variables must be of the same type
      L2_assert(pL2rPropVarVar->var()->type() ==
		pL2rPropVarVar->otherVar()->type(),
		L2_reader_error,
		("Type mismatch in equality"));
      // Get the Variables as known in the T_system; and the domain
      Variable* pVariable1 = findVar(pL2rPropVarVar->var());
      Variable* pVariable2 = findVar(pL2rPropVarVar->otherVar());
      const L2rEnumeration* pL2rEnumeration = pL2rPropVarVar->var()->type();
      const unsigned domainCardinality = pL2rEnumeration->nmembers();
      if (pL2rPropVarVar->isPositive()) {
	// positive: create clauses (c is the current list in neg/pos)
	//   foreach i in domain[v],
	//      c  !v1=i v2=i               (v1=i implies v2=i)
	//      c  !v2=i v1=i               (v2=i implies v1=i)
	for (unsigned i = 0 ; i < domainCardinality; i++) {
	  unsigned j = domainCardinality - i - 1; // to pass regression tests
	  {
	    // c !v1=i v2=i; v1 == i ==> v2 == i 
	    Partition* p = new Partition(pos, neg, tail); // delete when popped
	    p->getNegativeSingles().push(
	      T_system::Proto_assignment(pVariable1, j)
	    );
	    p->getPositiveSingles().push(
	      T_system::Proto_assignment(pVariable2, j)
	    );
	    stack.push_front(p);
	  }
	  {
	    // c  !v2=i v1=i; v2 == i ==> v1 == i
	    Partition* p = new Partition(pos, neg, tail); // delete when popped
	    p->getNegativeSingles().push(
	      T_system::Proto_assignment(pVariable2, j)
	    );
	    p->getPositiveSingles().push(
	      T_system::Proto_assignment(pVariable1, j)
	    );
	    stack.push_front(p);
	  }
	}
      } else {
	// negative:
	//   foreach i in domain[v],
	//      c  !v1=i !v2=i              (v1=i implies v2!=i and v-v)
	for (unsigned i = 0; i < domainCardinality; i++) {
	  unsigned j = domainCardinality - i - 1; // to pass regression tests
	  // c  !v1=i !v2=i; v1 == i ==> v2 != i
	  Partition* p = new Partition(pos, neg, tail); // delete when popped 
	  p->getNegativeSingles().push(T_system::Proto_assignment(pVariable1,
								  j));
	  p->getNegativeSingles().push(T_system::Proto_assignment(pVariable2,
								  j));
	  stack.push_front(p);
	} // end for
      } // end else
    } // end else
    delete pPartition; // done with this "stack frame"
  }
}


// Create a Clause from an L2rClause

void to_t_system::expandClause(const L2rClause *pL2rClause,
			       bool state_constr) {
#ifndef DISABLE_TO_T_SYSTEM_LISTEN
  if (internal_tms_listen) {
    internal_tms_listen->creating_from_variable = false;
    internal_tms_listen->cls = pL2rClause;
  }
#endif

  T_system::Proto_assignment_list pos(pL2rClause->nprops());
  T_system::Proto_assignment_list neg(pL2rClause->nprops());

  // A Variable1 == Variable2 L2rProposition in the L2rClause, if there is any
  Slist<const L2rPropVarVar*> equality;

  for (unsigned i = 0; i < pL2rClause->nprops(); i++) {
    const L2rProposition *pL2rProposition = pL2rClause->prop(i);
    if (pL2rProposition->isEquality()) {
      equality.push_front(static_cast<const L2rPropVarVar*>(pL2rProposition));
    } else {
      // Variable == Value
      // Downcast
      const L2rPropVarValue *pL2rPropVarValue =
	static_cast<const L2rPropVarValue*>(pL2rProposition);
      // Find the Proposition's Variable and value index
      Variable *pVariable = findVar(pL2rPropVarValue->var());
      int valueIndex = pL2rPropVarValue->value();
      if (pL2rPropVarValue->isPositive()) {
	pos.push(T_system::Proto_assignment(pVariable, valueIndex));
      } else {
	neg.push(T_system::Proto_assignment(pVariable, valueIndex));
      }
    }
  }

  expandClauseEquality(equality, pos, neg, state_constr);
}


// Create a Transitioned from an L2rTransition

void to_t_system::createTransition(Transitioned *pTransitioned,
				   const L2rTransition *pL2rTransition,
				   unsigned transition_value) {
  unsigned rank = pL2rTransition->rank();
  if (rank != 0) { // Non-default cost/rank
    pTransitioned->add_transition_cost(static_cast<Assignment::weight_t>(rank));
  }

  if (pL2rTransition->nclauses() == 0) {
    if (pL2rTransition->isFailure()) {
      // Add an autonomous transition; no from
      pTransitioned->add_failure_prototype(transition_value,
					   pL2rTransition->to());
    } else {
      // Add an idle transition; from == to
      L2_assert(pL2rTransition->from() == pL2rTransition->to(),
		L2_reader_error,
		("non-idle non-failure uncommanded transition"));
      pTransitioned->add_idle_prototype(pL2rTransition->to());
    }
  } else {
    // Add a nominal transition
    for (unsigned i = 0; i < pL2rTransition->nclauses(); ++i) {
      const L2rClause *pL2rClause = pL2rTransition->clause(i);

      // Collect the positive and negative assignments
      Slist<T_system::Proto_assignment> pos;
      Slist<T_system::Proto_assignment> neg;
      for (unsigned j = 0; j < pL2rClause->nprops(); ++j) {
	const L2rProposition *pL2rProposition = pL2rClause->prop(j);
	// A Transition can not assert Variable1 == Variable2
	L2_assert(!pL2rProposition->isEquality(),
		  L2_reader_error,
		  ("found equality as guard condition"));
	// Cast as L2rPropVarValue (Variable == Value)
	const L2rPropVarValue *pL2rPropVarValue =
	  static_cast<const L2rPropVarValue*>(pL2rProposition);
	Variable *pVariable = findVar(pL2rPropVarValue->var());
	int valueIndex = pL2rPropVarValue->value();
	T_system::Proto_assignment pa(pVariable, valueIndex);
	if (pL2rPropVarValue->isPositive()) {
	  pos.push_front(pa);
	} else {
	  neg.push_front(pa);
	}
      }

      pTransitioned->add_commanded_prototype(transition_value,
					     pL2rTransition->from(),
					     pL2rTransition->to(),
					     pos, neg);
    }
  }
  verbose(_STD_ cout << "Created transition " << pL2rTransition << _STD_ endl);
}


/***************************************************************************
  Creating the initial state.  Quite likely we don't actually want this
  encoded in the model, but in some other file somewhere.  But it's here
  for now.
 ***************************************************************************/

void to_t_system::createInitialState() {
  State_variable* pStateVariable =
    t_system->create_state_var(0,  // horizon time step
			       1); // state count
  for (unsigned i = 0; i < get_source()->nvars(); i++) {
    const L2rVariable *pL2rVariable = get_source()->getVar(i);
    // if not set, ignore
    if (pL2rVariable->initial() != L2rVariable::NO_INITIAL_VALUE) {
      // Only mode or Observable Variables can have initial values
      L2_assert((pL2rVariable->kind() == vk_mode) ||
		(pL2rVariable->kind() == vk_observed),
		L2_reader_error,
		("v" + MBA_string(pL2rVariable->id()) +
		 " is neither mode nor observation yet has an initial value"));
      if (pL2rVariable->kind() == vk_mode) {
	Transitioned *pTransitioned =
	  static_cast<Transitioned*>(findVar(pL2rVariable));
	pTransitioned->set_initial_mode(0,                       // state=s0
					pL2rVariable->initial(),
					T_system::NOW,
					true);                   // inTheory
      } else if (pL2rVariable->kind() == vk_observed) {
	Observable* pObservable =
	  static_cast<Observable*>(findVar(pL2rVariable));
	pObservable->observe(pL2rVariable->initial());
      } else {
	// Shouldn't get here
      }
    }
  }

  pStateVariable->assign(unsigned(0)); // 0 is ambiguous unsigned or pointer

  // no need to progress; this does all we need
  t_system->next_timestep();
  t_system->propagate();
}


/***************************************************************************
  Fast lookup from L2_file data types to T_system types.
  This is likely a duplicate of some information we'd keep anyway,
  but this way, the to_t_system class is independent of who's using
  it (flight, GPU, etc).
 ***************************************************************************/
Variable *to_t_system::findVar(const L2rVariable *var) const {
    return t_system->get_present_variable(var->id());
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品国产麻豆国产自产在线| 久久99国产精品成人| 亚洲精选在线视频| 午夜精品福利久久久| 激情综合网天天干| 色呦呦国产精品| 91精品国产免费| 国产精品私房写真福利视频| 亚洲国产一区视频| 国内精品视频一区二区三区八戒| 欧美乱熟臀69xxxxxx| 91成人在线精品| 欧美成人一区二区三区片免费| 亚洲国产精品黑人久久久| 亚洲va国产va欧美va观看| 国产精品 欧美精品| 欧美日韩精品系列| 中文字幕日本不卡| 久久精品国产亚洲高清剧情介绍| 91视频国产资源| xnxx国产精品| 亚洲午夜久久久久久久久电影网| 国产成人免费视| 日韩三级视频在线观看| 亚洲欧美日韩中文字幕一区二区三区 | 99久免费精品视频在线观看| 欧美男人的天堂一二区| 中文字幕一区二区在线观看| 琪琪一区二区三区| 色噜噜夜夜夜综合网| 国产欧美精品一区二区色综合| 日韩和欧美的一区| 欧洲国内综合视频| 亚洲欧美在线视频| 国产传媒一区在线| 日韩精品中文字幕一区二区三区 | 亚洲欧美影音先锋| 国产美女久久久久| 日韩午夜在线影院| 午夜激情综合网| 91福利在线导航| 亚洲欧洲国产专区| 成人小视频免费在线观看| 久久香蕉国产线看观看99| 蜜桃视频在线观看一区| 欧美日韩第一区日日骚| 一区二区三区中文字幕在线观看| 成人精品电影在线观看| 国产嫩草影院久久久久| 国产真实精品久久二三区| 日韩三级.com| 美国毛片一区二区三区| 欧美一区二区美女| 日韩精品乱码免费| 777午夜精品视频在线播放| 日一区二区三区| 日韩欧美视频在线| 狠狠色丁香婷综合久久| 欧美精品一区二区三区蜜臀| 国产一区亚洲一区| 欧美激情一区二区| 99精品欧美一区| 亚洲一区在线看| 制服丝袜日韩国产| 久久99精品国产麻豆不卡| 精品国产凹凸成av人网站| 国产精品99久久久久久久vr| 欧美国产精品一区二区三区| av亚洲精华国产精华精| 一区二区三区中文在线观看| 欧美精品一卡二卡| 久草热8精品视频在线观看| 亚洲国产中文字幕| 国内精品免费**视频| 欧美乱妇23p| 毛片av一区二区三区| 国产午夜久久久久| 色哟哟一区二区在线观看 | 日韩视频不卡中文| 国产精品一色哟哟哟| 中文字幕一区二区三区不卡在线 | 成人黄色电影在线| 亚洲精品成人精品456| 欧美色精品在线视频| 麻豆精品久久久| 国产精品少妇自拍| 色呦呦网站一区| 精品在线播放免费| 中文字幕一区不卡| 8v天堂国产在线一区二区| 国产伦精品一区二区三区免费| 中文字幕在线视频一区| 欧美放荡的少妇| 岛国精品在线观看| 日韩中文字幕区一区有砖一区| 国产女同性恋一区二区| 欧美三级电影网站| 成人av午夜影院| 免费一级片91| 亚洲男人的天堂在线aⅴ视频| 欧美大胆一级视频| 91在线视频网址| 激情都市一区二区| 午夜精品久久久久久久99水蜜桃 | 成人激情综合网站| 蜜臂av日日欢夜夜爽一区| 18成人在线观看| 亚洲精品一区二区三区精华液| 色嗨嗨av一区二区三区| 国产精品资源网站| 日本欧美一区二区| 亚洲欧美另类图片小说| 26uuu亚洲综合色| 91 com成人网| 欧美性色综合网| 亚洲一区二区三区爽爽爽爽爽| 91在线播放网址| 欧美色窝79yyyycom| 欧美猛男超大videosgay| 成人黄色av网站在线| 精品一区二区三区在线观看| 在线国产电影不卡| 黄色精品一二区| 国产日韩精品一区二区浪潮av| 久久精品视频网| 国产精品美女久久久久久| 日本大胆欧美人术艺术动态 | 午夜精品久久一牛影视| 蜜桃av一区二区| 国产91精品一区二区麻豆网站| 99久久精品国产精品久久| 日本精品一区二区三区四区的功能| 91麻豆免费观看| 欧美日本一区二区在线观看| 精品久久国产97色综合| 国产精品人成在线观看免费| 午夜精品福利一区二区三区av| 国产无人区一区二区三区| 日韩你懂的在线播放| 国产欧美一区二区三区网站| 亚洲欧美激情插| 蜜臀av一区二区三区| 成人午夜精品一区二区三区| 色哟哟国产精品免费观看| 91麻豆精品国产91| 亚洲国产精品成人综合| 亚洲制服丝袜av| 精品一区二区三区视频在线观看| 国产999精品久久| 欧美午夜电影网| 欧美国产日韩一二三区| 亚洲二区在线观看| 狠狠色2019综合网| 欧美影院一区二区三区| 久久尤物电影视频在线观看| 亚洲激情在线播放| 国产一区二区0| 欧美影视一区二区三区| 国产午夜精品久久久久久久| 国产电影精品久久禁18| 91官网在线免费观看| 久久午夜电影网| 午夜精品一区二区三区电影天堂 | 蜜桃一区二区三区四区| 91在线观看下载| 精品sm在线观看| 亚洲电影激情视频网站| 成人午夜在线视频| 精品国产乱码久久久久久夜甘婷婷 | 午夜免费久久看| 91麻豆福利精品推荐| 欧美精品一区二区三区很污很色的| 洋洋成人永久网站入口| 成人免费视频国产在线观看| 日韩欧美色电影| 视频一区二区三区在线| 色呦呦国产精品| 国产性天天综合网| 久久精品国产免费| 欧美精选一区二区| 亚洲电影你懂得| 在线看国产一区二区| 亚洲欧美一区二区三区孕妇| 国产成人精品影视| 久久久亚洲综合| 久久国产精品99久久久久久老狼| 欧美久久一二区| 亚洲午夜国产一区99re久久| 色先锋资源久久综合| 亚洲欧美日韩成人高清在线一区| 欧美日韩一区成人| 一区二区三区日本| 一本久久综合亚洲鲁鲁五月天| 国产精品狼人久久影院观看方式| 国产在线视频不卡二| 精品播放一区二区| 国产毛片精品国产一区二区三区| 日韩精品专区在线影院重磅| 秋霞午夜鲁丝一区二区老狼| 欧美一区二区三区小说|