blog
Class BuiltInFunctions

java.lang.Object
  extended by blog.BuiltInFunctions

public class BuiltInFunctions
extends java.lang.Object

Class with static methods and constants for built-in non-random functions (including built-in constants). This class cannot be instantiated.


Field Summary
static NonRandomFunction CONCAT
          A function on strings x, y that returns the concatenation of x and y.
static NonRandomFunction EPOCH
          Constant that denotes the timestep 0.
static NonRandomFunction GEQ
          The GreaterThanOrEqual relation on type Real (and its subtypes).
static NonRandomFunction GT
          The GreaterThan relation on type Real (and its subtypes)
static NonRandomFunction IS_EMPTY_STRING
          A function that takes a string and returns true if the string is empty.
static NonRandomFunction LEQ
          The LessThanOrEqual relation on type Real (and its subtypes).
static NonRandomFunction LT
          The LessThan relation on type Real (and its subtypes).
static NonRandomFunction MINUS
          The function on integers x, y that returns x - y.
static NonRandomFunction NON_NEG_PART
          A function from integers to natural numbers that yields the non-negative part of the given integer x: that is, min(x, 0).
static NonRandomFunction NULL
          Constant that always denotes Model.NULL.
static NonRandomFunction ONE
          Constant that denotes the natural number 1.
static NonRandomFunction PLUS
          The function on integers x, y that returns x + y.
static NonRandomFunction PRED
          The predecessor function on natural numbers.
static NonRandomFunction PREV
          The predecessor function on timesteps.
static NonRandomFunction RMINUS
          The function on reals x, y that returns x - y.
static NonRandomFunction RPLUS
          The function on reals x, y that returns x + y.
static NonRandomFunction SUCC
          The successor function on natural numbers.
static NonRandomFunction VMINUS
          A function on RVectors x, y that returns the element-wise difference of x and y.
static NonRandomFunction VPLUS
          A function on RVectors x, y that returns the element-wise sum of x and y.
static NonRandomFunction ZERO
          Constant that denotes the natural number 0.
 
Method Summary
static java.util.List getFuncsWithName(java.lang.String name)
          Returns the built-in functions (and constants) with the given name.
static NonRandomFunction getFunction(Function.Sig sig)
          Returns the built-in function (or constant) with the given signature.
static NonRandomFunction getLiteral(java.lang.String name, Type type, java.lang.Object value)
          Returns the built-in constant symbol with the given name, which has the given return type and denotes the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL

public static final NonRandomFunction NULL
Constant that always denotes Model.NULL.


ZERO

public static final NonRandomFunction ZERO
Constant that denotes the natural number 0. The parser creates NonRandomConstant objects as needed to represent numeric constants that it actually encounters in a file, but some internal compilation code may need to use this constant even if it doesn't occur in a file.


ONE

public static final NonRandomFunction ONE
Constant that denotes the natural number 1. The parser creates NonRandomConstant objects as needed to represent numeric constants that it actually encounters in a file, but some internal compilation code may need to use this constant even if it doesn't occur in a file.


EPOCH

public static final NonRandomFunction EPOCH
Constant that denotes the timestep 0. The parser creates NonRandomConstant objects as needed to represent timestep constants that it actually encounters in a file, but some internal compilation code may need to use this constant even if it doesn't occur in a file.


LT

public static NonRandomFunction LT
The LessThan relation on type Real (and its subtypes).


LEQ

public static NonRandomFunction LEQ
The LessThanOrEqual relation on type Real (and its subtypes).


GT

public static NonRandomFunction GT
The GreaterThan relation on type Real (and its subtypes)


GEQ

public static NonRandomFunction GEQ
The GreaterThanOrEqual relation on type Real (and its subtypes).


SUCC

public static NonRandomFunction SUCC
The successor function on natural numbers. Given a number n, it returns n+1.


PRED

public static NonRandomFunction PRED
The predecessor function on natural numbers. Given a positive number n, it returns n-1. Given the number 0, it returns Model.NULL.


NON_NEG_PART

public static NonRandomFunction NON_NEG_PART
A function from integers to natural numbers that yields the non-negative part of the given integer x: that is, min(x, 0).


PLUS

public static NonRandomFunction PLUS
The function on integers x, y that returns x + y.


MINUS

public static NonRandomFunction MINUS
The function on integers x, y that returns x - y.


RPLUS

public static NonRandomFunction RPLUS
The function on reals x, y that returns x + y.


RMINUS

public static NonRandomFunction RMINUS
The function on reals x, y that returns x - y.


PREV

public static NonRandomFunction PREV
The predecessor function on timesteps. Given a positive timestep n, it returns n-1. Given the timestep 0, it returns Model.NULL.


CONCAT

public static NonRandomFunction CONCAT
A function on strings x, y that returns the concatenation of x and y.


VPLUS

public static NonRandomFunction VPLUS
A function on RVectors x, y that returns the element-wise sum of x and y.


VMINUS

public static NonRandomFunction VMINUS
A function on RVectors x, y that returns the element-wise difference of x and y.


IS_EMPTY_STRING

public static NonRandomFunction IS_EMPTY_STRING
A function that takes a string and returns true if the string is empty.

Method Detail

getFunction

public static NonRandomFunction getFunction(Function.Sig sig)
Returns the built-in function (or constant) with the given signature. Returns null if there is no such built-in function, or if the given name is a numeric, character, or string literal that is only created as needed by the parser.


getLiteral

public static NonRandomFunction getLiteral(java.lang.String name,
                                           Type type,
                                           java.lang.Object value)
Returns the built-in constant symbol with the given name, which has the given return type and denotes the given value. Creates the constant symbol automatically if it hasn't been created yet.


getFuncsWithName

public static java.util.List getFuncsWithName(java.lang.String name)
Returns the built-in functions (and constants) with the given name.

Returns:
unmodifiable List of Function