Interface FOFormulaDisjunction

All Superinterfaces:
FOFormula, fr.inria.rules.dlgpemodel.api.formulas.IDisjunction, fr.inria.rules.dlgpemodel.api.formulas.IFormula, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, Substitutable<FOFormula>, TermCompound
All Known Implementing Classes:
FODisjunctionImpl

public non-sealed interface FOFormulaDisjunction extends FOFormula, fr.inria.rules.dlgpemodel.api.formulas.IDisjunction
Representation of disjunctions of sub formulas
Author:
Florent Tornil, Guillaume Perution-Kihli
  • Method Details

    • isDisjunction

      default boolean isDisjunction()
      Description copied from interface: FOFormula
      Indicates whether this formula node is a disjunction.
      Specified by:
      isDisjunction in interface FOFormula
      Returns:
      true iff this node of the formula is a disjunction
    • getSubElements

      Collection<? extends FOFormula> getSubElements()
      Specified by:
      getSubElements in interface fr.inria.rules.dlgpemodel.api.formulas.IDisjunction
      Returns:
      the sub formulas
    • applySubstitution

      default FOFormulaDisjunction applySubstitution(Substitution substitution)
      Description copied from interface: FOFormula
      Applies a substitution without evaluating nested functions.
      Specified by:
      applySubstitution in interface FOFormula
      Specified by:
      applySubstitution in interface Substitutable<FOFormula>
      Parameters:
      substitution - the substitution to apply
      Returns:
      the substituted formula
    • applySubstitution

      FOFormulaDisjunction applySubstitution(Substitution substitution, boolean evaluate)
      Description copied from interface: FOFormula
      Applies a substitution to this formula.
      Specified by:
      applySubstitution in interface FOFormula
      Specified by:
      applySubstitution in interface Substitutable<FOFormula>
      Parameters:
      substitution - the substitution to apply
      evaluate - whether evaluable functions should be evaluated
      Returns:
      the substituted formula
    • flattenedSubFormulas

      default Stream<FOFormula> flattenedSubFormulas()
      Recursively flattens this disjunction by expanding any nested disjunctions and returning a Stream that contains only sub‑formulas which are not disjunctions themselves.

      Conceptually, the transformation performed is:

        (A v (B v C) v D)  ⟼  (A v B v C v D)
      
      The method is implemented lazily—no intermediate collections are created and elements are produced on demand.
      Returns:
      a sequential stream of the atomic sub‑formulas of this disjunction, with all nested disjunction layers removed Note: The traversal is depth‑first and preserves the left‑to‑right order of the original formula.