Module logicng

Class FormulaDepthFunction

  • All Implemented Interfaces:
    FormulaFunction<Integer>

    public final class FormulaDepthFunction
    extends Object
    implements FormulaFunction<Integer>
    A function that computes the depth of a formula. The depth of an atomic formula is defined as 0, all other operators increase the depth by 1.
    Since:
    2.0
    Version:
    2.3.0
    • Constructor Detail

      • FormulaDepthFunction

        @Deprecated
        public FormulaDepthFunction()
        Deprecated.
        In the next version, the standard constructor will be replaced by a private constructor. In order to instantiate an object of this class, use the get() method.
    • Method Detail

      • get

        public static FormulaDepthFunction get()
        Returns the singleton instance of this function.
        Returns:
        an instance of this function
      • apply

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