首页 > 其他分享 >kissat的多输出-学习与修改2

kissat的多输出-学习与修改2

时间:2024-09-18 10:05:11浏览次数:9  
标签:输出 endif unsigned 修改 bool unsigneds kissat include

1. kissat结构体的基本数据成员回顾:

(1)子对象对应的相关类型

 
 1 #include "arena.h"  //包含#include "reference.h"  #include "stack.h"  #include "utilities.h"
 2 #include "array.h"
 3 #include "assign.h" //包含 #include "reference.h"
 4 #include "averages.h"
 5 #include "check.h"
 6 #include "classify.h"
 7 #include "clause.h"
 8 #include "cover.h"
 9 #include "extend.h"
10 #include "flags.h"
11 #include "format.h"
12 #include "frames.h"
13 #include "heap.h"
14 #include "kimits.h"
15 #include "kissat.h"
16 #include "literal.h"
17 #include "mode.h"
18 #include "options.h"
19 #include "phases.h"
20 #include "profile.h"
21 #include "proof.h"
22 #include "queue.h"
23 #include "random.h"
24 #include "reluctant.h"
25 #include "rephase.h"
26 #include "smooth.h"
27 #include "stack.h"
28 #include "statistics.h"
29 #include "value.h"
30 #include "vector.h"
31 #include "watch.h"
32 
33 typedef struct datarank datarank;
34 
35 struct datarank {
36   unsigned data;
37   unsigned rank;
38 };
39 
40 typedef struct import import;
41 
42 struct import {
43   unsigned lit;
44   bool extension;
45   bool imported;
46   bool eliminated;
47 };
48 
49 typedef struct termination termination;
50 
51 struct termination {
52 #ifdef COVERAGE
53   volatile uint64_t flagged;
54 #else
55   volatile bool flagged;
56 #endif
57   volatile void *state;
58   int (*volatile terminate) (void *);
59 };
60 
61 // clang-format off
62 
63 typedef STACK (value) eliminated;
64 typedef STACK (import) imports;
65 typedef STACK (datarank) dataranks;
66 typedef STACK (watch) statches;
67 typedef STACK (watch *) patches;
68 
69 // clang-format on
70 
71 struct kitten;

 

   

