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

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

?? zminimal.cpp

?? 這是一種非常有用的SAT解析器
?? CPP
字號:
// *********************************************************************// Copyright 2000-2004, Princeton University.  All rights reserved.// By using this software the USER indicates that he or she has read,// understood and will comply with the following://// --- Princeton University hereby grants USER nonexclusive permission// to use, copy and/or modify this software for internal, noncommercial,// research purposes only. Any distribution, including commercial sale// or license, of this software, copies of the software, its associated// documentation and/or modifications of either is strictly prohibited// without the prior consent of Princeton University.  Title to copyright// to this software and its associated documentation shall at all times// remain with Princeton University.  Appropriate copyright notice shall// be placed on all software copies, and a complete copy of this notice// shall be included in all copies of the associated documentation.// No right is  granted to use in advertising, publicity or otherwise// any trademark,  service mark, or the name of Princeton University.////// --- This software and any associated documentation is provided "as is"//// PRINCETON UNIVERSITY MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS// OR IMPLIED, INCLUDING THOSE OF MERCHANTABILITY OR FITNESS FOR A// PARTICULAR PURPOSE, OR THAT  USE OF THE SOFTWARE, MODIFICATIONS, OR// ASSOCIATED DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS,// TRADEMARKS OR OTHER INTELLECTUAL PROPERTY RIGHTS OF A THIRD PARTY.//// Princeton University shall not be liable under any circumstances for// any direct, indirect, special, incidental, or consequential damages// with respect to any claim by USER or any third party on account of// or arising from the use, or inability to use, this software or its// associated documentation, even if Princeton University has been advised// of the possibility of those damages.// *********************************************************************#include <iostream>#include <fstream>#include <cstdlib>#include <cstdio>#include <cstring>#include <set>#include <vector>using namespace std;#include "SAT.h"const int MAX_LINE_LENGTH       = 65536;const int MAX_WORD_LENGTH       = 64;void read_cnf_omit(SAT_Manager mng, char * filename, vector<int> & omit) {  char line_buffer[MAX_LINE_LENGTH];  char word_buffer[MAX_WORD_LENGTH];  set<int> clause_vars;  set<int> clause_lits;  unsigned omit_idx = 0;  int line_num = 0;  ifstream inp(filename, ios::in);  if (!inp) {    cerr << "Can't open input file" << endl;    exit(1);  }  int cl_id = -1;  while (inp.getline(line_buffer, MAX_LINE_LENGTH)) {    ++line_num;    if (line_buffer[0] == 'c') {      continue;    }    else if (line_buffer[0] == 'p') {      int var_num;      int cl_num;      int arg = sscanf(line_buffer, "p cnf %d %d", &var_num, &cl_num);      if (arg < 2) {        cerr << "Unable to read number of variables and clauses"             << "at line " << line_num << endl;        exit(3);      }      SAT_SetNumVariables(mng, var_num);  // first element not used.    } else {                             // Clause definition or continuation      char *lp = line_buffer;      do {        char *wp = word_buffer;        while (*lp && ((*lp == ' ') || (*lp == '\t'))) {          lp++;        }        while (*lp && (*lp != ' ') && (*lp != '\t') && (*lp != '\n')) {          *(wp++) = *(lp++);        }        *wp = '\0';                                 // terminate string        if (strlen(word_buffer) != 0) {     // check if number is there          int var_idx = atoi(word_buffer);          int sign = 0;          if (var_idx != 0) {            if (var_idx < 0) {              var_idx = -var_idx;              sign = 1;            }            clause_vars.insert(var_idx);            clause_lits.insert((var_idx << 1) + sign);          } else {            // add this clause            ++cl_id;            if (omit_idx < omit.size()-1 && omit[omit_idx] < cl_id )              ++omit_idx;            if (omit_idx < omit.size()) {              if (omit[omit_idx] == cl_id) {                clause_lits.clear();                clause_vars.clear();              }            }            if (clause_vars.size() != 0 &&                clause_vars.size() == clause_lits.size()) {              vector <int> temp;              for (set<int>::iterator itr = clause_lits.begin();                   itr != clause_lits.end(); ++itr) {                temp.push_back(*itr);              }              SAT_AddClause(mng, & temp.begin()[0], temp.size() );            }            clause_lits.clear();            clause_vars.clear();          }        }      }      while (*lp);    }  }  if (!inp.eof()) {    cerr << "Input line " << line_num << " too long. Unable to continue..."         << endl;    exit(2);  }  if (clause_lits.size() && clause_vars.size() == clause_lits.size()) {    vector <int> temp;    for (set<int>::iterator itr = clause_lits.begin();         itr != clause_lits.end(); ++itr) {      temp.push_back(*itr);    }    SAT_AddClause(mng, & temp.begin()[0], temp.size() );  }  clause_lits.clear();  clause_vars.clear();}int get_num_clause(char * filename) {  char line_buffer[MAX_LINE_LENGTH];  ifstream inp(filename, ios::in);  if (!inp) {    cerr << "Can't open input file" << endl;    exit(1);  }  while (inp.getline(line_buffer, MAX_LINE_LENGTH)) {    if (inp.fail()) {      cerr << "Too large an input line. Unable to continue..." << endl;      exit(2);    }    if (line_buffer[0] == 'p') {      int var_num;      int cl_num;      int arg = sscanf(line_buffer, "p cnf %d %d", &var_num, &cl_num);      if (arg < 2) {        cerr << "Unable to read number of variables and clauses" << endl;        exit(3);      }      return cl_num;    }  }  cerr << "Can't find the header in CNF:  p cnf NumVar NumCls " << endl;  exit(1);  return 0;}void handle_result(SAT_Manager mng, int outcome, char * filename) {  string result = "UNKNOWN";  switch (outcome) {    case SATISFIABLE:      cout << "Instance satisfiable" << endl;      // following lines will print out a solution if a solution exist      for (unsigned i = 1, sz = SAT_NumVariables(mng); i <= sz; ++i) {        switch (SAT_GetVarAsgnment(mng, i)) {          case -1:            cout << "(" << i<< ")";            break;          case 0:            cout << "-" << i;            break;          case 1:            cout << i;            break;          default:            cerr << "Unknown variable value state"<< endl;            exit(4);        }        cout << " ";      }      result  = "SAT";      cout << endl;      break;    case UNSATISFIABLE:      result  = "UNSAT";      cout << "Instance unsatisfiable" << endl;      break;    case TIME_OUT:      result  = "ABORT : TIME OUT";      cout << "Time out, unable to determine the outcome of the instance";      cout << endl;      break;    case MEM_OUT:      result  = "ABORT : MEM OUT";      cout << "Memory out, unable to determine the outcome of the instance";      cout << endl;      break;    default:      cerr << "Unknown outcome" << endl;      exit(5);  }  cout << "Max Decision Level\t\t\t" << SAT_MaxDLevel(mng) << endl;  cout << "Num. of Decisions\t\t\t" << SAT_NumDecisions(mng) << endl;  cout << "Num. of Variables\t\t\t" << SAT_NumVariables(mng) << endl;  cout << "Original Num Clauses\t\t\t" << SAT_InitNumClauses(mng) << endl;  cout << "Original Num Literals\t\t\t" << SAT_InitNumLiterals(mng) << endl;  cout << "Added Conflict Clauses\t\t\t" << SAT_NumAddedClauses(mng) -                                            SAT_InitNumClauses(mng)<< endl;  cout << "Added Conflict Literals\t\t\t" << SAT_NumAddedLiterals(mng) -                                             SAT_InitNumLiterals(mng) << endl;  cout << "Deleted Unrelevant clause\t\t" << SAT_NumDeletedClauses(mng) <<endl;  cout << "Deleted Unrelevant literals\t\t" <<SAT_NumDeletedLiterals(mng) <<endl;  cout << "Number of Implication\t\t\t" << SAT_NumImplications(mng)<< endl;  // other statistics comes here  cout << "Total Run Time\t\t\t\t" << SAT_GetCPUTime(mng) << endl << endl;  cout  << result << endl;}void output_status(SAT_Manager mng) {  cout << "Dec: " << SAT_NumDecisions(mng) << "\t ";  cout << "AddCl: " << SAT_NumAddedClauses(mng) << "\t";  cout << "AddLit: " << SAT_NumAddedLiterals(mng) << "\t";  cout << "DelCl: " << SAT_NumDeletedClauses(mng) << "\t";  cout << "DelLit: " << SAT_NumDeletedLiterals(mng) << "\t";  cout << "NumImp: " << SAT_NumImplications(mng) << "\t";  cout << "AveBubbleMove: " << SAT_AverageBubbleMove(mng) << "\t";  // other statistics comes here  cout << "RunTime:" << SAT_GetElapsedCPUTime(mng) << endl;}void verify_solution(SAT_Manager mng) {  int num_verified = 0;  for (int cl_idx = SAT_GetFirstClause (mng); cl_idx >= 0;       cl_idx = SAT_GetNextClause(mng, cl_idx)) {    int len = SAT_GetClauseNumLits(mng, cl_idx);    int * lits = new int[len+1];    SAT_GetClauseLits(mng, cl_idx, lits);    int i;    for (i = 0; i < len; ++i) {      int v_idx = lits[i] >> 1;      int sign = lits[i] & 0x1;      int var_value = SAT_GetVarAsgnment(mng, v_idx);      if ((var_value == 1 && sign == 0) ||          (var_value == 0 && sign == 1))        break;    }    if (i >= len) {      cerr << "Verify Satisfiable solution failed, please "           << "file a bug report, thanks. " << endl;      exit(6);    }    delete [] lits;      ++num_verified;  }  cout << num_verified << " Clauses are true, Verify Solution successful. ";}int main(int argc, char ** argv) {  if (argc != 2) {    cerr << "ZMinimal: Find Minimal Core. " << endl;    cerr << "Copyright 2003-2004, Princeton University" << endl << endl;    cerr << "Usage: "<< argv[0] << " cnf_file " << endl;    return 2;  }  vector<int> omit;  int num_cls = get_num_clause(argv[1]);  cout << "Total : " << num_cls << " passes";  for (int i = 0; i < num_cls; ++i) {    if (i % 50 == 0)      cout << endl << i << ":\t";    if (i % 10 == 0)      cout << " ";    cout.flush();    SAT_Manager mng = SAT_InitManager();    omit.push_back(i);    read_cnf_omit(mng, argv[1], omit);    int result = SAT_Solve(mng);    if (result != SATISFIABLE) {      cout << "*" ;    } else {      cout << "-";      omit.pop_back();    }    cout.flush();    SAT_ReleaseManager(mng);  }  cout << endl;  cout << "Instance Cls: " << num_cls << "  MinCore Cls: "       << num_cls - omit.size() << " Diff: " << omit.size() << endl;  cout << "Unneeded clauses are: ";  for (unsigned i = 0; i < omit.size(); ++i) {    if (i % 20 == 0)      cout << endl;    cout << omit[i] << " ";  }  cout << endl;  return 0;}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲va天堂va国产va久| 国产精品久久三区| 91美女视频网站| 成人sese在线| 粉嫩av一区二区三区在线播放| 毛片av中文字幕一区二区| 日本aⅴ免费视频一区二区三区| 一区二区三区影院| 亚洲国产精品综合小说图片区| 亚洲一区二区三区四区在线观看| 亚洲人成在线观看一区二区| 亚洲色图丝袜美腿| 亚洲一区二区综合| 肉肉av福利一精品导航| 蜜桃久久久久久| 国产福利一区在线| 91香蕉视频mp4| 欧美日韩亚洲另类| 精品国产凹凸成av人网站| 欧美极品xxx| 洋洋av久久久久久久一区| 日韩高清电影一区| 国产精品1区2区3区| av高清不卡在线| 欧美日韩二区三区| 久久天天做天天爱综合色| 国产精品久久久久一区二区三区共| 一区精品在线播放| 视频一区视频二区中文| 韩国av一区二区三区在线观看| 成人精品视频一区二区三区尤物| 色狠狠av一区二区三区| 日韩亚洲欧美综合| 中文字幕在线不卡视频| 日韩和欧美一区二区三区| 国产在线日韩欧美| 欧美日韩在线播放一区| 久久综合色8888| 夜夜揉揉日日人人青青一国产精品| 免费成人美女在线观看.| 99re热这里只有精品视频| 欧美高清你懂得| 亚洲欧洲色图综合| 狠狠色丁香久久婷婷综合_中| 色综合中文字幕国产| 欧美一区二区三区思思人| 中文字幕av一区二区三区 | 国产剧情一区二区三区| 91网址在线看| 日本一区二区免费在线| 日本欧美一区二区| 色成人在线视频| 国产精品女同互慰在线看| 麻豆91在线看| 7777精品伊人久久久大香线蕉超级流畅| 久久久国产午夜精品| 日韩激情视频在线观看| 欧美在线高清视频| 亚洲精品高清在线观看| 成人网页在线观看| 国产偷国产偷精品高清尤物 | 91精品久久久久久久91蜜桃| 亚洲日韩欧美一区二区在线| 国产一区二区精品久久91| 在线电影国产精品| 亚洲午夜久久久久久久久电影院| 成人国产在线观看| 国产欧美一区二区精品性| 精品一区二区免费视频| 欧美一级片在线观看| 免费日本视频一区| 欧美一区二区三区喷汁尤物| 香港成人在线视频| 欧美日韩情趣电影| 五月天欧美精品| 91精品国产欧美一区二区18| 污片在线观看一区二区| 欧美日本一道本| 水野朝阳av一区二区三区| 欧美日韩aaa| 久久国产精品99精品国产| 欧美videossexotv100| 精品无人码麻豆乱码1区2区| www国产成人| 成人午夜视频在线观看| 国产精品国产三级国产普通话蜜臀 | 国产精品不卡一区| 色视频成人在线观看免| 亚洲一区二区三区中文字幕| 欧美日韩一区二区不卡| 日韩综合在线视频| 久久久久亚洲综合| caoporen国产精品视频| 亚洲综合免费观看高清完整版在线| 欧美亚洲高清一区二区三区不卡| 亚洲成人手机在线| 精品少妇一区二区三区免费观看| 国产精品一级片在线观看| 国产精品乱码妇女bbbb| 欧美最猛黑人xxxxx猛交| 婷婷激情综合网| 久久久不卡网国产精品一区| 99久久婷婷国产| 日本美女视频一区二区| 国产亚洲欧美日韩在线一区| 色综合久久天天综合网| 视频在线在亚洲| 亚洲国产精品成人综合| 在线观看网站黄不卡| 久久精品99国产精品| 国产精品久久久久久久久图文区| 欧美午夜影院一区| 国内精品自线一区二区三区视频| 国产精品美女视频| 日韩欧美成人激情| 一本到不卡精品视频在线观看| 蜜臀av性久久久久蜜臀av麻豆| 1区2区3区欧美| 精品国产一区二区三区久久久蜜月| 91色婷婷久久久久合中文| 美女任你摸久久| 亚洲综合一区在线| 国产精品久久久久影院老司| 在线播放/欧美激情| 欧洲精品在线观看| 免费观看久久久4p| 亚洲国产三级在线| 国产精品国产三级国产普通话99 | 国产成人综合亚洲91猫咪| 亚洲欧美电影一区二区| www久久久久| 91精品国产欧美一区二区18| 91精品91久久久中77777| 国产成人精品免费一区二区| 天堂va蜜桃一区二区三区| 国产精品美女久久久久aⅴ国产馆| 91精品国产综合久久久蜜臀粉嫩 | 欧美国产欧美综合| 日韩免费观看高清完整版| 欧美色图天堂网| 91首页免费视频| 成人黄色一级视频| 国产91丝袜在线18| 国产一区二区三区不卡在线观看| 蜜臀av性久久久久av蜜臀妖精| 亚洲妇熟xx妇色黄| 亚洲一区二区三区在线播放| 亚洲人成在线观看一区二区| 国产精品你懂的| 国产精品黄色在线观看| 国产欧美一区二区精品性色超碰| 精品盗摄一区二区三区| 精品日韩av一区二区| 日韩欧美国产午夜精品| 日韩精品一区二区三区swag| 日韩一区二区中文字幕| 日韩免费一区二区三区在线播放| 日韩一区二区免费电影| 欧美不卡123| 国产欧美日韩在线| 国产欧美日韩另类一区| 国产精品福利一区二区三区| 国产精品动漫网站| 一区二区三区视频在线观看| 亚洲自拍偷拍欧美| 麻豆久久久久久久| 国产精品资源在线看| www.久久久久久久久| 日本韩国视频一区二区| 欧美午夜在线观看| 日韩精品中文字幕在线不卡尤物| 亚洲精品一区二区三区精华液| 国产欧美精品一区二区色综合 | 亚洲精品在线免费播放| 国产欧美视频一区二区| 亚洲欧洲日产国码二区| 亚洲一区二区在线免费看| 婷婷夜色潮精品综合在线| 久久99国产乱子伦精品免费| 成人一区二区三区| 欧美伊人久久久久久午夜久久久久| 欧美人动与zoxxxx乱| 久久精品亚洲麻豆av一区二区 | 精品在线观看视频| 99免费精品视频| 91精品国产综合久久精品图片| 久久久亚洲高清| 亚洲国产日日夜夜| 国产精品99久久久| 欧美日韩国产bt| 国产精品乱码一区二区三区软件| 亚洲成人午夜电影| av网站一区二区三区| 日韩欧美一级在线播放| 亚洲区小说区图片区qvod| 麻豆91在线播放免费| 欧美三级午夜理伦三级中视频| 久久久久久亚洲综合影院红桃 | 欧美精品一区二区三区久久久| 亚洲婷婷综合色高清在线|