Interface TermSequenceCompound
- All Superinterfaces:
TermCompound
- All Known Subinterfaces:
Atom, ComputedAtom, EvaluableFunction, LogicalFunctionalTerm, SpecializableLogicalFunctionalTerm
- All Known Implementing Classes:
AbstractLogicalFunctionalTermImpl, AtomImpl, ComputedAtomImpl, EvaluableFunctionImpl, GroundFunctionalTermImpl, SpecializableLogicalFunctionalTermImpl
A compound term whose direct components are stored as an ordered sequence.
-
Method Summary
Modifier and TypeMethodDescriptiondefault TermgetTerm(int index) Returns the term at the given position in the sequence.getTerms()Streams the first-level terms contained in this object.Returns the direct term sequence of this compound.default Optional<Substitution> homomorphism(TermSequenceCompound target) Allows computing the homomorphism from this TermSequenceCompound to a target one if it existshomomorphism(TermSequenceCompound target, Substitution toExtend) Allows computing the homomorphism from this TermSequenceCompound to a target one if it existsstatic 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 existsstatic 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 existsMethods inherited from interface TermCompound
getAllNestedTerms, getConstants, getLiterals, getNestedTerms, getVariables
-
Method Details
-
homomorphism
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 maptarget- 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 maptarget- the sequence on which we want to maptoExtend- a substitution that the homomorphism must extend- Returns:
- an optional containing a substitution representing the homomorphism if it exists, otherwise empty
-
getTermSequence
-
getTerms
Description copied from interface:TermCompoundStreams the first-level terms contained in this object.- Specified by:
getTermsin interfaceTermCompound- 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
-
homomorphism
Allows computing the homomorphism from this TermSequenceCompound to a target one if it exists- Parameters:
target- the TermSequenceCompound on which we want to maptoExtend- a substitution that the homomorphism must extend- Returns:
- an optional containing a substitution representing the homomorphism if it exists, otherwise empty
-
homomorphism
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
-