kissat类型声明中的数据成员与成员函数

 
  1 struct kissat {
  2 #if !defined(NDEBUG) || defined(METRICS)
  3   bool backbone_computing;
  4 #endif
  5 #ifdef LOGGING
  6   bool compacting;
  7 #endif
  8   bool extended;
  9   bool inconsistent;
 10   bool iterating;
 11   bool preprocessing;
 12   bool probing;
 13 #ifndef QUIET
 14   bool sectioned;
 15 #endif
 16   bool stable;
 17 #if !defined(NDEBUG) || defined(METRICS)
 18   bool transitive_reducing;
 19   bool vivifying;
 20 #endif
 21   bool warming;
 22   bool watching;
 23 
 24   bool large_clauses_watched_after_binary_clauses;  //最长名称的布尔型数据成员
 25 
 26   termination termination;
 27 
 28   unsigned vars;
 29   unsigned size;
 30   unsigned active;
 31   unsigned randec;
 32 
 33   ints export;
 34   ints units;
 35   imports import;
 36   extensions extend;
 37   unsigneds witness;
 38 
 39   assigned *assigned;
 40   flags *flags;
 41 
 42   mark *marks;
 43 
 44   value *values;
 45   phases phases;
 46 
 47   eliminated eliminated;
 48   unsigneds etrail;
 49 
 50   links *links;
 51   queue queue;
 52 
 53   heap scores;
 54   double scinc;
 55 
 56   heap schedule;
 57   double scoreshift;
 58 
 59   unsigned level;
 60   frames frames;
 61 
 62   unsigned_array trail;
 63   unsigned *propagate;
 64 
 65   unsigned best_assigned;
 66   unsigned target_assigned;
 67   unsigned unflushed;
 68   unsigned unassigned;
 69 
 70   unsigneds delayed;
 71 
 72 #if defined(LOGGING) || !defined(NDEBUG)
 73   unsigneds resolvent;
 74 #endif
 75   unsigned resolvent_size;
 76   unsigned antecedent_size;
 77 
 78   dataranks ranks;
 79 
 80   unsigneds analyzed;
 81   unsigneds levels;
 82   unsigneds minimize;
 83   unsigneds poisoned;
 84   unsigneds promote;
 85   unsigneds removable;
 86   unsigneds shrinkable;
 87 
 88   clause conflict;
 89 
 90   bool clause_satisfied;
 91   bool clause_shrink;
 92   bool clause_trivial;
 93 
 94   unsigneds clause;
 95   unsigneds shadow;
 96 
 97   arena arena;
 98   vectors vectors;
 99   reference first_reducible;
100   reference last_irredundant;
101   watches *watches;
102 
103   reference last_learned[4];
104 
105   sizes sorter;
106 
107   generator random;
108   averages averages[2];
109   unsigned tier1[2], tier2[2];
110   reluctant reluctant;
111 
112   bounds bounds;
113   classification classification;
114   delays delays;
115   enabled enabled;
116   limited limited;
117   limits limits;
118   remember last;
119   unsigned walked;
120 
121   mode mode;
122 
123   uint64_t ticks;
124 
125   format format;
126 
127   statches antecedents[2];
128   statches gates[2];
129   patches xorted[2];
130   unsigneds resolvents;
131   bool resolve_gate;
132 
133   struct kitten *kitten;
134 #ifdef METRICS
135   uint64_t *gate_eliminated;
136 #else
137   bool gate_eliminated;
138 #endif
139   bool sweep_incomplete;
140   unsigneds sweep_schedule;
141 
142 #if !defined(NDEBUG) || !defined(NPROOFS)
143   unsigneds added;
144   unsigneds removed;
145 #endif
146 
147 #if !defined(NDEBUG) || !defined(NPROOFS) || defined(LOGGING)
148   ints original;
149   size_t offset_of_last_original_clause;
150 #endif
151 
152 #ifndef QUIET
153   profiles profiles;
154 #endif
155 
156 #ifndef NOPTIONS
157   options options;
158 #endif
159 
160 #ifndef NDEBUG
161   checker *checker;
162 #endif
163 
164 #ifndef NPROOFS
165   proof *proof;
166 #endif
167 
168   statistics statistics;
169 };

注意区别: 类型unsigned、类型unsigneds 以及数据成员unsigned unassigned;

                   类型assigned;有没有assigneds? 以及数据成员 assigned *assigned;

另: ints;

 

在文件reference.h中:

                  typedef unsigned reference;

                  typedef STACK (reference) references;

 

在文件stack.h中

                 typedef STACK (char) chars;
                 typedef STACK (int) ints;
                 typedef STACK (size_t) sizes;
                  typedef STACK (unsigned) unsigneds;

   

 

 

 

2.kissat求解器常用的宏定义:

  //internal.hpp
 

#define VARS (solver->vars)
#define LITS (2 * solver->vars)

#if 0
#define TIEDX (GET_OPTION (focusedtiers) ? 0 : solver->stable)
#define TIER1 (solver->tier1[TIEDX])
#define TIER2 (solver->tier2[TIEDX])
#else
#define TIER1 (solver->tier1[0])
#define TIER2 (solver->tier2[1])
#endif

#define SCORES (&solver->scores)

   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

 

3.主函数中调用kissat类型指针solver的函数及其相关函数:

 
//internal.hpp
1 static inline unsigned kissat_assigned (kissat *solver) { 2 assert (VARS >= solver->unassigned); 3 return VARS - solver->unassigned; 4 }

//区别于没有ed的传播赋值函数函数 kissat_assign (kissat *solver);

 

 

 //inlineassign.h
1 #ifdef FAST_ASSIGN 2 #define kissat_assign kissat_fast_assign 3 #endif 4 5 static inline void kissat_assign (kissat *solver, const bool probing, 6 const unsigned level, 7 #ifdef FAST_ASSIGN 8 value *values, assigned *assigned, 9 #endif 10 bool binary, unsigned lit, 11 unsigned reason) 12 { 13 ...... 14 } //这个函数至少有6各输出参数

 

   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   
   

