Interface TermSequenceCompound

All Superinterfaces:
TermCompound
All Known Subinterfaces:
Atom, ComputedAtom, EvaluableFunction, LogicalFunctionalTerm, SpecializableLogicalFunctionalTerm
All Known Implementing Classes:
AbstractLogicalFunctionalTermImpl, AtomImpl, ComputedAtomImpl, EvaluableFunctionImpl, GroundFunctionalTermImpl, SpecializableLogicalFunctionalTermImpl

public interface TermSequenceCompound extends TermCompound
A compound term whose direct components are stored as an ordered sequence.
  • Method Details

    • homomorphism

      static Optional<Substitution> homomorphism(List<Term> source, List<Term> target)
      Allows computing the homomorphism from a source sequence of terms to a target one if it exists
      Parameters:
      source - the sequence from which we want to map
      target - the sequence on which we want to map
      Returns:
      an optional containing a substitution representing the homomorphism if it exists, otherwise empty
    • homomorphism

      static Optional<Substitution> homomorphism(List<Term> source, List<Term> target, Substitution toExtend)
      Allows computing the homomorphism from a source sequence of terms to a target one if it exists
      Parameters:
      source - the sequence from which we want to map
      target - the sequence on which we want to map
      toExtend - a substitution that the homomorphism must extend
      Returns:
      an optional containing a substitution representing the homomorphism if it exists, otherwise empty
    • getTermSequence

      List<Term> getTermSequence()
      Returns the direct term sequence of this compound.
      Returns:
      the sequence of first level 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.
    • getTerms

      default 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.
    • getTerm

      default Term getTerm(int index)
      Returns the term at the given position in the sequence.
      Parameters:
      index - the position of the term in the sequence
      Returns:
      the Term at the index position in the sequence.
    • homomorphism

      Optional<Substitution> homomorphism(TermSequenceCompound target, Substitution toExtend)
      Allows computing the homomorphism from this TermSequenceCompound to a target one if it exists
      Parameters:
      target - the TermSequenceCompound on which we want to map
      toExtend - a substitution that the homomorphism must extend
      Returns:
      an optional containing a substitution representing the homomorphism if it exists, otherwise empty
    • homomorphism

      default Optional<Substitution> homomorphism(TermSequenceCompound target)
      Allows computing the homomorphism from this TermSequenceCompound to a target one if it exists
      Parameters:
      target - the TermSequenceCompound on which we want to map
      Returns:
      an optional containing a substitution representing the homomorphism if it exists, otherwise empty