cnf

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 4, 2024 License: MIT Imports: 6 Imported by: 1

README

cnf

CNF and DIMACS in Go. Inspired by mitchellh/go-sat.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Clause

type Clause []Lit

func NewClause

func NewClause(x []int) Clause

func (Clause) Int

func (c Clause) Int() []int

type Formula

type Formula []Clause

func NewFormula

func NewFormula(x [][]int) Formula

func (Formula) Int

func (f Formula) Int() [][]int

func (Formula) SortBySize

func (f Formula) SortBySize()

type Lit

type Lit int32

func NewLit

func NewLit(v int) Lit

func (Lit) Int

func (l Lit) Int() int

func (Lit) Neg

func (l Lit) Neg() Lit

func (Lit) Sign

func (l Lit) Sign() bool

func (Lit) String

func (l Lit) String() string

func (Lit) Var

func (l Lit) Var() int

type Problem

type Problem struct {
	Variables int
	Clauses   int
	Formula   Formula
}

func ParseDIMAC

func ParseDIMAC(r io.Reader) (*Problem, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL