twosat

package
v0.0.0-...-009c3dd Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2021 License: CC0-1.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TwoSat

type TwoSat struct {
	// contains filtered or unexported fields
}

TwoSat defines n, answer and scc

func New

func New(n int) *TwoSat

New creates a TwoSAT of n variables and 0 clauses

func (*TwoSat) AddClause

func (ts *TwoSat) AddClause(i int, f bool, j int, g bool)

AddClause adds a clause.

func (*TwoSat) Answer

func (ts *TwoSat) Answer() []bool

Answer returns a truth assignment that satisfies all clauses of the last call of satisfiable

func (*TwoSat) Satisfiable

func (ts *TwoSat) Satisfiable() bool

Satisfiable returns True if there is a truth assignment that satisfies all clauses

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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