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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? to_t_system.cpp

?? vxworks的系統(tǒng)故障診斷項目
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/***
 *** See the file "mba/disclaimers-and-notices-L2.txt" for
 *** information on usage and redistribution of this file,
 *** and for a DISCLAIMER OF ALL WARRANTIES.
 ***/

/* $Id: to_t_system.cpp,v 1.1.1.1 2006/10/09 06:58:18 shao Exp $ */

#include <readers/L2_file.h>
#include <readers/to_t_system.h>
#include <readers/transition.h>
#include <transition/transitioned.h>

// verbose output
// The do-while(0) is the only portable way to block
#ifdef ENABLE_L2_VERBOSE
#  define verbose(expr) do { if (isVerbose()) { expr; } } while(0)
#else
#  define verbose(expr)
#endif

// record via the listener
// The do-while(0) is the only portable way to block
#ifndef DISABLE_TO_T_SYSTEM_LISTEN
#  include <readers/to_t_system_listener.h>
#  define record(call_with_args) \
   do { \
    Slist<to_t_system_listener*>::iterator listen_it##__LINE__ \
        = listeners_.begin(); \
    while(listen_it##__LINE__ != listeners_.end()) { \
        (*listen_it##__LINE__)->call_with_args;  \
        ++listen_it##__LINE__; \
    } \
   } while(0)
#else
#  define record(call_with_args)
#endif


// Needed to implement created_clause: a listener into the TMS that catches the
// created_clause event and translates it to the user's to_t_system_listener
// call.  We also need to pass call on to the other listener.

#ifndef DISABLE_TO_T_SYSTEM_LISTEN
#include <tms/ptheory_listener.h>
class to_t_system::tms_listener : public Pooled,
		   public virtual Ptheory_listener
{
private:
  // can't be null
  Slist<to_t_system_listener*>& listeners_;
  Ptheory& theory;
  friend class to_t_system;

public:
  tms_listener(Slist<to_t_system_listener*>& l, Ptheory& p)
    : listeners_(l), theory(p) {
    theory.add_listener(this);
  }

  virtual ~tms_listener() {
    theory.remove_listener(this);
  }

  // translate into a call on the user's to_t_system_listener
  virtual void created_clause(Clause& newclause) {
    if (creating_from_variable)
      record(created_clause(var, newclause));
    else
      record(created_clause(cls, newclause));
  }

  // we ignore all these
  virtual void created_proposition(Proposition&) { }
  virtual void destroying_proposition(Proposition&) { }
  virtual void destroying_clause(Clause&) { }
  virtual void destroying_container(Ptheory&) {
    L2_throw(L2_fatal_error,
	     ("Expected theory to outlast the reader!"));
  }

private:
  // We could use a union, but we'd only save all of 4 bytes,
  // and unions are ugly.
  const L2rVariable *var;
  const L2rClause   *cls;
  bool creating_from_variable; // if false, creating from clause
};
#endif


/***************************************************************************
        Constructor
 ***************************************************************************/

to_t_system::to_t_system(const L2_file *f, T_system *tsys)
    : L2_file_writer (f), t_system(tsys) {
}

to_t_system::~to_t_system() {
  record(destroying_container(*this));
}

/***************************************************************************
        The main function
 ***************************************************************************/

// Take info from the l2_file and put it into the T_system

bool to_t_system::write() {
#ifndef DISABLE_TO_T_SYSTEM_LISTEN
  // Set a listener which will allow us to keep track of where clauses come
  // from.  The internal_listen just translates TMS listener calls into
  // to_t_system_listener calls.
  if (!listeners_.empty()) {
    internal_tms_listen =
      new tms_listener(listeners_, *t_system->get_solver());
  } else {
    internal_tms_listen = 0;
  }
#endif

  // The model from the reader
  const L2_file *source = get_source();

  // Some checks that the model has needed elements
  L2_assert(source->nenums() != 0,
	    L2_empty_model_error,
            ("model has no enumerations"));
  L2_assert(source->nvars() != 0,
	    L2_empty_model_error,
            ("model has no variables"));
  L2_assert(source->nclauses() != 0,
	    L2_empty_model_error,
            ("model has no clauses"));

  // Create the 3 tyeps of elements (variables, clauses, transitions)
  {
    for (unsigned i = 0; i < source->nvars(); i++)
      createVariable(source->getVar(i));
  }
  {
    for (unsigned i = 0; i < source->nclauses(); i++)
      createBackground(source->getClause(i));
  }
  {
    for (unsigned i = 0; i < source->nvars(); ++i) {
      const L2rVariable* pL2rVariable = source->getVar(i);
      if (pL2rVariable->kind() == vk_mode) {
	// It is a mode
	createTransitions(source->getVar(i)); // ignored if not a mode
      }
    }
  }

#ifndef DISABLE_TO_T_SYSTEM_LISTEN
  // Undo the work we did at the top of the file.
  if (!listeners_.empty()) {
    delete internal_tms_listen;
  }
#endif

  return true;
}


// Turn an L2rVariable (from the l2_file) into a Variable (in the T_system)

void to_t_system::createVariable(const L2rVariable *pL2rVariable) {
#ifndef DISABLE_TO_T_SYSTEM_LISTEN
  if (internal_tms_listen) {
    internal_tms_listen->creating_from_variable = true;
    internal_tms_listen->var = pL2rVariable;
  }
#endif
  unsigned domainCardinality = pL2rVariable->type()->nmembers();
  unsigned variableID = pL2rVariable->id();
  Variable *pVariable = NULL;
  switch(pL2rVariable->kind()) {
  case vk_commanded:
    {
      Command* pCommand =
	t_system->create_command(domainCardinality, T_system::NOW, variableID);
      // It's OK to assign the present state Command because the present state
      // Command doesn't constrain anything. The previous Command constrains
      // the current state Variables, but the current Commands don't constrain
      // anything and are always noCommand (index 0) -- nothing will ever set
      // them to anything else!
      pCommand->assign(0u);
      pVariable = pCommand;
    }
    break;
  case vk_observed:
    pVariable =
      t_system->create_observable(domainCardinality, T_system::NOW, variableID);
    break;
  case vk_mode:
    pVariable =
      new Transitioned(*t_system, domainCardinality, variableID,
		       pL2rVariable->mode()->domain_size(), T_system::NOW);
    break;
  default:
    pVariable =
      t_system->create_dependent(domainCardinality, T_system::NOW, variableID);
    break;
  }
  t_system->register_new_variable(pVariable);
  verbose(_STD_ cout << "Created variable " << pVariable->get_id() << " `"
	  << pL2rVariable << "'\n");
  record(created_variable(pL2rVariable, *pVariable));
}


// Create the Transition objects that go from one mode to another

void to_t_system::createTransitions(const L2rVariable *pL2rVariable) {
  const L2rMode *pL2rMode = pL2rVariable->mode();
  // Map from L2rVariable (l2_file) to Variable (T_system) and cast to
  // Transitioned*
  Transitioned *pTransitioned =
    static_cast<Transitioned*>(findVar(pL2rVariable));

  // Create the nominal Transition. The index of the nominal value is zero.
  // Note there must be exactly one of them.
  {
    for (L2rMode::iterator it = pL2rMode->begin_nominal();
	 it != pL2rMode->end_nominal(); ++it) {
      const L2rTransition *pL2rTransition = *it;
      createTransition(pTransitioned, pL2rTransition, 0); // 0 is nominal index
    }
  }

  // Create the failure Transitions. Each failure has its own index.
  // The first failure has index 1, not 0 (0 is nominal)
  
  // When doing recovery instead of diagnosis, failures are irrelevant.
  if (!t_system->isPlanning()) {
    unsigned i = 1;
    for (L2rMode::iterator it = pL2rMode->begin_failure();
	 it != pL2rMode->end_failure() ; ++it) {
      const L2rTransition *pL2rTransition = *it;
      createTransition(pTransitioned, pL2rTransition, i++);
    }
    L2_assert(i == pTransitioned->get_ntransitions(),
	      L2_writer_error,
	      ("Mode v" + MBA_string(pTransitioned->get_id()) +
	       " has the wrong number of transitions"));
  }
}


?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
自拍视频在线观看一区二区| 国产精品嫩草影院com| 国产福利一区二区三区| 亚洲夂夂婷婷色拍ww47| 久久久久久久久久久久久久久99| 在线亚洲一区二区| 国产一区二区三区久久久| 伊人婷婷欧美激情| 国产精品家庭影院| 久久九九久久九九| 日韩三级中文字幕| 欧美电影在线免费观看| 在线一区二区视频| 91亚洲精华国产精华精华液| 国产成人午夜99999| 免费xxxx性欧美18vr| 午夜精品久久久久久| 亚洲日本青草视频在线怡红院 | 777a∨成人精品桃花网| 91麻豆国产在线观看| 成人精品在线视频观看| 国产suv精品一区二区6| 精品一区二区三区免费播放| 日本亚洲三级在线| 日日摸夜夜添夜夜添国产精品| 亚洲精品国产一区二区精华液| 国产精品久久久久久久久搜平片| 国产亚洲欧美色| 2022国产精品视频| 精品国产乱码久久久久久免费| 欧美精品丝袜久久久中文字幕| 在线观看日韩电影| 欧美系列日韩一区| 欧美天堂亚洲电影院在线播放| 欧美影视一区在线| 欧美在线一区二区| 欧美乱妇15p| 91精品国产综合久久小美女| 日韩一级高清毛片| 日韩免费视频线观看| 久久婷婷色综合| 国产三级欧美三级日产三级99| 久久久不卡网国产精品一区| 中文字幕不卡在线播放| 中文字幕视频一区| 17c精品麻豆一区二区免费| 亚洲男人都懂的| 亚洲精品中文在线影院| 亚洲va国产va欧美va观看| 天天色综合成人网| 精品一区二区免费视频| 国产99一区视频免费| 99精品热视频| 欧美日韩久久一区二区| 日韩欧美一区二区久久婷婷| 久久久久久99精品| 自拍视频在线观看一区二区| 亚洲午夜在线电影| 麻豆精品精品国产自在97香蕉| 国产呦萝稀缺另类资源| 99国产精品久| 欧美欧美欧美欧美| 337p粉嫩大胆噜噜噜噜噜91av| 欧美国产精品v| 亚洲高清在线精品| 国产一区二区不卡| 在线视频国内自拍亚洲视频| 日韩一区二区三区视频在线| 国产欧美一区二区三区沐欲| 一区二区三区在线观看网站| 免费成人在线观看| av色综合久久天堂av综合| 欧美久久久久久蜜桃| 久久久99久久| 亚洲成人一区在线| 国产乱国产乱300精品| 在线观看一区不卡| 国产视频一区二区在线观看| 亚洲精品成a人| 国产精品一区一区三区| 在线亚洲高清视频| 久久久精品天堂| 亚洲成av人片观看| 成人精品电影在线观看| 91精品国产欧美一区二区18 | 欧美在线一区二区| 精品国产1区2区3区| 亚洲国产成人精品视频| 成人综合婷婷国产精品久久蜜臀| 欧美精品日日鲁夜夜添| 中文字幕在线观看一区| 精彩视频一区二区三区| 日本精品视频一区二区| 久久五月婷婷丁香社区| 日韩在线播放一区二区| 91麻豆.com| 久久久久久久久久久黄色 | 成人黄色小视频在线观看| 这里是久久伊人| 亚洲激情在线激情| www.亚洲国产| 2017欧美狠狠色| 麻豆高清免费国产一区| 欧美猛男男办公室激情| 亚洲日本在线a| 成人午夜电影小说| 久久久久久久久久电影| 另类专区欧美蜜桃臀第一页| 欧美日韩极品在线观看一区| 亚洲欧美另类图片小说| 99热精品一区二区| 国产亚洲欧美日韩日本| 国产一区二区三区在线看麻豆| 欧美精品久久99| 亚洲一区二区美女| 日本久久电影网| 伊人开心综合网| 91原创在线视频| 国产精品久久久久久户外露出 | 国产盗摄一区二区三区| 日韩欧美中文字幕公布| 日本成人在线电影网| 欧美精品日韩一本| 亚洲一区日韩精品中文字幕| 91黄色免费网站| 亚洲六月丁香色婷婷综合久久| 成人开心网精品视频| 国产精品久久久久久久久免费桃花 | 午夜精品久久久久| 欧洲av在线精品| 亚洲韩国精品一区| 欧美日韩一区二区三区高清| 亚洲一区二区在线免费观看视频 | 国产在线乱码一区二区三区| 精品久久久久久最新网址| 国产一区二区影院| 亚洲国产精品成人综合| eeuss国产一区二区三区| 亚洲少妇最新在线视频| 色吊一区二区三区| 亚洲成人免费视频| 91精品国产综合久久久久| 久久精品国产99久久6| 亚洲精品在线观看网站| 国产成人在线观看免费网站| 欧美精彩视频一区二区三区| av成人动漫在线观看| 亚洲老妇xxxxxx| 欧美日韩国产综合一区二区三区 | 国产白丝网站精品污在线入口| 欧美激情在线一区二区三区| 不卡av电影在线播放| 亚洲激情第一区| 欧美一级精品大片| 国产精品亚洲一区二区三区妖精 | 欧美日韩一区视频| 奇米色777欧美一区二区| 久久精品欧美日韩| 成人av电影在线播放| 亚洲福利电影网| 精品久久人人做人人爽| 成人avav影音| 午夜精品久久久久久不卡8050| 日韩一区二区免费在线电影| 福利电影一区二区| 亚洲国产精品久久久久婷婷884 | 亚洲一区二区不卡免费| 日韩一区二区三区视频| 不卡欧美aaaaa| 日本最新不卡在线| 国产日本一区二区| 欧美在线一二三四区| 国内外精品视频| 亚洲一区二区三区四区在线观看| 精品国免费一区二区三区| av午夜一区麻豆| 美女一区二区久久| 一区二区中文字幕在线| 日韩欧美区一区二| 99久久精品一区| 久久99精品视频| 亚洲影院免费观看| 国产天堂亚洲国产碰碰| 欧美精品日韩一本| 99久久精品国产观看| 久久91精品国产91久久小草| 亚洲美女区一区| 久久综合成人精品亚洲另类欧美| 欧美伊人精品成人久久综合97 | 日本精品视频一区二区三区| 久久国产成人午夜av影院| 一区二区久久久久久| 久久婷婷国产综合国色天香| 欧美视频精品在线观看| av成人免费在线| 国产成人精品影视| 蜜桃免费网站一区二区三区| 一区二区三区91| 亚洲欧美自拍偷拍| 国产午夜精品在线观看|