Class FOFormulaFactory

java.lang.Object
fr.inria.rules.integraal.model.formula.factory.FOFormulaFactory

public class FOFormulaFactory extends Object
Factory for formulas
Author:
Florent Tornil
  • Constructor Details

    • FOFormulaFactory

      public FOFormulaFactory()
      Creates a formula factory instance.
  • Method Details

    • instance

      public static FOFormulaFactory instance()
      Returns the shared formula factory instance.
      Returns:
      the default instance of this factory
    • createOrGetNegation

      public final FOFormulaNegation createOrGetNegation(FOFormula sub_formula)
      Creates a negation wrapping the supplied formula.
      Parameters:
      sub_formula - the sub formulas
      Returns:
      the negation of the given formula
    • createOrGetConjunction

      public final FOFormulaConjunction createOrGetConjunction(Collection<? extends FOFormula> sub_formulas)
      Creates a conjunction from the supplied collection of formulas.
      Parameters:
      sub_formulas - the sub formulas
      Returns:
      a conjunction of the given formulas
    • createOrGetConjunction

      public final FOFormulaConjunction createOrGetConjunction(FOFormula... sub_formulas)
      Creates a conjunction from the supplied formulas.
      Parameters:
      sub_formulas - the sub formulas
      Returns:
      a conjunction of the given formulas
    • createOrGetConjunction

      public final FOFormulaConjunction createOrGetConjunction(FactBase fact_base)
      Wraps a fact base as a conjunction formula.
      Parameters:
      fact_base - the fact base to convert
      Returns:
      the conjunction of all the atoms in the fact base
    • createOrGetDisjunction

      public final FOFormulaDisjunction createOrGetDisjunction(Collection<? extends FOFormula> sub_formulas)
      Creates a disjunction from the supplied collection of formulas.
      Parameters:
      sub_formulas - the sub formulas
      Returns:
      a disjunction of the given formulas
    • createOrGetDisjunction

      public final FOFormulaDisjunction createOrGetDisjunction(FOFormula... sub_formulas)
      Creates a disjunction from the supplied formulas.
      Parameters:
      sub_formulas - the sub formulas
      Returns:
      a disjunction of the given formulas
    • copy

      public FOFormula copy(FOFormula formula)
      Creates a deep copy of the supplied formula.
      Parameters:
      formula - the formula to copy
      Returns:
      a deep copy of the given formula
    • copyConjunction

      public FOFormulaConjunction copyConjunction(FOFormulaConjunction formula)
      Creates a deep copy of a conjunction formula.
      Parameters:
      formula - the formula to copy
      Returns:
      a deep copy of the given conjunction
    • copyDisjunction

      public FOFormulaDisjunction copyDisjunction(FOFormulaDisjunction formula)
      Creates a deep copy of a disjunction formula.
      Parameters:
      formula - the formula to copy
      Returns:
      a deep copy of the given disjunction
    • copyNegation

      public FOFormulaNegation copyNegation(FOFormulaNegation formula)
      Creates a deep copy of a negation formula.
      Parameters:
      formula - the formula to copy
      Returns:
      a deep copy of the given negation
    • copyAtom

      public Atom copyAtom(Atom atom)
      Creates a deep copy of an atom.
      Parameters:
      atom - the atom to copy
      Returns:
      a deep copy of the given atom