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

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

?? to_t_system.cpp

?? vxworks的系統(tǒng)故障診斷項(xiàng)目
?? CPP
?? 第 1 頁 / 共 2 頁
字號(hào):
/***
 *** 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
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一区二区黑丝| 一二三区精品福利视频| 国产一区二区在线观看免费| 日韩一二三区不卡| 国产成人精品亚洲777人妖| 欧美激情一区二区三区蜜桃视频| 国产一区福利在线| 一区在线观看视频| 欧亚一区二区三区| 乱中年女人伦av一区二区| 精品久久久久久久人人人人传媒| 国产aⅴ精品一区二区三区色成熟| 国产精品女人毛片| 欧美日韩精品是欧美日韩精品| 欧美96一区二区免费视频| 久久久久久久电影| 在线观看不卡一区| 精品一区二区在线看| 亚洲国产精品成人综合| 在线观看亚洲一区| 久久成人久久鬼色| 亚洲视频免费在线观看| 91精品欧美久久久久久动漫| 国产一区二区福利视频| 亚洲精品国产成人久久av盗摄| 欧美另类变人与禽xxxxx| 国产精品一区一区| 亚洲国产一区二区在线播放| 欧美精品一区二区三区蜜桃| k8久久久一区二区三区 | 日本亚洲最大的色成网站www| 亚洲精品一区二区三区蜜桃下载 | 国产精品一区在线| 一区二区三区日韩欧美精品| 日韩欧美国产午夜精品| 色综合久久综合网欧美综合网| 五月综合激情婷婷六月色窝| 中文欧美字幕免费| 日韩欧美国产综合在线一区二区三区| 高清免费成人av| 国产精品一品视频| 免费在线观看一区| 最新久久zyz资源站| 欧美成人精品高清在线播放| 日本高清成人免费播放| 国产精品原创巨作av| 亚洲成人精品一区二区| 亚洲视频一二三区| 国产亚洲va综合人人澡精品| 欧美精品三级日韩久久| 91网站在线播放| 国产成人精品亚洲日本在线桃色| 日韩精品一卡二卡三卡四卡无卡| 亚洲欧洲一区二区三区| 国产视频一区不卡| 欧美成人精精品一区二区频| 欧美精品日韩一本| 在线视频亚洲一区| 99久久亚洲一区二区三区青草| 国内精品嫩模私拍在线| 日本91福利区| 丝袜美腿一区二区三区| 亚洲18女电影在线观看| 亚洲精品你懂的| √…a在线天堂一区| 国产精品久久毛片| 久久久久久久电影| 国产亚洲一二三区| 精品国内片67194| 精品久久久久香蕉网| 日韩一区二区中文字幕| 制服丝袜亚洲色图| 欧美一区二区三区性视频| 欧美卡1卡2卡| 欧美男人的天堂一二区| 9191国产精品| 日韩欧美一区二区免费| 欧美岛国在线观看| 久久久综合视频| 久久久久久一二三区| 国产偷国产偷精品高清尤物| 久久久久久久久久看片| 欧美国产日韩亚洲一区| 国产精品美女久久久久久久久久久| 国产视频一区在线观看| 国产精品国产三级国产普通话三级| 国产精品污www在线观看| 国产亚洲精品超碰| 中文字幕日韩av资源站| 亚洲美女屁股眼交3| 一区二区三区国产| 午夜欧美视频在线观看| 九九在线精品视频| 国产高清在线精品| 99视频国产精品| 欧美视频日韩视频| 日韩免费高清视频| 国产精品嫩草影院com| 亚洲欧美另类久久久精品 | 精品国产人成亚洲区| 久久久五月婷婷| 亚洲欧洲无码一区二区三区| 亚洲亚洲人成综合网络| 色婷婷精品大视频在线蜜桃视频| 欧美中文字幕久久| 日韩欧美高清在线| 国产精品久久久久婷婷| 午夜免费久久看| 国内精品国产成人| 色呦呦网站一区| 日韩三级av在线播放| 国产精品美女久久久久久| 亚洲午夜激情网站| 国产一区二区三区av电影| 色噜噜狠狠色综合欧洲selulu| 欧美精品在线一区二区三区| www国产精品av| 亚洲一区中文日韩| 激情五月激情综合网| 色哟哟国产精品| 精品日韩一区二区三区| 成人免费在线视频观看| 激情五月婷婷综合| 欧美日韩视频一区二区| 国产午夜精品福利| 日韩av电影免费观看高清完整版在线观看| 国产99久久久精品| 欧美一区二区视频免费观看| 国产精品卡一卡二| 激情深爱一区二区| 欧美色网站导航| 国产精品久久久久久久岛一牛影视 | 国产suv一区二区三区88区| 欧美日韩二区三区| 一个色在线综合| 国产福利91精品一区二区三区| 欧美日韩精品一区二区天天拍小说| 欧美激情自拍偷拍| 美美哒免费高清在线观看视频一区二区 | 欧美精品一区二区在线观看| 图片区小说区区亚洲影院| 91尤物视频在线观看| 国产日韩v精品一区二区| 精品午夜久久福利影院| 欧美日韩国产123区| 一区二区三区在线观看国产| 成人精品一区二区三区四区 | 国产视频亚洲色图| 国产一区二区三区在线观看免费| 欧美日韩卡一卡二| 亚洲综合一二区| 91久久免费观看| 亚洲欧美一区二区不卡| 99re热这里只有精品免费视频| 久久久久久影视| 国产精品一级黄| 国产亚洲综合在线| 国产99久久久久| 国产精品乱子久久久久| 国产高清不卡一区二区| 久久久夜色精品亚洲| 国产专区欧美精品| 国产亚洲一区二区三区四区| 国产精品资源在线| 国产精品久久久久久久久图文区| 成人午夜免费视频| 国产精品国产三级国产aⅴ无密码| 成人国产电影网| 亚洲色欲色欲www| 国产欧美va欧美不卡在线| 国产一区二区三区观看| 中文字幕成人网| eeuss鲁一区二区三区| 国产精品久久久久久久岛一牛影视| 国产99久久久国产精品潘金| 亚洲国产高清不卡| 日本精品免费观看高清观看| 一区二区欧美精品| 欧美精品精品一区| 亚洲成av人片www| 日韩视频一区二区在线观看| 国内精品视频一区二区三区八戒| 精品伦理精品一区| 9色porny自拍视频一区二区| 国产精品看片你懂得| 欧美午夜片在线观看| 奇米影视一区二区三区| 精品国产伦一区二区三区免费 | 国产色爱av资源综合区| 麻豆精品新av中文字幕| 日本一区二区动态图| 色94色欧美sute亚洲线路一久| 亚洲免费av高清| 91精品国产综合久久精品| 日韩不卡在线观看日韩不卡视频| www欧美成人18+| 在线视频亚洲一区| 日产欧产美韩系列久久99| 日本一区二区视频在线| 成人污视频在线观看|