标签:输出,endif,unsigned,修改,bool,unsigneds,kissat,include
From: https://www.cnblogs.com/yuweng1689/p/18417977

相关文章

  • windowns 修改RDP端口
    命令行操作$portvalue=13389#修改注册表Set-ItemProperty-Path'HKLM:\SYSTEM\CurrentControlSet\Control\TerminalServer\WinStations\RDP-Tcp'-name"PortNumber"-Value$portvalue#添加防火墙规则New-NetFirewallRule-DisplayName'RDPPORTLa......
  • Prometheus修改数据存储位置
    Prometheus修改数据存储位置Prometheus的数据存储位置可以通过配置文件中的--storage.tsdb.path参数来指定。默认情况下,数据存储在Prometheus安装目录下的data文件夹中。要修改数据存储位置,可以在Prometheus启动命令中添加或修改该参数。步骤1:修改Prometheus启动命令接......
  • 9.输出国际象棋棋盘。
    【程序9】题目:要求输出国际象棋棋盘。1.程序分析:用i控制行,j来控制列,根据i+j的和的变化来控制输出黑方格,还是白方格。方法一:importsysforiinrange(8):forjinrange(8):if(i+j)%2==0:sys.stdout.write(chr(219))......
  • 如何修改URL命名规则 让他更适合Google SEO优化
    为了使URL更符合Google的SEO优化标准,您可以遵循以下原则来修改您的URL命名规则:简洁明了:URL应该尽可能短小,避免冗长的路径。使用有意义的单词而不是数字或不相关的短语。使用关键词:在URL中包含目标关键词可以帮助搜索引擎理解页面的内容。但是避免过度堆砌关键词,这可......
  • [独家原创]基于(鳑鲏鱼)BFO-Transformer-GRU多特征分类预测【24年新算法】 (多输入单输
    [独家原创]基于(鳑鲏鱼)BFO-Transformer-GRU多特征分类预测【24年新算法】(单输入单输出)你先用你就是创新!!!(鳑鲏鱼)BFO优化的超参数为:隐藏层节点数、正则化系数、初始化学习率1.程序已经调试好,无需更改代码替换数据集即可运行!!!数据格式为excel!2.Transformer作为一种创新的神......
  • 【独家原创】基于TTAO-Transformer-BiLSTM多变量时序预测【24年新算法】 (多输入单输出
    【独家原创】基于TTAO-Transformer-BiLSTM多变量时序预测【24年新算法】(多输入单输出)程序已经调试好,无需更改代码替换数据集即可运行!!!数据格式为excel!【独家原创】TTAO-Transformer-BiLSTM多变量时序预测Matlab代码基于三角拓扑聚合算法优化Transformer结合双向长短期记忆......
  • ZeroTier-One配置moon修改端口
    此处均以linux环境为准1.安装moon,zerotier官方提供了比较方便的安装方式,一条命令即可完成:curl-shttps://install.zerotier.com/|sudobash2.生成moon配置文件cd/var/lib/zerotier-one#安装好zerotier后,自动会安装到此目录sudozerotier-idtoolinitmoonidentity......
  • 【SCI2区】麻雀搜索算法SSA-TCN-Multihead-Attention回归预测(多输入单输出)【含Matlab
    ✅博主简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,Matlab项目合作可私信或扫描文章底部QQ二维码。......
  • 程序修改题(31-40)
    第三十一题题目给定程序modi1.c中,函数fun的功能是:逐个比较p、q所指两个字符串对应位置中的字符,把ASCII值大或相等的字符依次存放到c所指数组中,形成一个新的字符串。例如,若主函数中a字符串为:aBCDeFgH主函数中b字符串为:ABcd则c中的字符串应为:aBcdeFgH。#include<st......
  • 如何修改边框的外观
    文章目录1.概念介绍2.使用方法3.示例代码我们在上一章回中介绍了DrawerHeaderWidget相关的内容,本章回中将介绍BoxDecorationWidget.闲话休提,让我们一起TalkFlutter吧。1.概念介绍我们在这里介绍的BoxDecorationWidget是一种修饰类组件,它不能单独使用,需......