Documentation ¶
Overview ¶
Package function gathers various functions on formulas. A formula function always takes a formula factory and formula as input and yields some computation result on this formula.
Currently, the following functions are implemented
- depth of a formula
- number of atoms
- number of nodes
- variable profile (how often does each variable occur in the formula)
- literal profile (how often does each literal occur in the formula)
- sub-formulas of a formula
Index ¶
- func FormulaDepth(fac f.Factory, formula f.Formula) int
- func LiteralProfile(fac f.Factory, formula f.Formula) map[f.Literal]int
- func NumberOfAtoms(fac f.Factory, formula f.Formula) int
- func NumberOfNodes(fac f.Factory, formula f.Formula) int
- func SubNodes(fac f.Factory, formula f.Formula) []f.Formula
- func VariableProfile(fac f.Factory, formula f.Formula) map[f.Variable]int
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormulaDepth ¶
FormulaDepth returns the depth of the given formula. The depth of an atomic formula is defined as 0, all other operators increase the depth by 1.
func LiteralProfile ¶
LiteralProfile returns the number of occurrences of each literal in the given formula.
func NumberOfAtoms ¶
NumberOfAtoms returns the number of atomic formulas of the given formula. An atomic formula is a constant or a literal.
func NumberOfNodes ¶
NumberOfNodes returns the number of nodes (in the DAG) of the given formula.
Types ¶
This section is empty.