Module logicng

Class BDDFactory


  • public final class BDDFactory
    extends Object
    The factory for the jBuddy implementation.
    Since:
    1.4.0
    Version:
    2.0.0
    • Method Detail

      • build

        public static BDD build​(Formula formula)
        Builds a BDD for a given formula. BDDs support all Boolean formula types but not pseudo-Boolean constraints. The reason is that before converting a formula to a BDD one must specify the number of variables. In case of pseudo-Boolean constraints this number depends on the translation of the constraint. Therefore, the caller first has to transform any pseudo-Boolean constraints in their respective CNF representation before converting them to a BDD.
        Parameters:
        formula - the formula
        Returns:
        the top node of the BDD
      • build

        public static BDD build​(Formula formula,
                                BDDKernel kernel)
        Builds a BDD for a given formula. BDDs support all Boolean formula types but not pseudo-Boolean constraints. The reason is that before converting a formula to a BDD one must specify the number of variables. In case of pseudo-Boolean constraints this number depends on the translation of the constraint. Therefore, the caller first has to transform any pseudo-Boolean constraints in their respective CNF representation before converting them to a BDD.
        Parameters:
        formula - the formula
        kernel - the BBD kernel to use
        Returns:
        the top node of the BDD or BDDKernel.BDD_ABORT if the computation was aborted
      • build

        public static BDD build​(Formula formula,
                                BDDKernel kernel,
                                BDDHandler handler)
        Builds a BDD for a given formula. BDDs support all Boolean formula types but not pseudo-Boolean constraints. The reason is that before converting a formula to a BDD one must specify the number of variables. In case of pseudo-Boolean constraints this number depends on the translation of the constraint. Therefore, the caller first has to transform any pseudo-Boolean constraints in their respective CNF representation before converting them to a BDD.

        If a BDD handler is given and the BDD generation is aborted due to the handler, the method will return BDDKernel.BDD_ABORT as result. If null is passed as handler, the generation will continue without interruption.

        Parameters:
        formula - the formula
        kernel - the BBD kernel to use
        handler - the BDD handler
        Returns:
        the top node of the BDD or BDDKernel.BDD_ABORT if the computation was aborted