Class IfNodeFunction
- java.lang.Object
-
- ptolemy.data.ontologies.ConceptFunction
-
- ptolemy.data.ontologies.lattice.adapters.monotonicityAnalysis.MonotonicityConceptFunction
-
- ptolemy.data.ontologies.lattice.adapters.monotonicityAnalysis.data.expr.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)
-
-
Field Summary
-
Fields inherited from class ptolemy.data.ontologies.lattice.adapters.monotonicityAnalysis.MonotonicityConceptFunction
_antimonotonicConcept, _constantConcept, _domainOntologies, _generalConcept, _monotonicConcept, _monotonicityAnalysisOntology, _nonAntimonotonicRepresentative, _nonMonotonicRepresentative
-
Fields inherited from class ptolemy.data.ontologies.ConceptFunction
_argumentDomainOntologies, _name, _numArgsIsFixed, _outputRangeOntology
-
-
Constructor Summary
Constructors Constructor Description IfNodeFunction(ASTPtFunctionalIfNode ifNode, Ontology monotonicityOntology, java.util.List<Ontology> domainOntologies)
Create a new function from the given ifNode and over the given monotonicity ontology.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Concept
_evaluateFunction(java.util.List<Concept> inputConceptValues)
Return the monotonicity concept that results from analyzing the conditional statement.protected Concept
_finiteEvaluateFunction(java.lang.String variable, java.util.List<Concept> inputConceptValues)
Return the monotonicity concept that results from analyzing the conditional statement with respect to a single variable.-
Methods inherited from class ptolemy.data.ontologies.ConceptFunction
evaluateFunction, getArgumentDomainOntologies, getName, getNumberOfArguments, getOutputRangeOntology, isMonotonic, isNumberOfArgumentsFixed, toString
-
-
-
-
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 classConceptFunction
- 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.
-
-