Record Class EvaluableFunctionImpl
java.lang.Object
java.lang.Record
fr.inria.rules.integraal.model.logicalElements.impl.functionalTerms.EvaluableFunctionImpl
- Record Components:
function_name- the name of the represented functioninvoker- the invoker used to evaluate the functionsub_terms- the function arguments
- All Implemented Interfaces:
fr.inria.rules.dlgpemodel.api.elems.IFunctionalTerm, fr.inria.rules.dlgpemodel.api.elems.ITerm, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, Standardizable, Evaluable<Term>, EvaluableFunction, Substitutable<Term>, Term, TermCompound, TermSequenceCompound
-
Field Summary
Fields inherited from interface fr.inria.rules.dlgpemodel.api.elems.IFunctionalTerm
EXPONENTIAL, INTEGRAAL_INVOKER_IRI, INTEGRAAL_INVOKER_PREFIX, INVERSE, OPPOSITE, PRODUCT, SUMFields inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable
WRITER -
Constructor Summary
ConstructorsConstructorDescriptionEvaluableFunctionImpl(String function_name, Invoker invoker, List<Term> sub_terms) Creates an evaluable function and validates its required components. -
Method Summary
Modifier and TypeMethodDescriptionapplySubstitution(Substitution substitution, boolean evaluate) Applies a substitution to this term.booleanIndicates whether some other object is "equal to" this one.eval(Substitution s) (1) applies the substitution to the term (2) evaluate the function associated with the termEvaluates nested functions that become ground after substitution.Returns the value of thefunction_namerecord component.Returns the function name used by this evaluable term.Returns the invoker used to evaluate this function.Get the variables that must be sent to something to evaluate the objectReturns the direct term sequence of this compound.inthashCode()//////////////////////////////////////////////invoker()Returns the value of theinvokerrecord component.booleanIndicates whether this term denotes an evaluable function.label()Returns the textual representation of this term.Applies a substitution to this function arguments without evaluating this function.Returns the value of thesub_termsrecord component.toString()Returns a string representation of this record class.Methods inherited from interface EvaluableFunction
asLogicalFunctionalTerm, homomorphism, isEvaluableWith, isGround, toStandardFormMethods inherited from interface fr.inria.rules.dlgpemodel.api.sentences.IPrintable
toDLGPEMethods inherited from interface Standardizable
toStandardFormMethods inherited from interface Term
applySubstitution, isConstant, isFrozen, isFunctionalTerm, isLiteral, isVariableMethods inherited from interface TermCompound
getAllNestedTerms, getConstants, getLiterals, getNestedTerms, getVariablesMethods inherited from interface TermSequenceCompound
getTerm, getTerms, homomorphism
-
Constructor Details
-
EvaluableFunctionImpl
-
-
Method Details
-
setFunctionParameters
Description copied from interface:EvaluableFunctionApplies a substitution to this function arguments without evaluating this function.- Specified by:
setFunctionParametersin interfaceEvaluableFunction- Parameters:
s- substitution- Returns:
- a new function where some variables have been replaced by other terms, as defined by the substitution s
-
getInvoker
Description copied from interface:EvaluableFunctionReturns the invoker used to evaluate this function.- Specified by:
getInvokerin interfaceEvaluableFunction- Returns:
- the invoker backing this evaluable function
-
getFunctionName
Description copied from interface:EvaluableFunctionReturns the function name used by this evaluable term.- Specified by:
getFunctionNamein interfaceEvaluableFunction- Specified by:
getFunctionNamein interfacefr.inria.rules.dlgpemodel.api.elems.IFunctionalTerm- Returns:
- a string representing the function name
-
getTermSequence
Description copied from interface:TermSequenceCompoundReturns the direct term sequence of this compound.- Specified by:
getTermSequencein interfacefr.inria.rules.dlgpemodel.api.elems.IFunctionalTerm- 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.
-
eval
Description copied from interface:EvaluableFunction(1) applies the substitution to the term (2) evaluate the function associated with the termPrecondition : a functional term is evaluable IFF all of its arguments -- after applying the substitution -- are literals
- Specified by:
evalin interfaceEvaluable<Term>- Specified by:
evalin interfaceEvaluableFunction- Parameters:
s- a substitution- Returns:
- the resulting term of the evaluation
-
getMandatoryParameters
Description copied from interface:EvaluableGet the variables that must be sent to something to evaluate the object- Specified by:
getMandatoryParametersin interfaceEvaluable<Term>- Returns:
- a set of variables containing the variables that must be substituted
-
evaluateNestedFunctions
Description copied from interface:EvaluableFunctionEvaluates nested functions that become ground after substitution.- Specified by:
evaluateNestedFunctionsin interfaceEvaluableFunction- Parameters:
s- substitution- Returns:
- a new evaluable function where some variables have been replaced by other terms, as defined by the substitution, and where all evaluable nested functions that are already evaluable have been evaluated
-
isEvaluableFunction
public boolean isEvaluableFunction()Description copied from interface:TermIndicates whether this term denotes an evaluable function.- Specified by:
isEvaluableFunctionin interfaceTerm- Returns:
truewhen this term is an evaluable function
-
hashCode
-
label
-
toString
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
applySubstitution
Description copied from interface:TermApplies a substitution to this term.- Specified by:
applySubstitutionin interfaceSubstitutable<Term>- Specified by:
applySubstitutionin interfaceTerm- Parameters:
substitution- the substitution to applyevaluate- whether nested evaluable functions should be evaluated- Returns:
- the substituted term
-
function_name
Returns the value of thefunction_namerecord component.- Returns:
- the value of the
function_namerecord component
-
invoker
-
sub_terms
-