Commit 2c10d033 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Preprocessor: rename "NodeID" in "expr_t"

parent c8fdd5d9
......@@ -647,7 +647,7 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const
{
const string &name = it->first;
const string &weight = it->second.first;
const NodeID expression = it->second.second;
const expr_t expression = it->second.second;
int id = symbol_table.getTypeSpecificID(name) + 1;
if (symbol_table.getType(name) == eEndogenous)
......@@ -675,7 +675,7 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const
const string &name1 = it->first.first;
const string &name2 = it->first.second;
const string &weight = it->second.first;
const NodeID expression = it->second.second;
const expr_t expression = it->second.second;
int id1 = symbol_table.getTypeSpecificID(name1) + 1;
int id2 = symbol_table.getTypeSpecificID(name2) + 1;
......@@ -706,7 +706,7 @@ CalibVarStatement::writeOutput(ostream &output, const string &basename) const
const string &name = it->first.first;
int iar = it->first.second + 3;
const string &weight = it->second.first;
const NodeID expression = it->second.second;
const expr_t expression = it->second.second;
int id = symbol_table.getTypeSpecificID(name) + 1;
......@@ -810,7 +810,7 @@ OptimWeightsStatement::writeOutput(ostream &output, const string &basename) cons
it != var_weights.end(); it++)
{
const string &name = it->first;
const NodeID value = it->second;
const expr_t value = it->second;
int id = symbol_table.getTypeSpecificID(name) + 1;
output << "optim_weights_(" << id << "," << id << ") = ";
value->writeOutput(output);
......@@ -823,7 +823,7 @@ OptimWeightsStatement::writeOutput(ostream &output, const string &basename) cons
{
const string &name1 = it->first.first;
const string &name2 = it->first.second;
const NodeID value = it->second;
const expr_t value = it->second;
int id1 = symbol_table.getTypeSpecificID(name1) + 1;
int id2 = symbol_table.getTypeSpecificID(name2) + 1;
output << "optim_weights_(" << id1 << "," << id2 << ") = ";
......
......@@ -169,7 +169,7 @@ public:
class ObservationTrendsStatement : public Statement
{
public:
typedef map<string, NodeID> trend_elements_t;
typedef map<string, expr_t> trend_elements_t;
private:
const trend_elements_t trend_elements;
const SymbolTable &symbol_table;
......@@ -241,7 +241,7 @@ class EstimationParams
public:
int type;
string name, name2, prior;
NodeID init_val, low_bound, up_bound, mean, std, p3, p4, jscale;
expr_t init_val, low_bound, up_bound, mean, std, p3, p4, jscale;
void
init(const DataTree &datatree)
......@@ -298,8 +298,8 @@ public:
class OptimWeightsStatement : public Statement
{
public:
typedef map<string, NodeID> var_weights_t;
typedef map<pair<string, string>, NodeID> covar_weights_t;
typedef map<string, expr_t> var_weights_t;
typedef map<pair<string, string>, expr_t> covar_weights_t;
private:
const var_weights_t var_weights;
const covar_weights_t covar_weights;
......@@ -324,11 +324,11 @@ class CalibVarStatement : public Statement
{
public:
//! Maps a variable to a pair (weight, expression)
typedef map<string, pair<string, NodeID> > calib_var_t;
typedef map<string, pair<string, expr_t> > calib_var_t;
//! Maps a pair of variables to a pair (weight, expression)
typedef map<pair<string, string>, pair<string, NodeID> > calib_covar_t;
typedef map<pair<string, string>, pair<string, expr_t> > calib_covar_t;
//! Maps a pair (variable, autocorr) to a pair (weight, expression)
typedef map<pair<string, int>, pair<string, NodeID> > calib_ac_t;
typedef map<pair<string, int>, pair<string, expr_t> > calib_ac_t;
private:
const calib_var_t calib_var;
const calib_covar_t calib_covar;
......
......@@ -50,7 +50,7 @@ DataTree::~DataTree()
delete *it;
}
NodeID
expr_t
DataTree::AddNumConstant(const string &value)
{
int id = num_constants.AddConstant(value);
......@@ -79,8 +79,8 @@ DataTree::AddVariable(int symb_id, int lag)
return AddVariableInternal(symb_id, lag);
}
NodeID
DataTree::AddPlus(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddPlus(expr_t iArg1, expr_t iArg2)
{
if (iArg1 != Zero && iArg2 != Zero)
{
......@@ -93,7 +93,7 @@ DataTree::AddPlus(NodeID iArg1, NodeID iArg2)
// Nodes iArg1 and iArg2 are sorted by index
if (iArg1->idx > iArg2->idx)
{
NodeID tmp = iArg1;
expr_t tmp = iArg1;
iArg1 = iArg2;
iArg2 = tmp;
}
......@@ -107,8 +107,8 @@ DataTree::AddPlus(NodeID iArg1, NodeID iArg2)
return Zero;
}
NodeID
DataTree::AddMinus(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddMinus(expr_t iArg1, expr_t iArg2)
{
if (iArg2 == Zero)
return iArg1;
......@@ -122,8 +122,8 @@ DataTree::AddMinus(NodeID iArg1, NodeID iArg2)
return AddBinaryOp(iArg1, oMinus, iArg2);
}
NodeID
DataTree::AddUMinus(NodeID iArg1)
expr_t
DataTree::AddUMinus(expr_t iArg1)
{
if (iArg1 != Zero)
{
......@@ -138,8 +138,8 @@ DataTree::AddUMinus(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddTimes(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddTimes(expr_t iArg1, expr_t iArg2)
{
if (iArg1 == MinusOne)
return AddUMinus(iArg2);
......@@ -151,7 +151,7 @@ DataTree::AddTimes(NodeID iArg1, NodeID iArg2)
// Nodes iArg1 and iArg2 are sorted by index
if (iArg1->idx > iArg2->idx)
{
NodeID tmp = iArg1;
expr_t tmp = iArg1;
iArg1 = iArg2;
iArg2 = tmp;
}
......@@ -167,8 +167,8 @@ DataTree::AddTimes(NodeID iArg1, NodeID iArg2)
return Zero;
}
NodeID
DataTree::AddDivide(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddDivide(expr_t iArg1, expr_t iArg2)
{
if (iArg2 == One)
return iArg1;
......@@ -189,44 +189,44 @@ DataTree::AddDivide(NodeID iArg1, NodeID iArg2)
return AddBinaryOp(iArg1, oDivide, iArg2);
}
NodeID
DataTree::AddLess(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddLess(expr_t iArg1, expr_t iArg2)
{
return AddBinaryOp(iArg1, oLess, iArg2);
}
NodeID
DataTree::AddGreater(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddGreater(expr_t iArg1, expr_t iArg2)
{
return AddBinaryOp(iArg1, oGreater, iArg2);
}
NodeID
DataTree::AddLessEqual(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddLessEqual(expr_t iArg1, expr_t iArg2)
{
return AddBinaryOp(iArg1, oLessEqual, iArg2);
}
NodeID
DataTree::AddGreaterEqual(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddGreaterEqual(expr_t iArg1, expr_t iArg2)
{
return AddBinaryOp(iArg1, oGreaterEqual, iArg2);
}
NodeID
DataTree::AddEqualEqual(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddEqualEqual(expr_t iArg1, expr_t iArg2)
{
return AddBinaryOp(iArg1, oEqualEqual, iArg2);
}
NodeID
DataTree::AddDifferent(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddDifferent(expr_t iArg1, expr_t iArg2)
{
return AddBinaryOp(iArg1, oDifferent, iArg2);
}
NodeID
DataTree::AddPower(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddPower(expr_t iArg1, expr_t iArg2)
{
if (iArg1 != Zero && iArg2 != Zero && iArg2 != One)
return AddBinaryOp(iArg1, oPower, iArg2);
......@@ -238,8 +238,8 @@ DataTree::AddPower(NodeID iArg1, NodeID iArg2)
return Zero;
}
NodeID
DataTree::AddExp(NodeID iArg1)
expr_t
DataTree::AddExp(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oExp, iArg1);
......@@ -247,8 +247,8 @@ DataTree::AddExp(NodeID iArg1)
return One;
}
NodeID
DataTree::AddLog(NodeID iArg1)
expr_t
DataTree::AddLog(expr_t iArg1)
{
if (iArg1 != Zero && iArg1 != One)
return AddUnaryOp(oLog, iArg1);
......@@ -261,8 +261,8 @@ DataTree::AddLog(NodeID iArg1)
}
}
NodeID
DataTree::AddLog10(NodeID iArg1)
expr_t
DataTree::AddLog10(expr_t iArg1)
{
if (iArg1 != Zero && iArg1 != One)
return AddUnaryOp(oLog10, iArg1);
......@@ -275,8 +275,8 @@ DataTree::AddLog10(NodeID iArg1)
}
}
NodeID
DataTree::AddCos(NodeID iArg1)
expr_t
DataTree::AddCos(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oCos, iArg1);
......@@ -284,8 +284,8 @@ DataTree::AddCos(NodeID iArg1)
return One;
}
NodeID
DataTree::AddSin(NodeID iArg1)
expr_t
DataTree::AddSin(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oSin, iArg1);
......@@ -293,8 +293,8 @@ DataTree::AddSin(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddTan(NodeID iArg1)
expr_t
DataTree::AddTan(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oTan, iArg1);
......@@ -302,8 +302,8 @@ DataTree::AddTan(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddAcos(NodeID iArg1)
expr_t
DataTree::AddAcos(expr_t iArg1)
{
if (iArg1 != One)
return AddUnaryOp(oAcos, iArg1);
......@@ -311,8 +311,8 @@ DataTree::AddAcos(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddAsin(NodeID iArg1)
expr_t
DataTree::AddAsin(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oAsin, iArg1);
......@@ -320,8 +320,8 @@ DataTree::AddAsin(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddAtan(NodeID iArg1)
expr_t
DataTree::AddAtan(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oAtan, iArg1);
......@@ -329,8 +329,8 @@ DataTree::AddAtan(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddCosh(NodeID iArg1)
expr_t
DataTree::AddCosh(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oCosh, iArg1);
......@@ -338,8 +338,8 @@ DataTree::AddCosh(NodeID iArg1)
return One;
}
NodeID
DataTree::AddSinh(NodeID iArg1)
expr_t
DataTree::AddSinh(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oSinh, iArg1);
......@@ -347,8 +347,8 @@ DataTree::AddSinh(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddTanh(NodeID iArg1)
expr_t
DataTree::AddTanh(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oTanh, iArg1);
......@@ -356,8 +356,8 @@ DataTree::AddTanh(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddAcosh(NodeID iArg1)
expr_t
DataTree::AddAcosh(expr_t iArg1)
{
if (iArg1 != One)
return AddUnaryOp(oAcosh, iArg1);
......@@ -365,8 +365,8 @@ DataTree::AddAcosh(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddAsinh(NodeID iArg1)
expr_t
DataTree::AddAsinh(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oAsinh, iArg1);
......@@ -374,8 +374,8 @@ DataTree::AddAsinh(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddAtanh(NodeID iArg1)
expr_t
DataTree::AddAtanh(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oAtanh, iArg1);
......@@ -383,8 +383,8 @@ DataTree::AddAtanh(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddSqrt(NodeID iArg1)
expr_t
DataTree::AddSqrt(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oSqrt, iArg1);
......@@ -392,8 +392,8 @@ DataTree::AddSqrt(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddErf(NodeID iArg1)
expr_t
DataTree::AddErf(expr_t iArg1)
{
if (iArg1 != Zero)
return AddUnaryOp(oErf, iArg1);
......@@ -401,69 +401,69 @@ DataTree::AddErf(NodeID iArg1)
return Zero;
}
NodeID
DataTree::AddMax(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddMax(expr_t iArg1, expr_t iArg2)
{
return AddBinaryOp(iArg1, oMax, iArg2);
}
NodeID
DataTree::AddMin(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddMin(expr_t iArg1, expr_t iArg2)
{
return AddBinaryOp(iArg1, oMin, iArg2);
}
NodeID
DataTree::AddNormcdf(NodeID iArg1, NodeID iArg2, NodeID iArg3)
expr_t
DataTree::AddNormcdf(expr_t iArg1, expr_t iArg2, expr_t iArg3)
{
return AddTrinaryOp(iArg1, oNormcdf, iArg2, iArg3);
}
NodeID
DataTree::AddNormpdf(NodeID iArg1, NodeID iArg2, NodeID iArg3)
expr_t
DataTree::AddNormpdf(expr_t iArg1, expr_t iArg2, expr_t iArg3)
{
return AddTrinaryOp(iArg1, oNormpdf, iArg2, iArg3);
}
NodeID
DataTree::AddSteadyState(NodeID iArg1)
expr_t
DataTree::AddSteadyState(expr_t iArg1)
{
return AddUnaryOp(oSteadyState, iArg1);
}
NodeID
DataTree::AddExpectation(int iArg1, NodeID iArg2)
expr_t
DataTree::AddExpectation(int iArg1, expr_t iArg2)
{
return AddUnaryOp(oExpectation, iArg2, iArg1);
}
NodeID
DataTree::AddExpectation(string *iArg1, NodeID iArg2)
expr_t
DataTree::AddExpectation(string *iArg1, expr_t iArg2)
{
return AddUnaryOp(oExpectation, iArg2, 0, *iArg1);
}
NodeID
DataTree::AddEqual(NodeID iArg1, NodeID iArg2)
expr_t
DataTree::AddEqual(expr_t iArg1, expr_t iArg2)
{
return AddBinaryOp(iArg1, oEqual, iArg2);
}
void
DataTree::AddLocalVariable(int symb_id, NodeID value) throw (LocalVariableException)
DataTree::AddLocalVariable(int symb_id, expr_t value) throw (LocalVariableException)
{
assert(symbol_table.getType(symb_id) == eModelLocalVariable);
// Throw an exception if symbol already declared
map<int, NodeID>::iterator it = local_variables_table.find(symb_id);
map<int, expr_t>::iterator it = local_variables_table.find(symb_id);
if (it != local_variables_table.end())
throw LocalVariableException(symbol_table.getName(symb_id));
local_variables_table[symb_id] = value;
}
NodeID
DataTree::AddExternalFunction(int symb_id, const vector<NodeID> &arguments)
expr_t
DataTree::AddExternalFunction(int symb_id, const vector<expr_t> &arguments)
{
assert(symbol_table.getType(symb_id) == eExternalFunction);
......@@ -474,8 +474,8 @@ DataTree::AddExternalFunction(int symb_id, const vector<NodeID> &arguments)
return new ExternalFunctionNode(*this, symb_id, arguments);
}
NodeID
DataTree::AddFirstDerivExternalFunctionNode(int top_level_symb_id, const vector<NodeID> &arguments, int input_index)
expr_t
DataTree::AddFirstDerivExternalFunctionNode(int top_level_symb_id, const vector<expr_t> &arguments, int input_index)
{
assert(symbol_table.getType(top_level_symb_id) == eExternalFunction);
......@@ -488,8 +488,8 @@ DataTree::AddFirstDerivExternalFunctionNode(int top_level_symb_id, const vector<
return new FirstDerivExternalFunctionNode(*this, top_level_symb_id, arguments, input_index);
}
NodeID
DataTree::AddSecondDerivExternalFunctionNode(int top_level_symb_id, const vector<NodeID> &arguments, int input_index1, int input_index2)
expr_t
DataTree::AddSecondDerivExternalFunctionNode(int top_level_symb_id, const vector<expr_t> &arguments, int input_index1, int input_index2)
{
assert(symbol_table.getType(top_level_symb_id) == eExternalFunction);
......
......@@ -59,43 +59,43 @@ protected:
//! Pair (symbol_id, lag) used as key
typedef map<pair<int, int>, VariableNode *> variable_node_map_t;
variable_node_map_t variable_node_map;
typedef map<pair<NodeID, UnaryOpcode>, UnaryOpNode *> unary_op_node_map_t;
typedef map<pair<expr_t, UnaryOpcode>, UnaryOpNode *> unary_op_node_map_t;
unary_op_node_map_t unary_op_node_map;
typedef map<pair<pair<NodeID, NodeID>, BinaryOpcode>, BinaryOpNode *> binary_op_node_map_t;
typedef map<pair<pair<expr_t, expr_t>, BinaryOpcode>, BinaryOpNode *> binary_op_node_map_t;
binary_op_node_map_t binary_op_node_map;
typedef map<pair<pair<pair<NodeID, NodeID>, NodeID>, TrinaryOpcode>, TrinaryOpNode *> trinary_op_node_map_t;
typedef map<pair<pair<pair<expr_t, expr_t>, expr_t>, TrinaryOpcode>, TrinaryOpNode *> trinary_op_node_map_t;
trinary_op_node_map_t trinary_op_node_map;
typedef map<pair<vector<NodeID>, int>, ExternalFunctionNode *> external_function_node_map_t;
typedef map<pair<vector<expr_t>, int>, ExternalFunctionNode *> external_function_node_map_t;
external_function_node_map_t external_function_node_map;
typedef map<pair<pair<vector<NodeID>, int>, int>, FirstDerivExternalFunctionNode *> first_deriv_external_function_node_map_t;
typedef map<pair<pair<vector<expr_t>, int>, int>, FirstDerivExternalFunctionNode *> first_deriv_external_function_node_map_t;
first_deriv_external_function_node_map_t first_deriv_external_function_node_map;
typedef map<pair<pair<vector<NodeID>, pair<int, int> >, int>, SecondDerivExternalFunctionNode *> second_deriv_external_function_node_map_t;
typedef map<pair<pair<vector<expr_t>, pair<int, int> >, int>, SecondDerivExternalFunctionNode *> second_deriv_external_function_node_map_t;
second_deriv_external_function_node_map_t second_deriv_external_function_node_map;
//! Stores local variables value (maps symbol ID to corresponding node)
map<int, NodeID> local_variables_table;
map<int, expr_t> local_variables_table;
//! Internal implementation of AddVariable(), without the check on the lag
VariableNode *AddVariableInternal(int symb_id, int lag);
private:
typedef list<NodeID> node_list_t;
typedef list<expr_t> node_list_t;
//! The list of nodes
node_list_t node_list;
//! A counter for filling ExprNode's idx field
int node_counter;
inline NodeID AddPossiblyNegativeConstant(double val);
inline NodeID AddUnaryOp(UnaryOpcode op_code, NodeID arg, int arg_exp_info_set = 0, const string &arg_exp_info_set_name="");
inline NodeID AddBinaryOp(NodeID arg1, BinaryOpcode op_code, NodeID arg2);
inline NodeID AddTrinaryOp(NodeID arg1, TrinaryOpcode op_code, NodeID arg2, NodeID arg3);
inline expr_t AddPossiblyNegativeConstant(double val);
inline expr_t AddUnaryOp(UnaryOpcode op_code, expr_t arg, int arg_exp_info_set = 0, const string &arg_exp_info_set_name="");
inline expr_t AddBinaryOp(expr_t arg1, BinaryOpcode op_code, expr_t arg2);
inline expr_t AddTrinaryOp(expr_t arg1, TrinaryOpcode op_code, expr_t arg2, expr_t arg3);
public:
DataTree(SymbolTable &symbol_table_arg, NumericalConstants &num_constants_arg, ExternalFunctionsTable &external_functions_table_arg);
virtual ~DataTree();
//! Some predefined constants
NodeID Zero, One, Two, MinusOne, NaN, Infinity, MinusInfinity, Pi;
expr_t Zero, One, Two, MinusOne, NaN, Infinity, MinusInfinity, Pi;
//! Raised when a local parameter is declared twice
class LocalVariableException
......@@ -108,92 +108,92 @@ public:
};
//! Adds a numerical constant
NodeID AddNumConstant(const string &value);
expr_t AddNumConstant(const string &value);
//! Adds a variable
/*! The default implementation of the method refuses any lag != 0 */
virtual VariableNode *AddVariable(int symb_id, int lag = 0);
//! Adds "arg1+arg2" to model tree
NodeID AddPlus(NodeID iArg1, NodeID iArg2);
expr_t AddPlus(expr_t iArg1, expr_t iArg2);
//! Adds "arg1-arg2" to model tree
NodeID AddMinus(NodeID iArg1, NodeID iArg2);
expr_t AddMinus(expr_t iArg1, expr_t iArg2);
//! Adds "-arg" to model tree
NodeID AddUMinus(NodeID iArg1);
expr_t AddUMinus(expr_t iArg1);
//! Adds "arg1*arg2" to model tree
NodeID AddTimes(NodeID iArg1, NodeID iArg2);
expr_t AddTimes(expr_t iArg1, expr_t iArg2);
//! Adds "arg1/arg2" to model tree
NodeID AddDivide(NodeID iArg1, NodeID iArg2);
expr_t AddDivide(expr_t iArg1, expr_t iArg2);
//! Adds "arg1<arg2" to model tree
NodeID AddLess(NodeID iArg1, NodeID iArg2);
expr_t AddLess(expr_t iArg1, expr_t iArg2);
//! Adds "arg1>arg2" to model tree
NodeID AddGreater(NodeID iArg1, NodeID iArg2);
expr_t AddGreater(expr_t iArg1, expr_t iArg2);
//! Adds "arg1<=arg2" to model tree
NodeID AddLessEqual(NodeID iArg1, NodeID iArg2);
expr_t AddLessEqual(expr_t iArg1, expr_t iArg2);
//! Adds "arg1>=arg2" to model tree
NodeID AddGreaterEqual(NodeID iArg1, NodeID iArg2);
expr_t AddGreaterEqual(expr_t iArg1, expr_t iArg2);
//! Adds "arg1==arg2" to model tree
NodeID AddEqualEqual(NodeID iArg1, NodeID iArg2);
expr_t AddEqualEqual(expr_t iArg1, expr_t iArg2);
//! Adds "arg1!=arg2" to model tree
NodeID AddDifferent(NodeID iArg1, NodeID iArg2);
expr_t AddDifferent(expr_t iArg1, expr_t iArg2);
//! Adds "arg1^arg2" to model tree
NodeID AddPower(NodeID iArg1, NodeID iArg2);
expr_t AddPower(expr_t iArg1, expr_t iArg2);
//! Adds "E(arg1)(arg2)" to model tree
NodeID AddExpectation(int iArg1, NodeID iArg2);
expr_t AddExpectation(int iArg1, expr_t iArg2);
//! Adds "E(arg1)(arg2)" to model tree
NodeID AddExpectation(string *iArg1, NodeID iArg2);