Symbolic ExpressionsΒΆ

Each program variable is assigned a symbolic expression that denotes the current value of the program variable as a function of any number of symbolic input variables. Grackle provides builtin functions for creating fresh symbolic variables, and users can build up expressions by using operations supported by Grackle. For example, consider the following code:

x = symbolic('u', 'integer');
y = symbolic('v', 'integer');
z = x + y;
z = z + y;

This code first generates fresh integer variables u and v and assigns them to program variables x and y respectively. It then generates the expression u + v and assigns that to the program variable z. Finally, it uses the generates the expression (u + v) + v by using the current expressions assigned to z and y, and then assigns that expression to z.

Grackle supports a variety of mathematical values including logical predicates, integers, real numbers, and fixed-precision integers. Input variables for these types can be created using the symbolic function. To create more complex functions, Grackle supports a variety of functions in Matlab have been implemented in Grackle and extended them to support symbolic expressions. For complete documentation about what functions have been implemented in Grackle, see API Reference for the MATLAB API and API Reference for the LLVM API.