Interface TermCompound

All Known Subinterfaces:
Atom, ComputedAtom, CSVCopyable, DatalogDelegable, EvaluableFunction, FactBase, FOFormula, FOFormulaConjunction, FOFormulaDisjunction, FOFormulaNegation, LogicalFunctionalTerm, MaterializedData, MaterializedDataCollection<T>, MaterializedWritableDataCollection<Q,W>, SpecializableLogicalFunctionalTerm, TermSequenceCompound
All Known Implementing Classes:
AbstractLogicalFunctionalTermImpl, AtomImpl, CompoundFOFormula, ComputedAtomImpl, DefaultInMemoryAtomSet, EvaluableFunctionImpl, FactBaseDelAtomsWrapper, FederatedFactBase, FOConjunctionFactBaseWrapper, FOConjunctionImpl, FODisjunctionImpl, FONegationImpl, GroundFunctionalTermImpl, LightInMemoryGraphStore, RDBMSStore, SimpleInMemoryGraphStore, SpecializableLogicalFunctionalTermImpl, TripleStoreStore

public interface TermCompound
Represents an object composed of a terms' sequence This is useful for defining the common behavior of objects that contain a sequence of terms (like atom or functional terms)
Author:
Guillaume Pérution-Kihli
  • Method Details

    • getTerms

      Stream<Term> getTerms()
      Streams the first-level terms contained in this object.
      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.
    • getVariables

      default Stream<Variable> getVariables()
      Recursively list all variables
      Returns:
      the set of variables included in this term
    • getLiterals

      default Stream<Literal<?>> getLiterals()
      Recursively list all literals
      Returns:
      the set of literals included in this term
    • getConstants

      default Stream<Constant> getConstants()
      Recursively list all constants
      Returns:
      the set of constants included in this term
    • getAllNestedTerms

      default Stream<Term> getAllNestedTerms()
      Streams all nested terms contained in this object.
      Returns:
      the set of all nested terms. For instance, for f(a,g(b)), it returns a, g(b), and b.
    • getNestedTerms

      default <T extends Term> Stream<T> getNestedTerms(Class<T> classType)
      Returns all nested terms filtered by the supplied type. Recursively enumerate all terms
      Type Parameters:
      T - the nested term subtype to extract
      Parameters:
      classType - class type filters the terms by type
      Returns:
      the set of variables included in this term