Class FOConjunctionFactBaseWrapper

java.lang.Object
fr.inria.rules.integraal.model.formula.impl.FOConjunctionFactBaseWrapper
All Implemented Interfaces:
fr.inria.rules.dlgpemodel.api.formulas.IConjunction, fr.inria.rules.dlgpemodel.api.formulas.IFormula, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, FOFormula, FOFormulaConjunction, Substitutable<FOFormula>, TermCompound

public class FOConjunctionFactBaseWrapper extends Object implements FOFormulaConjunction
Class that allows to wrap a fact base into a FOConjunction
Author:
Guillaume Pérution-Kihli
  • Constructor Details

    • FOConjunctionFactBaseWrapper

      public FOConjunctionFactBaseWrapper(FactBase factBase)
      Creates an FOConjunction over the supplied fact base.
      Parameters:
      factBase - the fact base to wrap
  • Method Details

    • getSubElements

      public Collection<? extends FOFormula> getSubElements()
      Description copied from interface: FOFormulaConjunction
      Returns an unmodifiable collection containing the direct sub‑formulas of this conjunction, in their original order.
      Specified by:
      getSubElements in interface FOFormulaConjunction
      Specified by:
      getSubElements in interface fr.inria.rules.dlgpemodel.api.formulas.IConjunction
      Returns:
      the direct sub‑formulas of this conjunction
    • 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
    • applySubstitution

      public FOFormulaConjunction 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 FOFormulaConjunction
      Specified by:
      applySubstitution in interface Substitutable<FOFormula>
      Parameters:
      substitution - the substitution to apply
      evaluate - whether evaluable functions should be evaluated
      Returns:
      the substituted formula
    • copy

      Description copied from interface: FOFormula
      Creates a deep copy of this formula.
      Specified by:
      copy in interface FOFormula
      Returns:
      a detached copy of this formula