Module logicng

Class NumberOfNodesFunction

  • All Implemented Interfaces:
    FormulaFunction<Long>

    public class NumberOfNodesFunction
    extends Object
    implements FormulaFunction<Long>
    A function that computes the number of nodes of a given formula.
    Since:
    2.2.0
    Version:
    2.2.0
    • Method Detail

      • get

        public static NumberOfNodesFunction get()
        Returns the singleton of the function.
        Returns:
        the function instance
      • apply

        public Long apply​(Formula formula,
                          boolean cache)
        Description copied from interface: FormulaFunction
        Applies this function to a given formula.
        Specified by:
        apply in interface FormulaFunction<Long>
        Parameters:
        formula - the input formula
        cache - indicates whether the result should be cached in this formula's cache
        Returns:
        the result of the application