首页 > 其他分享 >简化版本的kissat--Sat Solver SATCH

简化版本的kissat--Sat Solver SATCH

时间:2023-08-19 16:24:38浏览次数:38  
标签:code features solver -- Solver SATCH sh satch configure

 

 

 

Sat Solver SATCH

This is the source code of SATCH a SAT solver written from scratch in C.

The actual version number can be found in VERSION and changes in the latest release are documented in NEWS.md.

The main purpose of this solver is to provide a simple and clean code base for explaining and experimenting with SAT solvers. It is simpler than the source code of CaDiCaL and particularly Kissat, while still featuring most important implementation techniques needed to obtain a state-of-the-art SAT solver. However, even though current version has bounded variable elimination implemented, which is arguably the most important preprocessing and inprocessing procedure, but still lacks other preprocessing techniques and only supports incremental solving partially.

The code and its documentation is also meant to serve as a gentle introduction into the code base of CaDiCaL and Kissat.

It is possible to switch off general and more basic features at compile time by using different options to configure. For instance completely disabling clause learning can be achieved with ./configure --no-learn. This not only gives a clean separation of features in the code but also makes it easier to disable (through the C pre-processor) redundant not needed code anymore if a certain feature is disabled.

For a more complete SAT solver you might want to use CaDiCaL, particularly for incremental usage, and for fastest solving fall back to Kissat.

Building

Run

./configure && make test

to build and test the solver binary satch as well as the library libsatch.a:

The source of the application and library consists of the following:

  • satch.c provides the library code of the SAT solver
  • features.h checks consistency of feature selection
  • colors.h defines shared code for using terminal colors
  • rsort.h is a generic radix sort implementation (header file only)
  • stack.h is a generic stack implementation (header file only)
  • queue.h simplistic queue implementation (header file only)
  • config.c provides build-information generated by mkconfig.sh
  • main.c contains application code with parser and witness printer

In the features sub-directory reside the followings files read by features.h:

You might want to consult features/README.md for more information on their meaning and how they are generated.

The files used by the build process are the following:

The configure script will generate makefile from the template makefile.in. The default make goal all first calls mkconfig.sh to generate config.c to record build and version information. Then the object files config.osatch.o and main.o are compiled. The first two are combined to form the library libsatch.a which is linked against main.o to produce the solver binary satch. The test target will call the shell script tatch.sh, which performs tests on CNFs in the cnfs and xnfs directories. See below for information on testing and debugging.

Refer to ./configure -h for build options and after building the solver to ./satch -h for run-time options of the solver (solver usage is also shown at the top of main.c. For debugging you can use ./configure -g and optionally then at run-time also enable logging with ./satch -l.

Testing

For testing and debugging the following are used:

  • cnfs directory containing CNF files for testing
  • xnfs directory containing XNF files for testing
  • catch.h header file of internal proof checker for testing and debugging
  • catch.c implementation of internal proof checker for testing and debugging
  • testapi.c simple separate (preliminary) API test suite
  • tatch.sh test suite for CNFs in cnfs and xnfs and for building and running testapi
  • testapi binary built from testapi.c by tatch.sh

Furthermore, as we are having many different combinations of configurations, testing them is highly non-trivial and is achieved with the following:

We have a flexible combinatorial testing flow which uses gencombi to produce sets of configurations that can be tested with checkconfig.sh:

./gencombi         | ./checkconfig.sh    # covers all valid pairs
./gencombi -a 2    | ./checkconfig.sh    # 2-fold valid combinations
./gencombi -a 3    | ./checkconfig.sh    # 3-fold valid combinations
./gencombi -a -i 2 | ./checkconfig.sh -i # check invalid option pairs
 

The first of these uses the SAT solver to generate a set of configurations which covers all valid pairs of options and at the same time makes sure that there is a configuration which does not contain it. There are also corresponding make goals test-two-waystest-all-pairs, and test-all-triples.

Armin Biere
May 2021

   

标签:code,features,solver,--,Solver,SATCH,sh,satch,configure
From: https://www.cnblogs.com/yuweng1689/p/17642597.html

相关文章

  • 8.19 模拟赛小结
    前言结束了也许这几天很苦但也是最有意义的几天这篇写简单一点吧T1颠倒黑白很强的构造题根据打表找出思路因为最左下角的是一定要点的就考虑它如果是先手左下角有黑色就把它点了后手只能帮我们把其它黑色点了最后还是我们先点完若是后手左下角是白色与先手同......
  • linux基础
    1.计算机基础美团单车内存-ram读写速度快-运行程序-程序从闪存加载到[内存]中运行掉电数据丢失临时存储数据闪存-rom读写速度慢掉电数据不丢失-存储数据-存储信息永久存储数据程序运行下载微信-闪存手机:12+25612-内存256-闪存操作系统中的......
  • 矩形的对角线经过的小方格数量
    题目:  对于一个长度为m,宽为n的矩形,均分成m*n的小方格,求从左上角到右下角的对角线穿过多少个小方格?题解1:#include<iostream>#include<cmath>usingnamespacestd;intmain(){intn=1,t,a1=0,b1=0,a2,b2;//n计数器,a1、b1上一次统计过的长、宽方向......
  • Spring set 注入不同类型的参数
    案例建立复杂的数据类型Student类publicclassStudent{privateStringname;privateAddressaddress;privateList<String>books;privateMap<String,String>card;privatePropertiesinfo;privateStringwinner;privatebool......
  • 【csp-3】排列与组合
    组合:n个数选m个数,从小到大第k个选择是什么#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>#include<bits/stdc++.h>usingnamespacestd;intflag,n,m,a[21],vis[21],k,sum;voiddfs(intnow,intlast){if(flag==1)re......
  • GNN学习 Knowledge Graph Embedding(更新中)
    GNN学习KnowledgeGraphEmbedding前面提到的方法都是只有一种边的类型,接下来要扩展到有向,多种边的类型的图上,即异质图(heterogeneousgraph)异质图有这样的几种类型:RelationalGCNsKnowledgeGraphsEmbeddingsforKGCompletion一个异质图可以被定义为\(G=(V,E,R,T)\)......
  • Leetcode 146 LRUCache
    /***Copyright(C)2023-08-1813:51zxinlog<[email protected]>**/#include<func.h>#defineN1000//普通NodetypedefstructNode{intkey;intvalue;structNode*prev;structNode*next;}Node;//定义HashNodetyped......
  • 关于医疗反腐说说个人的一些经历
    14年的时候,家里母亲脖子痛,带其去某三甲医院看病,大夫给出的治疗方案是做微创手术,本着花钱治病的想法也就没多想,不过就在要办手续之前突然想到自己的一个同学在这个医院实习,然后联系了自己的那个同学。当时正好这个同学是给院长打下手,医院里面的人也都能说上几句话,于是他帮我问了一......
  • 【Spring Boot】Bean字段校验-JSR303
    规范:JSR303 BeanValidation1.0 开发过程:1、Bean定义字段校验规则:2、Controller引入@Valid(来自)或@Validated(来自org.springframework.validation.annotation)触发校验样例如下:背景知识:1.HibernateValidator定义Bean字段校验的注解和校验器实现......
  • 配置snmptrap服务器写入日志并通过邮件报警
    配置snmptrap服务器写入日志并通过邮件报警安装相关软件包yuminstallnet-snmpnet-snmp-utilsmailx修改snmptrapd配置文件/etc/snmp/snmptrapd.confdisableAuthorizationyesauthCommunitylog,execute,netpublictraphandledefault/usr/local/bin/traplog.sh......