Class CompoundFOFormula

java.lang.Object
fr.inria.rules.integraal.model.formula.api.CompoundFOFormula
All Implemented Interfaces:
fr.inria.rules.dlgpemodel.api.formulas.IFormula, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, FOFormula, Substitutable<FOFormula>, TermCompound
Direct Known Subclasses:
FOConjunctionImpl, FODisjunctionImpl

public abstract non-sealed class CompoundFOFormula extends Object implements FOFormula
Abstract implementation for compound formula
Author:
Florent Tornil
  • Constructor Details

    • CompoundFOFormula

      public CompoundFOFormula(Collection<? extends FOFormula> subformulas)
      Constructor using sub formulas
      Parameters:
      subformulas - the sub formulas
  • Method Details

    • getConnectorRepresentation

      public abstract String getConnectorRepresentation()
      Returns the textual representation of the connector used between sub-formulas.
      Returns:
      the string representation of the connector
    • getSubElements

      public Collection<? extends FOFormula> getSubElements()
      Returns the direct sub-formulas of this compound formula.
      Returns:
      the sub formulas
    • asAtomSet

      public Set<Atom> asAtomSet()
      Description copied from interface: FOFormula
      The given set does not represent any meaning on the formula as conjunctions, disjunctions and negations will be merged together.
      This should only be used to prepare some indexes
      Specified by:
      asAtomSet in interface FOFormula
      Returns:
      the set of all the atoms of this formula
    • getPredicates

      public Stream<Predicate> getPredicates()
      Description copied from interface: FOFormula
      Streams the predicates used by this formula.
      Specified by:
      getPredicates in interface FOFormula
      Returns:
      the set of all the predicates of the atoms of this formula
    • getTerms

      public Stream<Term> getTerms()
      Description copied from interface: TermCompound
      Streams the first-level terms contained in this object.
      Specified by:
      getTerms in interface TermCompound
      Returns:
      a stream over all the non-nested terms (i.e., all terms that are not themselves in a compound term) For instance, for p(a,g(b)), it returns a and g(b) but not b.
    • toString

      public String toString()
      //////////////////////////////////////////////
      Overrides:
      toString in class Object