Interface EvaluableFunction

All Superinterfaces:
Evaluable<Term>, fr.inria.rules.dlgpemodel.api.elems.IFunctionalTerm, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, fr.inria.rules.dlgpemodel.api.elems.ITerm, Standardizable, Substitutable<Term>, Term, TermCompound, TermSequenceCompound
All Known Implementing Classes:
EvaluableFunctionImpl

public interface EvaluableFunction extends Term, Evaluable<Term>, TermSequenceCompound, fr.inria.rules.dlgpemodel.api.elems.IFunctionalTerm
An evaluable function is a Term that can be evaluated into another (non-functional) term
Author:
Florent Tornil
  • Method Details

    • getFunctionName

      String getFunctionName()
      Returns the function name used by this evaluable term.
      Specified by:
      getFunctionName in interface fr.inria.rules.dlgpemodel.api.elems.IFunctionalTerm
      Returns:
      a string representing the function name
    • eval

      Term eval(Substitution s)
      (1) applies the substitution to the term (2) evaluate the function associated with the term

      Precondition : a functional term is evaluable IFF all of its arguments -- after applying the substitution -- are literals

      Specified by:
      eval in interface Evaluable<Term>
      Parameters:
      s - a substitution
      Returns:
      the resulting term of the evaluation
    • isEvaluableWith

      default boolean isEvaluableWith(Substitution s)
      Description copied from interface: Evaluable
      Check if we can evaluate the object with the given substitution
      Specified by:
      isEvaluableWith in interface Evaluable<Term>
      Parameters:
      s - substitution
      Returns:
      true IFF the term after applying the substitution contains only literals
    • evaluateNestedFunctions

      EvaluableFunction evaluateNestedFunctions(Substitution s)
      Evaluates nested functions that become ground after substitution.
      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
    • setFunctionParameters

      EvaluableFunction setFunctionParameters(Substitution s)
      Applies a substitution to this function arguments without evaluating this function.
      Parameters:
      s - substitution
      Returns:
      a new function where some variables have been replaced by other terms, as defined by the substitution s
    • asLogicalFunctionalTerm

      default LogicalFunctionalTerm asLogicalFunctionalTerm()
      Converts this evaluable function into its logical functional-term counterpart.
      Returns:
      the evaluable function represented as a logical functional term
    • homomorphism

      default Optional<Substitution> homomorphism(TermSequenceCompound target, Substitution toExtend)
      Description copied from interface: TermSequenceCompound
      Allows computing the homomorphism from this TermSequenceCompound to a target one if it exists
      Specified by:
      homomorphism in interface TermSequenceCompound
      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
    • isGround

      default boolean isGround()
      Description copied from interface: Term
      Indicates whether this term contains no variables.
      Specified by:
      isGround in interface Term
      Returns:
      true iff this object and its nested terms do not contain any variable
    • toStandardForm

      default String toStandardForm(Boolean shortForm)
      Description copied from interface: Standardizable
      Returns the standardized textual form.
      Specified by:
      toStandardForm in interface Standardizable
      Parameters:
      shortForm - indicates whether the generated form should take into account the prefix system
      Returns:
      the standardized form
    • getInvoker

      Invoker getInvoker()
      Returns the invoker used to evaluate this function.
      Returns:
      the invoker backing this evaluable function