Skip to content

pocke/go-minisat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-minisat

Golang binding for minisat.

Installation

Install minisat

Arch linux

$ yaourt -S minisat-git

Other

$ git clone https://github.com/niklasso/minisat
$ cd minisat
$ make config prefix="/usr"
$ make
$ sudo make install

Install go-minisat

$ go get github.com/pocke/go-minisat

Usage

package main

import (
  "github.com/pocke/go-minisat"
)

func main() {
  s := minisat.NewSolver()
  v1 := minisat.NewVar()
  v2 := minisat.NewVar()
  s.AddClause(v1, v2)
  s.AddClause(v1, v2.Not())
  s.AddClause(v1.Not(), v2.Not())
  s.Solve()  // => true

  s.ModelValue(v1)  // => true, nil
  s.ModelValue(v2)  // => false, nil
}

Example

License

Copyright © 2015 Masataka Kuwabara Licensed [MIT][mit] [MIT]: http://www.opensource.org/licenses/mit-license.php

About

Golang binding for Minisat

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published