GitXplorerGitXplorer
m

go-sat

public
21 stars
1 forks
1 issues

Commits

List of commits on branch master.
Unverified
982ce65bb11411248a8bc7155c9eac4fa38ab35c

Update README.md

mmarcvanzee committed 9 years ago
Unverified
2fb94bf195429d018abbfae43388c84c2ede8864

Cleaned up code

mmarcvanzee committed 9 years ago
Unverified
aa10c7fe058b8a2e85f341912342c5b21aabae82

Update README.md

mmarcvanzee committed 9 years ago
Unverified
e8b8608165193e7f47fd666394ca8007e4b01609

Update README.md

mmarcvanzee committed 9 years ago
Unverified
4a87c5d86a181794d86709ee49543cccc4f5be2d

Update README.md

mmarcvanzee committed 9 years ago
Unverified
5d80759ccdb5930ab5263a065eeb74936f9ae365

Create README.md

mmarcvanzee committed 9 years ago

README

The README file for this repository.

go-sat: Simple Go SAT Solver

A simple SAT solver that can either use a recursive or an iterative algorithm. The algorithm uses a watchlist to keep track of all the assignments (see Knuth's SAT0W program).

Much of the code is based on the Python implementation by sahands, which can be downloaded here. He also wrote a nice explanatory article that can be viewed here.

Installing

No additional packages are required. Get this package as follows:

go get github.com/marcvanzee/go-sat

Input syntax:

$ go run main.go -h
  -all
        Output all possible solutions (default true)                  
  -brief                                                              
        Only output variables assigned true                           
  -i string                                                           
        Read from given file instead of stdin                         
  -recursive                                                          
        Use recursive algorithm instead of iterative                
  -starting_with string                                               
        Only output variables with names starting with the given string
  -verbose                                          
        Verbose output (default true)              

The syntax for specifying a SAT problem is in Conjunctive Normal Forms (CNF). Each line represents a conjunct and consists of a sequence of literals separated by a space representing a disjunction of literals. Example:

a b c
~b
~c

Stands for (a OR b OR c) AND (NOT b) AND (NOT c), which has a single satisfying model, namely a=1, b=0, c=0.