Class ComputedAtomImpl
java.lang.Object
fr.inria.rules.integraal.model.logicalElements.impl.ComputedAtomImpl
- All Implemented Interfaces:
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.formulas.IStandardAtom, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, FOFormula, Atom, ComputedAtom, Evaluable<Atom>, Substitutable<FOFormula>, TermCompound, TermSequenceCompound
Default implementation of a ComputedAtom
- Author:
- Florent Tornil
-
Field Summary
Fields inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable
WRITER -
Constructor Summary
ConstructorsConstructorDescriptionComputedAtomImpl(Invoker invoker, Predicate predicate, Term... terms) Constructor using an array of termsComputedAtomImpl(Invoker invoker, Predicate predicate, List<Term> terms) Constructor using a list of terms -
Method Summary
Modifier and TypeMethodDescriptionapplySubstitution(Substitution substitution, boolean evaluate) Applies a substitution to this atom.booleanTests whether a term occurs in this atom.copy()Creates a deep copy of this formula.booleaneval(Substitution s) //////////////////////////////////////////////Returns the invoker used to evaluate this computed atom.Get the variables that must be sent to something to evaluate the objectReturns the predicate associated with this atom.Returns the direct term sequence of this compound.inthashCode()int[]Returns every position at which a term occurs in this atom.intReturns the first position of a term in this atom.booleanisEvaluableWith(Substitution substitution) Check if we can evaluate the object with the given substitutiontoString()Methods inherited from interface Atom
applySubstitution, asAtomSet, getPredicates, homomorphism, isAtomicMethods inherited from interface ComputedAtom
isComputedAtomMethods inherited from interface FOFormula
asBooleanQuery, 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
exportsMethods inherited from interface TermCompound
getAllNestedTerms, getConstants, getLiterals, getNestedTerms, getVariablesMethods inherited from interface TermSequenceCompound
getTerm, getTerms, homomorphism
-
Constructor Details
-
ComputedAtomImpl
-
ComputedAtomImpl
-
-
Method Details
-
eval
//////////////////////////////////////////////- Specified by:
evalin interfaceComputedAtom- Specified by:
evalin interfaceEvaluable<Atom>- Parameters:
s- a full substitution of this atom variables.- Returns:
- an atom
-
getInvoker
Description copied from interface:ComputedAtomReturns the invoker used to evaluate this computed atom.- Specified by:
getInvokerin interfaceComputedAtom- Returns:
- the underlying invoker
-
getPredicate
Description copied from interface:AtomReturns the predicate associated with this atom.- Specified by:
getPredicatein interfaceAtom- Specified by:
getPredicatein interfacefr.inria.rules.dlgpemodel.api.formulas.IPredicated- Returns:
- the
Predicateassociated to this atom.
-
contains
-
indexOf
Description copied from interface:AtomReturns the first position of a term in this atom. -
indexesOf
Description copied from interface:AtomReturns every position at which a term occurs in this atom. -
applySubstitution
Description copied from interface:AtomApplies a substitution to this atom.- Specified by:
applySubstitutionin interfaceAtom- 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
-
copy
Description copied from interface:FOFormulaCreates a deep copy of this formula. -
getMandatoryParameters
Description copied from interface:EvaluableGet the variables that must be sent to something to evaluate the object- Specified by:
getMandatoryParametersin interfaceEvaluable<Atom>- Returns:
- a set of variables containing the variables that must be substituted
-
isEvaluableWith
Description copied from interface:EvaluableCheck if we can evaluate the object with the given substitution- Specified by:
isEvaluableWithin interfaceEvaluable<Atom>- Parameters:
substitution- the substitution that associates the values to the parameters of the evaluation- Returns:
- true iff we can evaluate this object with the given substitution
-
getTermSequence
Description copied from interface:TermSequenceCompoundReturns the direct term sequence of this compound.- Specified by:
getTermSequencein interfacefr.inria.rules.dlgpemodel.api.formulas.IStandardAtom- Specified by:
getTermSequencein interfaceTermSequenceCompound- 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.
-
hashCode
-
equals
-
toString
-