Documentation
¶
Overview ¶
Package model provides a data structure for Boolean models in LogicNG. A model is just a list of literals.
In contrast to the assignment found in the assignment package, a model stores the literals internally just as a list without checking for duplicates or contrary assignments. This makes their generation more performant. Models usually are used by algorithms (like model enumeration, or getting a model from a solver) which guarantee that the stored literals are unique and contradiction-free.
Index ¶
- type Model
- func (m *Model) AddLiteral(literals ...f.Literal)
- func (m *Model) Assignment(fac f.Factory) (*assignment.Assignment, error)
- func (m *Model) Formula(fac f.Factory) f.Formula
- func (m *Model) NegLits() []f.Literal
- func (m *Model) NegVars() []f.Variable
- func (m *Model) PosVars() []f.Variable
- func (m *Model) Size() int
- func (m *Model) Sprint(fac f.Factory) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
A Model represents a list of literals.
func FromAssignment ¶
func FromAssignment(fac f.Factory, ass assignment.Assignment) *Model
FromAssignment generates a new model from a given assignment.
func (*Model) AddLiteral ¶
AddLiteral adds the given literals to the model.
func (*Model) Assignment ¶
func (m *Model) Assignment(fac f.Factory) (*assignment.Assignment, error)
Assignment returns an assignment from the model. Returns an error if this model contains complementary literals (which should not happen if used right).
func (*Model) Formula ¶
Formula returns a formula for the model which is the conjunction of its literals.
Directories
¶
Path | Synopsis |
---|---|
Package count provides algorithms for counting models on formulas in LogicNG.
|
Package count provides algorithms for counting models on formulas in LogicNG. |
Package enum provides algorithms to perform model enumeration on formulas in LogicNG.
|
Package enum provides algorithms to perform model enumeration on formulas in LogicNG. |
Package iter gathers functionality for model iteration in LogicNG.
|
Package iter gathers functionality for model iteration in LogicNG. |