maxsat

package
v0.0.0-...-b81de54 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var False falseConst = falseConst{}
View Source
var True trueConst = trueConst{}

Functions

func AddConstraint

func AddConstraint(inputConstraint string) error

func Evaluate

func Evaluate(constraint string) (bool, error)

func FlipLiteral

func FlipLiteral(literal string) error

func GetModel

func GetModel() (map[string]bool, error)

func Init

func Init()

func IsSat

func IsSat() bool

func ValidateConstraint

func ValidateConstraint(constraint string) (string, error)

Types

type Boolean

type Boolean bool

func (*Boolean) Capture

func (b *Boolean) Capture(values []string) error

type Conjunction

type Conjunction struct {
	Unary *Unary       `parser:"@@"`
	Next  *Conjunction `parser:"(AndOperator  @@)?"`
}

type Constant

type Constant struct {
	Value *Boolean `parser:"@( 'true' | 'false' )"`
}

type Disjunction

type Disjunction struct {
	Conjunction *Conjunction `parser:"@@"`
	Next        *Disjunction `parser:"(OrOperator  @@)?"`
}

type Expression

type Expression struct {
	Implication *Implication `parser:"@@"`
	Unique      *Unique      `parser:"|'{' @@ '}'"`
}

type Factor

type Factor struct {
	Constant      *Constant    `parser:"@@"`
	Literal       *Literal     `parser:"| @@"`
	SubExpression *Disjunction `parser:"| '(' @@ ')'"`
}

type Implication

type Implication struct {
	Left        *Disjunction `parser:"@@"`
	Implication *Disjunction `parser:"( ImplicationOperator  @@"`
	Equivalence *Disjunction `parser:"| EquivalenceOperator  @@ )?"`
}

type Literal

type Literal struct {
	Name string `parser:"@LiteralName"`
}

type Unary

type Unary struct {
	Not    string  `parser:"( @( NotOperator )"`
	Unary  *Unary  `parser:" @@ )"`
	Factor *Factor `parser:"| @@"`
}

type Unique

type Unique struct {
	First *Literal `parser:"@@"`
	Next  *Unique  `parser:"(','  @@)?"`
}

Jump to

Keyboard shortcuts

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