aiger

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: MIT Imports: 8 Imported by: 2

Documentation

Overview

Package aiger implements aiger format version 1.9 ascii and binary readers and writers.

The aiger objects are backed by sequential circuits as represented in *logic.S

Index

Constants

This section is empty.

Variables

View Source
var (
	PrematureEOF       = errors.New("premature EOF")
	ReadError          = errors.New("Read error")
	UnexpectedChar     = errors.New("Unexpected char")
	BadHeader          = errors.New("Bad header")
	BadUInt            = errors.New("malformed literal")
	BinaryMismatch     = errors.New("binary mismatch")
	InvalidLatchInit   = errors.New("invalid latch init value")
	LitOOB             = errors.New("Literal out of bounds")
	BadDeltaEncoding   = errors.New("Bad Delta Encoding")
	InvalidIndex       = errors.New("invalid index")
	InvalidSymbolType  = errors.New("invalid symbol type")
	InvalidName        = errors.New("invalid symbol name")
	SignedInput        = errors.New("input is negated")
	SignedLatch        = errors.New("latch is negated")
	SignedAnd          = errors.New("and gate def is negated")
	CombLoop           = errors.New("combinational logic has a loop")
	AndMultiplyDefined = errors.New("and gate multiply defined")
	UndefinedLit       = errors.New("literal not defined")
)

Errors related to IO and formatting

Functions

This section is empty.

Types

type T

type T struct {
	*logic.S    // The Boolean system backing this Aiger object
	Inputs      []z.Lit
	Outputs     []z.Lit
	Bad         []z.Lit   // Read/Write List of Bad state literals
	Constraints []z.Lit   // Read/Write List of Environment Constraints
	Justice     [][]z.Lit // Read/Write List of Justice Properties
	Fair        []z.Lit   // Read/Write List of Fairness Constraints
	// contains filtered or unexported fields
}

Type Aiger contains the information read from or written to disk in Aiger format version 1.9

func Copy

func Copy(a *T) *T

Copy makes a copy of an aiger object.

func Make

func Make(c int) *T

Make makes an Aiger object with initial capacity hint c for the underlying logic.S object

func MakeFor

func MakeFor(sys *logic.S, ms ...z.Lit) *T

MakeFor makes an Aiger object from a Boolean system. The system is the backing store for the Aiger object, no copy is made

func ReadAscii

func ReadAscii(r io.Reader) (*T, error)

ReadAscii reads an ascii coded Aiger file (version 1.9) ReadAscii returns a possibly nil Aiger object system paired with a possibly nil error. If the Aiger object is nil, the error is non-nil and indicates the underlying problem.

func ReadBinary

func ReadBinary(r io.Reader) (*T, error)

ReadBinary reads a binary Aiger file (version 1.9) Readbinary returns a possibly nil Aiger object paired with a possibly nil error. The error will be non-nil and describe the underlyng problem if the Aiger object is nil.

func (*T) BadName

func (a *T) BadName(index int) (string, bool)

BadName gives the name of the index'th Bad state in the aiger system. If no such name exists, BadName returns nil, false. Otherwise, BadName returns name, true.

func (*T) ConstraintName

func (a *T) ConstraintName(index int) (string, bool)

ConstraintName gives the name of the index'th Constraint in the aiger system. If no such name exists, ConstraintName returns nil, false. Otherwise, ConstraintName returns name, true.

func (*T) FairName

func (a *T) FairName(index int) (string, bool)

FairName gives the name of the index'th Fair in the aiger system. If no such name exists, FairName returns nil, false. Otherwise, FairName returns name, true.

func (*T) InputName

func (a *T) InputName(index int) (string, bool)

InputName gives the name of the index'th Input in the aiger system. If no such name exists, InputName returns (nil, false). Otherwise, InputName returns (name, true).

func (*T) JusticeName

func (a *T) JusticeName(index int) (string, bool)

JusticeName gives the name of the index'th Justice in the aiger system. If no such name exists, JusticeName returns nil, false. Otherwise, JusticeName returns name, true.

func (*T) LatchName

func (a *T) LatchName(index int) (string, bool)

LatchName gives the name of the index'th Latch in the aiger system. If no such name exists, LatchName returns nil, false. Otherwise, LatchName returns name, true.

func (*T) NameBad

func (a *T) NameBad(index int, nm string) error

Name index'th Bad State property with name nm return a non-nil error if index is out of bounds or nm contains a new line

func (*T) NameConstraint

func (a *T) NameConstraint(index int, nm string) error

Name index'th Constraint with name nm return a non-nil error if index is out of bounds or nm contains a new line

func (*T) NameFair

func (a *T) NameFair(index int, nm string) error

Name the index'th fairness constraint with name nm return a non-nil error if index is out of bounds or nm contains a new line

func (*T) NameInput

func (a *T) NameInput(index int, nm string) error

Name index'th input with name nm return a non-nil error if index is out of bounds or nm contains a new line

func (*T) NameJustice

func (a *T) NameJustice(index int, nm string) error

Name index'th justice property with name nm return a non-nil error if index is out of bounds or nm contains a new line

func (*T) NameLatch

func (a *T) NameLatch(index int, nm string) error

Name index'th Latch with name nm return a non-nil error if index is out of bounds or nm contains a new line

func (*T) NameOutput

func (a *T) NameOutput(index int, nm string) error

Name index'th output with name nm return a non-nil error if index is out of bounds or nm contains a new line

func (*T) NewIn

func (a *T) NewIn() z.Lit

func (*T) OutputName

func (a *T) OutputName(index int) (string, bool)

OutputName gives the name of the index'th Output in the aiger system. If no such name exists, OutputName returns nil, false. Otherwise, OutputName returns name, true.

func (*T) SetOutput

func (a *T) SetOutput(m z.Lit)

func (*T) Sys

func (a *T) Sys() *logic.S

Return the Boolean system backing this Aiger object

func (*T) WriteAscii

func (a *T) WriteAscii(w io.Writer) error

WriteAscii writes an ASCII version of AIGER format for the object a to the writer w. WriteAscii returns a non-nil error if there was an io error while writing.

func (*T) WriteBinary

func (a *T) WriteBinary(w io.Writer) error

WriteBinary writes the Boolean system sys in binary AIGER format (version 1.9) to the writer w. WriterAigerBinary returns an error if there was an io error while writing.

Notes

Bugs

  • This package does not support adding or retrieving aiger comments by an API.

Jump to

Keyboard shortcuts

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