From 2303cbe49d4c490a4fa601b6a7756720b11d2e4a Mon Sep 17 00:00:00 2001 From: jordan08 Date: Thu, 14 Jan 2021 23:06:26 +0100 Subject: [PATCH] add name of function and constraints in SystemFactory --- src/system/ibex_SystemFactory.cpp | 8 ++++---- src/system/ibex_SystemFactory.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/system/ibex_SystemFactory.cpp b/src/system/ibex_SystemFactory.cpp index 875845e2d..d4af6381e 100644 --- a/src/system/ibex_SystemFactory.cpp +++ b/src/system/ibex_SystemFactory.cpp @@ -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 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) { @@ -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 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)); } diff --git a/src/system/ibex_SystemFactory.h b/src/system/ibex_SystemFactory.h index ad2058a48..830171273 100644 --- a/src/system/ibex_SystemFactory.h +++ b/src/system/ibex_SystemFactory.h @@ -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). @@ -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).