Interface Atom
- All Superinterfaces:
FOFormula, fr.inria.rules.dlgpemodel.api.formulas.IAtom, fr.inria.rules.dlgpemodel.api.formulas.IFormula, fr.inria.rules.dlgpemodel.api.formulas.IPredicated, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, fr.inria.rules.dlgpemodel.api.formulas.IStandardAtom, Substitutable<FOFormula>, TermCompound, TermSequenceCompound
- All Known Subinterfaces:
ComputedAtom
- All Known Implementing Classes:
AtomImpl, ComputedAtomImpl
public non-sealed interface Atom
extends FOFormula, TermSequenceCompound, fr.inria.rules.dlgpemodel.api.formulas.IStandardAtom
-
Field Summary
Fields inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable
WRITER -
Method Summary
Modifier and TypeMethodDescriptiondefault AtomapplySubstitution(Substitution substitution) Applies a substitution without evaluating nested functions.applySubstitution(Substitution substitution, boolean evaluate) Applies a substitution to this atom.The given set does not represent any meaning on the formula as conjunctions, disjunctions and negations will be merged together.booleanTests whether a term occurs in this atom.Returns the predicate associated with this atom.Streams the predicates used by this formula.default Optional<Substitution> homomorphism(TermSequenceCompound target, Substitution toExtend) Allows computing the homomorphism from this atom to a target one if it existsint[]Returns every position at which a term occurs in this atom.intReturns the first position of a term in this atom.default booleanisAtomic()Indicates whether this formula node is atomic.default booleanIndicates whether this atom is a computed atom.Methods inherited from interface FOFormula
asBooleanQuery, copy, isConjunction, isDisjunction, isNegationMethods inherited from interface fr.inria.rules.dlgpemodel.api.formulas.IPredicated
isPatternedMethods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable
toDLGPEMethods inherited from interface fr.inria.rules.dlgpemodel.api.formulas.IStandardAtom
exports, getTermSequenceMethods inherited from interface TermCompound
getAllNestedTerms, getConstants, getLiterals, getNestedTerms, getVariablesMethods inherited from interface TermSequenceCompound
getTerm, getTerms, getTermSequence, homomorphism
-
Method Details
-
getPredicate
-
contains
-
indexOf
-
indexesOf
-
isAtomic
-
asAtomSet
Description copied from interface:FOFormulaThe 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 -
getPredicates
Description copied from interface:FOFormulaStreams the predicates used by this formula.- Specified by:
getPredicatesin interfaceFOFormula- Returns:
- the set of all the predicates of the atoms of this formula
-
isComputedAtom
default boolean isComputedAtom()Indicates whether this atom is a computed atom.- Returns:
truewhen this atom is computed rather than materialized
-
applySubstitution
Applies a substitution without evaluating nested functions.- Specified by:
applySubstitutionin interfaceFOFormula- Specified by:
applySubstitutionin interfaceSubstitutable<FOFormula>- Parameters:
substitution- the substitution to apply- Returns:
- the substituted atom
-
applySubstitution
Applies a substitution to this atom.- Specified by:
applySubstitutionin interfaceFOFormula- Specified by:
applySubstitutionin interfaceSubstitutable<FOFormula>- Parameters:
substitution- the substitution to applyevaluate- whether evaluable functions should be evaluated- Returns:
- the substituted atom
-
homomorphism
Allows computing the homomorphism from this atom to a target one if it exists- Specified by:
homomorphismin interfaceTermSequenceCompound- Parameters:
target- the atom 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
-