1.分析函数代码解读

 
  1 void Solver::analyze(CRef confl, vec<Lit>& out_learnt, int& out_btlevel, int& out_lbd)
  2 {
  3     int pathC = 0;         //从冲突子句回溯路径上的分叉数
  4     Lit p     = lit_Undef; //p最终是冲突文字(相冲突的两个子句中互为补文字,其中一个已经传播保存在trail之中,另一个记录在confl中的confl[0])
  5 
  6     // Generate conflict clause:
  7     //
  8     out_learnt.push();      // (leave room for the asserting literal)
  9     int index   = trail.size() - 1;
 10     int nDecisionLevel = level(var(ca[confl][0]));  //保存在trail的冲突文字可能在冲突支配文字之前(同层或之前的层),也可能在之后(同层);
 11     assert(nDecisionLevel == level(var(ca[confl][0])));
 12 
 13     do{
 14         assert(confl != CRef_Undef); // (otherwise should be UIP)
 15         Clause& c = ca[confl];  //从冲突点冲突子句发起对蕴含图的回溯
 16         /////////////////////////////////////////////////////////////////////////mark no. used
 17         if (c.learnt() && c.usedt()<200)
 18         {
 19             c.set_usedt(c.usedt()+1); 
 20         }
 21         /////////////////////////////////////////////////////////////////////////
 22 
 23         // For binary clauses, we don't rearrange literals in propagate(), so check and make sure the first is an implied lit.
 24         if (p != lit_Undef && c.size() == 2 && value(c[0]) == l_False){
 25             assert(value(c[1]) == l_True);
 26             Lit tmp = c[0];
 27             c[0] = c[1], c[1] = tmp; }  //是对propagate函数的补位,二值观察元0/1直至只有一个为真,此处确保c[0]为真,即c[0]为蕴含的文字
 28 
 29         // Update LBD if improved.
 30         if (c.learnt() && c.mark() != CORE){
 31             int lbd = computeLBD(c);
 32             if (lbd < c.lbd()){
 33                 if (c.lbd() <= 30) c.removable(false); // Protect once from reduction.
 34                 c.set_lbd(lbd);
 35                 if (lbd <= core_lbd_cut){
 36                     learnts_core.push(confl);
 37                     c.mark(CORE);
 38                 }else if (lbd <= 6 && c.mark() == LOCAL){
 39                     // Bug: 'cr' may already be in 'learnts_tier2', e.g., if 'cr' was demoted from TIER2
 40                     // to LOCAL previously and if that 'cr' is not cleaned from 'learnts_tier2' yet.
 41                     learnts_tier2.push(confl);
 42                     c.mark(TIER2); }
 43             }
 44 
 45             if (c.mark() == TIER2)
 46                 c.touched() = conflicts;
 47             else if (c.mark() == LOCAL)
 48                 claBumpActivity(c);
 49         }
 50 
 51         for (int j = (p == lit_Undef) ? 0 : 1; j < c.size(); j++){
 52             Lit q = c[j];
 53 
 54             if (!seen[var(q)] && level(var(q)) > 0){
 55                 if (VSIDS){
 56                     varBumpActivity(var(q), .5);
 57                     add_tmp.push(q);
 58                 }else
 59                     conflicted[var(q)]++;
 60                 seen[var(q)] = 1;
 61                 if (level(var(q)) >= nDecisionLevel){
 62                     pathC++;
 63                 }else
 64                     out_learnt.push(q);
 65             }
 66         }
 67         
 68         // Select next clause to look at:
 69         do {
 70             while (!seen[var(trail[index--])]);  //此处函数体为空语句(只有分号),在trail上移动index从后往前找到一个分叉口(蕴含图节点)
 71             p  = trail[index+1];
 72         } while (level(var(p)) < nDecisionLevel);
 73         
 74         confl = reason(var(p)); //蕴含节点转移到边上(该指向该节点的若干条边为同一个蕴含子句)
 75         seen[var(p)] = 0;  //该节点完成使命——查找到蕴含子句,得到多个该节点向后回溯能够到达的节点(在该蕴含子句confl之中)
 76         pathC--;
 77 
 78     }while (pathC > 0);       //此do-while类似工作栈将冲突点之后的“参与冲突的子句和节点”深度搜索一遍;
//同时蕴含图完成切割,切割线由在trail中的冲突文字的所在层数决定,见line10,
//设定标准见line61-64,大于等于nDecisionLevel继续回溯,小于的不在回溯了。
79 out_learnt[0] = ~p; //唯一蕴含点p找到了(唯一蕴含点可能是冲突层决策变元,也可能是),取反放入学习子句0位置。 80 81 // Simplify conflict clause: 82 // 83 int i, j; 84 out_learnt.copyTo(analyze_toclear); //此时学习子句out_learnt中文字的可见性没有都为0,在line158中一并处理为0. 85 if (ccmin_mode == 2){ 86 uint32_t abstract_level = 0; 87 for (i = 1; i < out_learnt.size(); i++) 88 abstract_level |= abstractLevel(var(out_learnt[i])); // (maintain an abstraction of levels involved in conflict) 89 90 for (i = j = 1; i < out_learnt.size(); i++) 91 if (reason(var(out_learnt[i])) == CRef_Undef || !litRedundant(out_learnt[i], abstract_level)) 92 out_learnt[j++] = out_learnt[i]; 93 94 }else if (ccmin_mode == 1){ 95 for (i = j = 1; i < out_learnt.size(); i++){ 96 Var x = var(out_learnt[i]); 97 98 if (reason(x) == CRef_Undef) 99 out_learnt[j++] = out_learnt[i]; 100 else{ 101 Clause& c = ca[reason(var(out_learnt[i]))]; 102 for (int k = c.size() == 2 ? 0 : 1; k < c.size(); k++) 103 if (!seen[var(c[k])] && level(var(c[k])) > 0){ 104 out_learnt[j++] = out_learnt[i]; 105 break; } 106 } 107 } 108 }else 109 i = j = out_learnt.size(); 110 111 max_literals += out_learnt.size(); 112 out_learnt.shrink(i - j); 113 tot_literals += out_learnt.size(); 114 115 out_lbd = computeLBD(out_learnt); 116 if (out_lbd <= 6 && out_learnt.size() <= 30) // Try further minimization? 117 if (binResMinimize(out_learnt)) 118 out_lbd = computeLBD(out_learnt); // Recompute LBD if minimized. 119 120 // Find correct backtrack level: 121 // 122 if (out_learnt.size() == 1) 123 out_btlevel = 0; 124 else{ 125 int max_i = 1; 126 // Find the first literal assigned at the next-highest level: 127 for (int i = 2; i < out_learnt.size(); i++) 128 if (level(var(out_learnt[i])) > level(var(out_learnt[max_i]))) 129 max_i = i; 130 // Swap-in this literal at index 1: 131 Lit p = out_learnt[max_i]; 132 out_learnt[max_i] = out_learnt[1]; 133 out_learnt[1] = p; 134 out_btlevel = level(var(p)); 135 } 136 137 if (VSIDS){ 138 for (int i = 0; i < add_tmp.size(); i++){ 139 Var v = var(add_tmp[i]); 140 if (level(v) >= out_btlevel - 1) 141 varBumpActivity(v, 1); 142 } 143 add_tmp.clear(); 144 }else{ 145 seen[var(p)] = true; 146 for(int i = out_learnt.size() - 1; i >= 0; i--){ 147 Var v = var(out_learnt[i]); 148 CRef rea = reason(v); 149 if (rea != CRef_Undef){ 150 const Clause& reaC = ca[rea]; 151 for (int i = 0; i < reaC.size(); i++){ 152 Lit l = reaC[i]; 153 if (!seen[var(l)]){ 154 seen[var(l)] = true; 155 almost_conflicted[var(l)]++; 156 analyze_toclear.push(l); } } } } } 157 158 for (int j = 0; j < analyze_toclear.size(); j++) seen[var(analyze_toclear[j])] = 0; // ('seen[]' is now cleared) 159 }

 

 

阅读笔记:

   1.    seen[v]是个用来替代工作栈进行回溯查找的好工具。与trail配合可以回溯查找唯一蕴含点并完成切割。

   2.   almost_conflicted[v]记录每一个变元参与

 

 

2.传播函数propagate代码解读

 
  1 /*_________________________________________________________________________________________________
  2 |
  3 |  propagate : [void]  ->  [Clause*]
  4 |  
  5 |  Description:
  6 |    Propagates all enqueued facts. If a conflict arises, the conflicting clause is returned,
  7 |    otherwise CRef_Undef.
  8 |  
  9 |    Post-conditions:
 10 |      * the propagation queue is empty, even if there was a conflict.
 11 |________________________________________________________________________________________________@*/
 12 CRef Solver::propagate()
 13 {
 14     CRef    confl     = CRef_Undef;
 15     int     num_props = 0;
 16     watches.cleanAll();
 17     watches_bin.cleanAll();                      //观察体系进行除重操作
 18     //printf("find pro 001\n");
 19     while (qhead < trail.size()){
 20         Lit            p   = trail[qhead++];     // 'p' is enqueued fact to propagate.
 21         int currLevel = level(var(p));           
 22         vec<Watcher>&  ws  = watches[p];         //文字p的观察watches[p]--是一个包含-p的观察元序列
 23         Watcher        *i, *j, *end;
 24         num_props++;
 25 
 26         vec<Watcher>& ws_bin = watches_bin[p];  // Propagate binary clauses first.
 27         for (int k = 0; k < ws_bin.size(); k++){
 28             Lit the_other = ws_bin[k].blocker;
 29             if (value(the_other) == l_False){
 30                 confl = ws_bin[k].cref;
 31 #ifdef LOOSE_PROP_STAT
 32                 return confl;
 33 #else
 34                 goto ExitProp;
 35 #endif
 36             }else if(value(the_other) == l_Undef)
 37             {
 38                 uncheckedEnqueue(the_other, currLevel, ws_bin[k].cref);
 39 #ifdef  PRINT_OUT                
 40                 std::cout << "i " << the_other << " l " << currLevel << "\n";
 41 #endif                
 42             }
 43         }
 44 
 45         for (i = j = (Watcher*)ws, end = i + ws.size();  i != end;){
 46             // Try to avoid inspecting the clause:
 47             Lit blocker = i->blocker;
 48             if (value(blocker) == l_True){
 49                 *j++ = *i++; continue; }
 50 
 51             // Make sure the false literal is data[1]:
 52             CRef     cr        = i->cref;
 53             Clause&  c         = ca[cr];
 54             Lit      false_lit = ~p;
 55             if (c[0] == false_lit)
 56                 c[0] = c[1], c[1] = false_lit;  //二值观察数据结构观察子句的前两个文字。此处确保c[1]文字是假,c[0]才有可能是蕴含出的文字
 57                                                 //c[1]为-p,那么c[0]有通常是观察watcher[p]中观察元的bolcker
 58             assert(c[1] == false_lit);
 59             i++;
 60 
 61             // If 0th watch is true, then clause is already satisfied.
 62             Lit     first = c[0];    //c子句中的文字顺利可以被调整(见行1616),再经行1602~1603调整c[0]有可能不是原来bolcker
 63             Watcher w     = Watcher(cr, first); //准备一个观察元--正在被排查的子句为cref,first为blocker。
 64             if (first != blocker && value(first) == l_True){  //first 
 65                 *j++ = w; continue; }           //替换当前观察watcher[p]中当前观察元为新观察元
 66             //以上被排查子句已经有为真的文字则continue
 67 
 68             //如果被排查的子句准备被蕴含的文字不为真,则剩余可能有两种:为l_False或l_Undef
 69             // Look for new watch:
 70             for (int k = 2; k < c.size(); k++)
 71                 if (value(c[k]) != l_False){
 72                     c[1] = c[k]; c[k] = false_lit;  //已经为假的文字后移
 73                     watches[~c[1]].push(w);         //为其它观察补充观察元        
 74                     goto NextClause; }
 75 
 76             // Did not find watch -- clause is unit under assignment:
 77             *j++ = w;
 78             if (value(first) == l_False){   //剩余可能有两种之一:为l_False
 79                 confl = cr;
 80                 qhead = trail.size();
 81                 // Copy the remaining watches:
 82                 while (i < end)
 83                     *j++ = *i++;
 84             }else                          //剩余可能有两种之二:为l_Undef
 85             {
 86                 if (currLevel == decisionLevel())
 87                 {
 88                     uncheckedEnqueue(first, currLevel, cr);
 89 #ifdef PRINT_OUT                    
 90                     std::cout << "i " << first << " l " << currLevel << "\n";
 91 #endif                    
 92                 }
 93                 else
 94                 {
 95                     int nMaxLevel = currLevel;
 96                     int nMaxInd = 1;
 97                     // pass over all the literals in the clause and find the one with the biggest level
 98                     for (int nInd = 2; nInd < c.size(); ++nInd)
 99                     {
100                         int nLevel = level(var(c[nInd]));
101                         if (nLevel > nMaxLevel)
102                         {
103                             nMaxLevel = nLevel;
104                             nMaxInd = nInd;
105                         }
106                     }
107 
108                     if (nMaxInd != 1)
109                     {
110                         std::swap(c[1], c[nMaxInd]);
111                         *j--; // undo last watch
112                         watches[~c[1]].push(w);
113                     }
114                     
115                     uncheckedEnqueue(first, nMaxLevel, cr);
116 #ifdef PRINT_OUT                    
117                     std::cout << "i " << first << " l " << nMaxLevel << "\n";
118 #endif    
119                 }
120             }
121 
122 NextClause:;
123         }
124         ws.shrink(i - j);
125     }
126 
127     //printf("find pro 002\n");
128 
129 ExitProp:;
130     propagations += num_props;
131     simpDB_props -= num_props;
132 
133     return confl;
134 }

 

   

 

3.记录参与冲突生成的蕴含图节点及举例冲突点距离的函数--距离越远说明越早参与传播(在trail中靠前),对冲突形成越重要

 
 1 // pathCs[k] is the number of variables assigned at level k,
 2 // it is initialized to 0 at the begining and reset to 0 after the function execution
 3 bool Solver::collectFirstUIP(CRef confl){
 4     involved_lits.clear();
 5     int max_level = 1;
 6     Clause& c = ca[confl]; int minLevel = decisionLevel();
 7     for(int i = 0; i<c.size(); i++) {
 8         Var v = var(c[i]);
 9         //        assert(!seen[v]);
10         if (level(v)>0) {
11             seen[v]=1;
12             var_iLevel_tmp[v] = 1;
13             pathCs[level(v)]++;
14             if (minLevel > level(v)) {
15                 minLevel = level(v);
16                 assert(minLevel>0);
17             }
18             //    varBumpActivity(v);
19         }
20     }
21 
22     int limit = trail_lim[minLevel-1];
23     for(int i = trail.size()-1; i>=limit; i--) {
24         Lit p = trail[i]; Var v = var(p);
25         if (seen[v]) {
26             int currentDecLevel = level(v);
27             //      if (currentDecLevel == decisionLevel())
28             //          varBumpActivity(v);
29             seen[v] = 0;
30             if (--pathCs[currentDecLevel]!=0) {
31                 Clause& rc=ca[reason(v)];
32                 int reasonVarLevel=var_iLevel_tmp[v]+1;
33                 if(reasonVarLevel>max_level) max_level=reasonVarLevel;
34                 if (rc.size() == 2 && value(rc[0]) == l_False) {
35                     // Special case for binary clauses
36                     // The first one has to be SAT
37                     assert(value(rc[1]) != l_False);
38                     Lit tmp = rc[0];
39                     rc[0] =  rc[1], rc[1] = tmp;
40                 }
41                 for (int j = 1; j < rc.size(); j++){
42                     Lit q = rc[j]; Var v1 = var(q);
43                     if (level(v1) > 0) {
44                         if (minLevel>level(v1)) {
45                             minLevel = level(v1); limit = trail_lim[minLevel-1];     assert(minLevel>0);
46                         }
47                         if (seen[v1]) {
48                             if (var_iLevel_tmp[v1] < reasonVarLevel)
49                                 var_iLevel_tmp[v1] = reasonVarLevel;
50                         }
51                         else {
52                             var_iLevel_tmp[v1] = reasonVarLevel;
53                             //   varBumpActivity(v1);
54                             seen[v1] = 1;
55                             pathCs[level(v1)]++;
56                         }
57                     }
58                 }
59             }
60             involved_lits.push(p);
61         }
62     }
63     double inc = var_iLevel_inc;
64     vec<int> level_incs; level_incs.clear();
65     for(int i=0; i<max_level; i++){
66         level_incs.push(inc);
67         inc = inc/my_var_decay;
68     }
69 
70     for(int i=0; i<involved_lits.size(); i++){
71         Var v =var(involved_lits[i]);
72         //        double old_act = activity_distance[v];
73         //        activity_distance[v] += var_iLevel_inc * var_iLevel_tmp[v];
74         activity_distance[v] += var_iLevel_tmp[v]*level_incs[var_iLevel_tmp[v]-1];
75 
76         if(activity_distance[v]>1e100){
77             for(int vv=0;vv<nVars();vv++)
78                 activity_distance[vv] *= 1e-100;
79             var_iLevel_inc*=1e-100;
80             for(int j=0; j<max_level; j++) level_incs[j]*=1e-100;
81         }
82         if (order_heap_distance.inHeap(v))
83             order_heap_distance.decrease(v);
84 
85         //        var_iLevel_inc *= (1 / my_var_decay);
86     }
87     var_iLevel_inc = level_incs[level_incs.size()-1];
88     return true;
89 }

 

   

 4.固定冲突支配点(排查点)充分利用查询观察元序列获取多个冲突思想——文献查询

4.1

 

个人最新理解:

c =[x1, -p, x2, x3, x4]      写成 c = [x1, -p, x2, q, x4]

如果trail=[..., p]时,排查p的观察元序列,找到子句c时,当x2为假,则依次排查到x3。x3不为假,该观察元没有BCP价值,但是可以将-x3的观察中增加针对此时c子句的观察元,c =[x1, x3, x2, -p, x4],也可以写成c =[x1, q, x2, -p, x4]   。作为后续传播到-q文字,排查-q的观察元序列时,当排查到子句c时,该子句2~k位置上的为假的文字已经多起来了。可见对p的排查相关信息可以用于后续对q的排查。

c =[x1, -p, x2, x3, x4]   

 

Chaff: Engineering an Efficient SAT Solver

 

 [Y1] Matthew W. MoskewiczConor F. MadiganYing ZhaoLintao ZhangSharad Malik:
Chaff: Engineering an Efficient SAT Solver. DAC 2001: 530-535

 

 

译文:它展示了单个子句的观察文字在一系列赋值和取消赋值下是如何变化的。

 

 

 

 

 4.2

 

A Complete Multi-valued SAT Solver

Jain S., O’Mahony E., Sellmann M. (2010) A Complete Multi-valued SAT Solver. In: Cohen D. (eds) Principles and Practice of Constraint Programming – CP 2010. CP 2010. Lecture Notes in Computer Science, vol 6308. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-15396-9_24

 

It features watched literal propagation and conflict driven clause learning.译文:它的特点是观看文字传播和冲突驱动的从句学习。

注:该文献有对蕴含图的分析例子

 

 

Memory Efficient All-Solutions SAT Solver and Its Application for Reachability Analysis

Grumberg O., Schuster A., Yadgar A. (2004) Memory Efficient All-Solutions SAT Solver and Its Application for Reachability Analysis. In: Hu A.J., Martin A.K. (eds) Formal Methods in Computer-Aided Design. FMCAD 2004. Lecture Notes in Computer Science, vol 3312. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-30494-4_20

 

 

A branching heuristic for SAT solvers based on complete implication graphs

Xiao, F., Li, CM., Luo, M. et al. A branching heuristic for SAT solvers based on complete implication graphs. Sci. China Inf. Sci. 62, 72103 (2019). https://doi.org/10.1007/s11432-017-9467-7

 

when a variable needs more clauses to imply a conflict, it has lower probability of being involved in a future conflict.

译文:当一个变量需要更多的子句来暗示冲突时,它卷入未来冲突的概率就会降低。

   

 


 

5.重点学习文献

Unravelling SAT: Discussion on the Suitability and Implementation of Graph Convolutional Networks for Solving SAT

Angne H., Atkari A., Dhargalkar N., Kale D. (2021) Unravelling SAT: Discussion on the Suitability and Implementation of Graph Convolutional Networks for Solving SAT. In: Senjyu T., Mahalle P.N., Perumal T., Joshi A. (eds) Information and Communication Technology for Intelligent Systems. ICTIS 2020. Smart Innovation, Systems and Technologies, vol 196. Springer, Singapore. https://doi.org/10.1007/978-981-15-7062-9_25

Abstract

 

NP-complete class of problems have a wide range of applications in the real world. With the purpose of finding new ways to solve these problems, this study looks to use SAT as a representative of the NP-complete class. It looks to assimilate SAT with the intention of solving it by way of modeling its instances using graph neural networks, particularly a graph convolutional network.

译文:它试图通过图神经网络(尤其是图卷积网络)对其实例进行建模来解决SAT问题

Modeling SAT formulae as graph representations is motivated by the fact that properties of the SAT equations can be aptly depicted by visualizing clauses, literals, and the corresponding relationships between them as a graph.

译文:将SAT公式建模为图形表示是基于这样一个事实:SAT方程的性质可以通过可视化子句、文字以及它们之间的对应关系作为图形来恰当地描述。

   

Keywords

SAT 、Deep graph library 、Graph representations 、Graph convolutional network 、NetworkX library 、SATLIB 、NP-complete class 、Deep learning 

1 Introduction

 

This study is an endeavor to understand the issues and various factors that have to be considered to use graph neural network (GNN) architectures to solve the satisfiability problem (SAT).译文:本研究旨在瞭解利用图神经网络架构解决可满足性问题(SAT)时需要考虑的问题及各种因素

SAT is a part of the NP-complete class of problems that have real-life manifestations in a wide range of realms. Exact solutions to these problems are extremely expensive to compute. 译文:计算这些问题的精确解是极其昂贵的。

Hence, approximate algorithms that use heuristics have been employed to solve them.译文:因此,利用启发式的近似算法来解决它们。

The heuristic approach demands the study of the properties of these problems along with careful consideration of new approaches to solving them. 译文:启发式方法要求研究这些问题的性质,并仔细考虑解决这些问题的新方法。

The NP-complete class of problems are all polynomial-time reducible to each other which implies that solving one of them by an efficient method results in generating an efficient solution for all problems in the class.

Hence, in this study, just as in Atkari et al. [1], we focus on solving SAT, with an implication of solving the entire NP-complete class.

   
 

Graph neural network models are a type of artificial neural network that work on graphical inputs and can be interpreted to have a neural network on each of the edges of its input graph.译文:图神经网络模型是一种基于图形输入的人工神经网络,可以解释为在其输入图的每条边上都有一个神经网络。

It has been found that the graph representations produced from SAT instances exhibit properties of the instances within their graphical structures aptly (Nudelman et al. [2]), owing to which an approach of employing graph neural networks to model SAT instances is appropriate.译文:已经发现,从SAT实例产生的图表示可以恰当地展示其图形结构中实例的属性(Nudelman et al.[2]),因此,使用图神经网络对SAT实例建模的方法是合适的。

Furthermore, Bunz et al. [3] and especially Selsam et al. [4] talk about how not only graph neural networks are instrumental in uncovering the theoretical properties of SAT and solving it, but modeling these instances can also give insights into explaining how neural networks make decisions.译文:此外,Bunz等人[3],特别是Selsam等人[4]讨论了图神经网络如何有助于揭示SAT的理论特性并解决它,而且对这些实例进行建模也有助于解释神经网络如何做出决策。

   
 

This study encompasses getting familiar with the different graph representations of SAT, making use of Uniform Random 3-SAT (Hoos et al. [5]) datasets, and looks to then figure out an approach to store these graphs, a way to implement a graph convolutional network, eventually train this model on said graphical instances and analyze the results.

译文:这项研究包括熟悉SAT的不同图形表示形式,利用均匀随机3-SAT (hoo et al。[5])的数据集,然后找出一个方法,存储这些图表,来实现图像卷积网络,最终训练该模型表示图形实例和分析结果。

  • 利用均匀随机3-SAT (hoo et al。[5])的数据集
  • 熟悉SAT的不同图形表示形式
  • 找出一个方法,存储这些图表
  • 实现图像卷积网络,最终训练该模型表示图形实例和分析结果

 

   

2 Literature Review

 

Being an extrapolation of the findings of Atkari et al. [1], this study seeks to improve on the underwhelming f1-scores obtained using statistical machine learning models in the former. Furthermore, with the intention of using graph neural network models, this study will directly make use of graph representations discussed in Atkari et al. [1] which have been used to derive numerical features as a part of feature engineering done for the machine learning models. Delvin et al. [6] likewise makes use of statistical machine learning models although models divergent datasets. The SATLIB Uniform Random 3-SAT datasets will be used in this study as described in Hoos et al. [5].

译文:作为Atkari等人[1]研究结果的外推,本研究旨在改善前一研究中使用统计机器学习模型获得的令人印象不深刻的f1分数。此外,为了使用图神经网络模型,本研究将直接使用Atkari等人在[1]中讨论的图表示,这些图表示用于获得数字特征,作为为机器学习模型所做的特征工程的一部分。Delvin等人的[6]同样利用了统计机器学习模型,尽管模型是不同的数据集。

   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

3 Graph Representations of SAT

  Graphs capture the characteristics of SAT instances to effectively help compute how probable it is for a given instance to be satisfiable. The following are some of the representations identified.
   
 

3.1 Graph Representation

  Variable Graph: The variable graph consists of variables, one variable for a pair of positive and negative literals, within an instance considered as graph nodes. In this representation, an edge occurs between variable nodes if they occur in the same clause together in the instance at least once.译文:在这种表示中,如果变量节点在实例中的同一子句中同时出现至少一次,则它们之间就会出现边。
   
  Variable-Clause Bipartite Graph: The variable-clause bipartite graph considers all variables and clauses of an instance as nodes, where variable and clause nodes are distinctly identified. 译文:变子句二部图将一个实例的所有变量和子句视为节点,其中变量节点和子句节点被清楚地标识。No variable nodes are connected to each other, likewise for the clause nodes. Edges only occur between a variable-clause pair, and hence, it is bipartite in nature. 译文:变量节点之间没有相互连接,子节点也是如此。边只出现在变量子句对之间,因此,它本质上是二部的。A variable node is connected to a clause node if the literal corresponding to the variable occurs in that clause within an instance.译文:如果变量节点对应的文字出现在实例中的子句中,则将变量节点连接到子句节点。
   
 

Clause Graph: The clause graph considers clauses within an instance as nodes. If a clause contains a literal and another clause contains the conjugate of said literal, then these two clauses are connected to each other by an edge.

译文:子句图:子句图将实例中的子句视为节点。如果一个子句包含一个字面值,而另一个子句包含该字面值的共轭词,那么这两个子句由一条边连接在一起

   
 

NeuroSAT Representation:

As discussed above, NeuroSAT considers the literals as well as clauses from an instance as nodes.译文:NeuroSAT将实例中的文字和子句视为节点。

It takes a two-stage approach of message passing, wherein the first set of directed edges are from literals to the clauses they participate in, and the second set of directed edges are from the clauses to the literals that participate in them as well as from a literal to its conjugate literal.

译文:它采用两阶段的消息传递方法。

译文:第一阶段有向边是从文字到它们所参与的子句。

译文:第二阶段有向边是从子句到参与它们的字面值,以及从字面值到它的共轭字面值。

   

4 Dataset and Processing

 

The SATLIB Uniform Random 3-SAT datasets have been used to train and test the graph convolutional network. These have been described in Hoos et al. [5], having a varying number of variables and clauses described as cnf files that are preprocessed to make lists in Python.

译文:利用SATLIB均匀随机3-SAT数据集对图卷积网络进行训练和测试。这些已经在Hoos等人的[5]中描述过了,它们具有数量不一的变量和子句,被描述为cnf文件,这些文件在Python中被预处理以生成列表

Each list for an instance contains a list for each clause within which are included the literals that participate in the clause represented as integers. A negative literal is represented as a negative integer.

译文:实例的每个列表包含每个子句的列表,子句中包含以整数表示的子句中的字面值。负文字表示为负整数。

The study as of now makes use of two graph representations, namely the variable graph and the variable-clause bipartite graph.

Moving forward the NeuroSAT representation and the clause graph will also be put to use.

译文:接下来,NeuroSAT表示和子句图也将被使用。

Initially, two-dimensional lists were used as the data structures to store instance graphs which eventually changed to implementing the graphs using the NetworkX library from Hagberg et al. [12].译文:最初,二维列表被用作存储实例图的数据结构,最终改为使用Hagberg等人的NetworkX库来实现这些图。

This library has tools to represent, carry out operations on, and visualize complex networks from various different realms.译文:这个库有工具来表示、执行操作,并可视化来自不同领域的复杂网络。

   
 

Figure 1 shows a variable graph with nodes labelled as integers, and Fig. 2 shows a variable-clause bipartite graph with variable nodes labelled starting with a ’v’ and clause nodes with a ’c’ followed by integers.

Figure 3 shows a section of the variable-clause bipartite graph of the same SAT instance. Both these graphs are built for a single instance of a boolean expression with 20 variables and 91 clauses using NetworkX functions.

   
 

As discussed previously, graph convolutional networks do not support transfer or inductive learning, owing to which the individual graphs of each of the instances are first combined together using the deep graph library’s batch method. This then allows the entire stack of instance graphs to be given to the graph neural network to be trained and tested on.

译文:如前所述,图卷积网络不支持迁移或归纳学习,因此每个实例的单个图首先使用deep graph library的批处理方法组合在一起。这样就可以将整个实例图堆栈交给图神经网络进行训练和测试

   

5 Graph Neural Network Implementation

 

Various graph neural networks (GNNs) are built using graph convolutional networks (GCNs). GCNs are a specific implementation of graph neural networks.译文:利用图卷积网络(GCNs)构建各种图神经网络(GNNs)。GCNs是图神经网络的一种具体实现。

A graph neural network performs convolution operation on a graph, instead of on an image composed of pixels. Just like CNN which aims to extract the most important information from the image to classify the image, a GCN passes a filter over the graph, looking for essential vertices and edges that can help classify nodes within the graph.译文:图神经网络在图上执行卷积操作,而不是在由像素组成的图像上。就像CNN的目标是从图像中提取最重要的信息来对图像进行分类一样,GCN在图上通过一个过滤器,寻找可以帮助对图中的节点进行分类的基本顶点和边。

   
 

After multiple efforts with the tf-gnn models, we came across many issues and resorted to moving to PyTorch implementations instead of the former TensorFlow implementations.译文:在多次使用tf-gnn模型之后,我们遇到了很多问题,于是我们转向了PyTorch实现,而不是以前的TensorFlow实现。

As of now, PyTorch provided some of the best graph convolutional network models that were used by us. Primarily, the deep graph library built on top of PyTorch was used by us to model the various graph representations and for implementing the GCN models.译文:到目前为止,PyTorch提供了我们使用的一些最好的图卷积网络模型。首先,我们使用建立在PyTorch之上的深度图库来建模各种图表示并实现GCN模型。

   
 

In practice, we can use DGL implementation that makes efficient use of GPU for various calculations. In the DGL batch process, graphs of variable sizes can be an input to the network.译文:在实践中,我们可以使用DGL实现来高效地使用GPU进行各种计算。在DGL批处理过程中,可变尺寸的图可以作为网络的输入。

In this method, a bunch of graphs is processed at once during the training phase for classification. The initial node features of the graphs are the node degrees. 译文:在该方法中,在训练阶段对一堆图进行处理以进行分类。图的初始节点特征是节点度

After a certain number of rounds of graph convolution, a graph readout is performed by averaging overall features for each graph in the batch.译文:经过一定轮数的图卷积后,通过对批处理中每个图的总体特征取平均值来进行图读出。

   
 

For the various graph representations, we used NetworkX [12], a Python language package for exploration and analysis of networks and network algorithms.译文:对于各种图形表示,我们使用NetworkX[12],一个用于探索和分析网络和网络算法的Python语言包。

Although we faced problems in integrating the NetworkX graphs with the DGL models, we modelled DGL representations of the graphs using the graph convolutional network. 译文:尽管我们在将NetworkX图与DGL模型集成时遇到了一些问题,但我们使用graph convolutional network对图的DGL表示进行了建模。

This was also owing to the fact that the DGL graphs had the functionality of being batched together to perform the training operation as discussed in the previous sections.译文:这也是由于DGL图具有像前面几节中讨论的那样被批处理以执行训练操作的功能。

   

6 Conclusions

 

With evidence from the studies reviewed, it is certain that instances of SAT represented as graphs do exhibit characteristics of SAT and that graph neural network architectures can be used to model them.

译文:根据回顾的研究的证据,可以肯定的是,以图表示的SAT实例确实表现出SAT的特征,并且图神经网络体系结构可以用来对这些特征进行建模。

   
  In this study, we managed to discuss four different graph representations with respect to the Uniform Random 3-SAT datasets from the SATLIB repository. From these, the variable graph and the variable-clause bipartite graph representations have been visualized using the NetworkX library. The GCN was implemented using the deep graph library which is built on top of PyTorch.译文:在本研究中,我们设法讨论了四种不同的图表示关于统一随机3-SAT数据集从SATLIB库。从这些,变量图和变量子句二部图表示已经使用NetworkX库可视化。GCN是使用建立在PyTorch之上的deep graph库实现的。
   
 

The data structure obtained using the NetworkX library was not used as an input to the GCN model because all the instance graphs could not be batched together. The DGL batch process was successfully used for this purpose instead. Such a batching is required owing to the fact that the GCN model does not support inductive learning. This implemented GCN model has further been trained on the batched data.

译文:使用NetworkX库获得的数据结构没有用作GCN模型的输入,因为不能将所有实例图批处理在一起。DGL批处理过程成功地用于此目的。由于GCN模型不支持归纳学习,所以需要这样的批量处理。这个实现的GCN模型在批处理数据上进行了进一步的训练。

   

7 Future Scope 发展方向

 

The framework which was described for classification of SAT instances will be deployed for analysis. The efficiency of the model will be measured on various metrics like the f1 score, precision, and recall.

 

The implications of the graph convolution network correctly classifying the SAT instances are tremendous as the value of each node in the network can be used to predict the satisfiability of each clause within the instance. A comparative study will be performed to compare this approach with other machine learning, deep learning models, and existing approximate algorithms. 译文:图卷积网络对SAT实例进行正确分类的意义是巨大的,因为网络中每个节点的值可以用来预测实例中每个子句的可满足性。我们将进行比较研究,将这种方法与其他机器学习、深度学习模型以及现有的近似算法进行比较。

Currently, we hypothesize these comparisons to be based on the time and space complexities of these algorithms. This will also be subject to the understanding of such complexities with respect to machine learning and deep learning models.译文:目前,我们假设这些比较是基于这些算法的时间和空间复杂性。这也将取决于对机器学习和深度学习模型的复杂性的理解。

 

This study will look to uncover some theoretical properties of satisfiable and unsatisfiable instances that owe themselves to the satisfiability problem.译文:本研究将寻找揭示一些理论性质的可满足和不可满足的实例,欠自己的可满足问题。

 

The process of using graph convolutional network, alone, to classify the SAT instances is described in this paper. Likewise, other different forms of graph neural networks can be employed similarly for classification.译文:本文描述了单独使用图卷积网络对SAT实例进行分类的过程。同样,其他不同形式的图神经网络也可以用类似的方法进行分类。

   

References

 
  1. 1.
    Atkari, A., Dhargalkar, N., Angne, H.: Employing machine learning models to solve uniform random 3-SAT. In: Jain, L., Tsihrintzis, G., Balas, V., Sharma, D. (eds) Data Communication and Networks. Advances in Intelligent Systems and Computing, vol. 1049. Springer, Singapore (2020)Google Scholar
  2. 2.
    Eugene, N., Devkar, A., Shoham, Y., Leyton-Brown, K.: Understanding random SAT: beyond the clauses-to-variables ratio. In: IEEE Transactions on 27th International Conference on Advanced Information Networking and Applications Workshops (2013)Google Scholar
  3. 3.
    Bunz, B., Lamm, M., Merlo, A.: Graph neural networks and Boolean satisfiability. In: Proceedings of the 28th Annual ACM Symposium on Applied Computing, pp. 1852–1858. ACM New York, NY, USA, March 2013Google Scholar
  4. 4.
    Daniel, S., Lamm, M., Bunz, B., Liang, P. Dill, D.L., de Moura, L.: Learning a SAT solver from single-bit supervision. In: Proceeding of the International Conference on BioMedical Computing (2012)Google Scholar
  5. 5.
    Hoos, H.H., Stützle, T., Gent, I.P., van Maaren, H.: Toby Walsh. An Online Resource for Research on SAT. Kluwer Academic Publishers, SATLIB (2000)Google Scholar
  6. 6.
    Devlin, D., O’Sullivan, B.: Satisfiability as a classification problem. Proc. J. Global Res. Comput. Sci. 4(4), (2013)Google Scholar
  7. 7.
    Xu, L., Hutter, F., Hoos, H.H., Leyton-Brown, K.: SATzilla-07: the design and analysis of an algorithm portfolio for SAT. In: Bessière, C. (eds.) Principles and Practice of Constraint Programming—CP: CP 2007. Lecture Notes in Computer Science, vol. 4741. Springer, Berlin (2007)Google Scholar
  8. 8.
    Zhou, J., Cui, G., Zhang, Z., Yang, C., Liu, Z., Sun, M.: Graph neural networks: a review of methods and applications. Computer Science. ArXiv, Mathematics (2018)Google Scholar
  9. 9.
    Wang, M., Yu, L., Zheng, D., Gan, Q., Gai, Y., Ye, Z., Li, M., Zhou, J., Huang, Q., Ma, C., Huang, Z., Guo, Q., Zhang, H., Lin, H., Zhao, J., Li, J., Smola, A.J., Zhang, Z.: Deep graph library: towards efficient and scalable deep learning on graphs. In: ICLR Workshop on Representation Learning on Graphs and Manifolds (2019)Google Scholar
  10. 10.
    Defferrard, M., Bresson, X., Vandergheynst, P.: Convolutional neural networks on graphs with fast localized spectral filtering. In: Proceedings of the 30th International Conference on Neural Information Processing Systems (NIPS’16), pp. 3844–3852. Curran Associates Inc., Red Hook, NY, USA (2016)Google Scholar
  11. 11.
    Kipf, T., Welling, M.: Semi-supervised classification with graph convolutional networks. ICLR, 2017 (2016)Google Scholar
  12. 12.
    Hagberg, A.A., Schult, D.A., Swart, P.J.: Exploring network structure, dynamics, and function using NetworkX. In: Varoquaux, G., Vaught, T., Millman, J. (eds.) Proceedings of the 7th Python in Science Conference (SciPy2008), Pasadena, CA USA, pp. 11–15, Aug 2008Google Scholar
   
posted on 2021-01-05 22:06  海阔凭鱼跃越  阅读(186)  评论(0编辑  收藏  举报