Class IfNodeFunction


  • public class IfNodeFunction
    extends MonotonicityConceptFunction
    A representation of the monotonic function used to infer the monotonicity of conditional nodes (if nodes) in the abstract syntax trees of Ptolemy expressions.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Ben Lickly
    Pt.AcceptedRating:
    Red (blickly)
    Pt.ProposedRating:
    Red (blickly)
    • Constructor Detail

      • IfNodeFunction

        public IfNodeFunction​(ASTPtFunctionalIfNode ifNode,
                              Ontology monotonicityOntology,
                              java.util.List<Ontology> domainOntologies)
                       throws IllegalActionException
        Create a new function from the given ifNode and over the given monotonicity ontology.
        Parameters:
        ifNode - The AST node being constrained by this function.
        monotonicityOntology - The monotonicity ontology.
        domainOntologies - The ontologies over which the expression should be interpreted.
        Throws:
        IllegalActionException - If a function cannot be created.
    • Method Detail

      • _evaluateFunction

        protected Concept _evaluateFunction​(java.util.List<Concept> inputConceptValues)
                                     throws IllegalActionException
        Return the monotonicity concept that results from analyzing the conditional statement. Note that the analysis is sound but conservative, so it is possible for a monotonic function to be reported as nonmonotonic, but not the other way around.
        Specified by:
        _evaluateFunction in class ConceptFunction
        Parameters:
        inputConceptValues - The list of concept inputs to the function. (i.e. The monotonicity of each of the conditional's branches)
        Returns:
        The monotonicity of this if node.
        Throws:
        IllegalActionException - If there is an error evaluating the function.
        See Also:
        ConceptFunction._evaluateFunction(java.util.List)
      • _finiteEvaluateFunction

        protected Concept _finiteEvaluateFunction​(java.lang.String variable,
                                                  java.util.List<Concept> inputConceptValues)
                                           throws IllegalActionException
        Return the monotonicity concept that results from analyzing the conditional statement with respect to a single variable. Note that the analysis is sound but conservative, so it is possible for a monotonic function to be reported as nonmonotonic, but not the other way around.
        Parameters:
        variable - The variable over which to do the analysis.
        inputConceptValues - The list of concept inputs to the function. (i.e. The monotonicity of each of the conditional's branches)
        Returns:
        Either Constant, Monotonic, Antimonotonic, or Nonmonotonic, depending on the result of the analysis.
        Throws:
        IllegalActionException - If there is an error evaluating the function.