function

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 2 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormulaDepth

func FormulaDepth(fac f.Factory, formula f.Formula) int

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

func LiteralProfile(fac f.Factory, formula f.Formula) map[f.Literal]int

LiteralProfile returns the number of occurrences of each literal in the given formula.

func NumberOfAtoms

func NumberOfAtoms(fac f.Factory, formula f.Formula) int

NumberOfAtoms returns the number of atomic formulas of the given formula. An atomic formula is a constant or a literal.

func NumberOfNodes

func NumberOfNodes(fac f.Factory, formula f.Formula) int

NumberOfNodes returns the number of nodes (in the DAG) of the given formula.

func SubNodes

func SubNodes(fac f.Factory, formula f.Formula) []f.Formula

SubNodes returns all sub-nodes of the given formula. The order of the sub-nodes is bottom-up, i.e. a sub-node only appears in the result when all of its sub-nodes are already listed.

func VariableProfile

func VariableProfile(fac f.Factory, formula f.Formula) map[f.Variable]int

VariableProfile returns the number of occurrences of each variable in the given formula.

Types

This section is empty.

Jump to

Keyboard shortcuts

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