Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/system/ibex_SystemFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,13 @@ void SystemFactory::init_args() {
varcopy(input_args, sys_args);
}

void SystemFactory::add_goal(const ExprNode& goal) {
void SystemFactory::add_goal(const ExprNode& goal, const char* name) {
init_args();

Array<const ExprSymbol> goal_vars(input_args.size());
varcopy(input_args,goal_vars);
const ExprNode& goal_expr=ExprCopy().copy(input_args, goal_vars, goal).simplify(simpl_level);
this->goal = new Function(goal_vars, goal_expr);
this->goal = new Function(goal_vars, goal_expr, name);
}

void SystemFactory::add_goal(const Function& goal) {
Expand All @@ -118,14 +118,14 @@ void SystemFactory::add_goal(const Function& goal) {
this->goal = new Function(goal);
}

void SystemFactory::add_ctr(const ExprCtr& ctr) {
void SystemFactory::add_ctr(const ExprCtr& ctr, const char* name) {
init_args();

Array<const ExprSymbol> ctr_args(input_args.size());
varcopy(input_args,ctr_args);
const ExprNode& ctr_expr=ExprCopy().copy(input_args, ctr_args, ctr.e).simplify(simpl_level);

ctrs.push_back(new NumConstraint(*new Function(ctr_args, ctr_expr), ctr.op, true));
ctrs.push_back(new NumConstraint(*new Function(ctr_args, ctr_expr, name), ctr.op, true));

f_ctrs.push_back(& f_ctrs_copy.copy(input_args, sys_args, ctr.e, true));
}
Expand Down
4 changes: 2 additions & 2 deletions src/system/ibex_SystemFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class SystemFactory {
* \warning for convenience, goal is cleaned up (the expression
* does not exist anymore after this function call).
*/
void add_goal(const ExprNode& goal);
void add_goal(const ExprNode& goal,const char* name=NULL);

/**
* \brief Add a goal function (by copy).
Expand All @@ -74,7 +74,7 @@ class SystemFactory {
* \warning the ctr expression must no be deleted until the final system has been built
* (the factory keeps track of nodes for building DAGS).
*/
void add_ctr(const ExprCtr& ctr);
void add_ctr(const ExprCtr& ctr, const char* name=NULL);

/**
* \brief Add a new constraint (by copy).
Expand Down