38 struct yy_buffer_state;
66 for (
Constants_iter j = constants.begin(); j != constants.end(); j++) {
72 for (
Clause_iter k = expr.begin(); k != expr.end(); k++) {
97 throw InternalErr(__FILE__, __LINE__,
"There are no CE clauses for *this* DDS object.");
99 return (*iter)->value(dds);
118 expr.push_back(clause);
134 expr.push_back(clause);
150 expr.push_back(clause);
162 constants.push_back(btp);
173 func_name_is(
const string &name) :
177 bool operator()(
const ConstraintEvaluator::function f)
179 return f.name == d_name;
203 void ConstraintEvaluator::add_function(
const string &name, bool_func f)
206 function func(name, f);
207 functions.push_back(func);
211 void ConstraintEvaluator::add_function(
const string &name, btp_func f)
214 function func(name, f);
215 functions.push_back(func);
219 void ConstraintEvaluator::add_function(
const string &name, proj_func f)
222 function func(name, f);
223 functions.push_back(func);
232 if (functions.empty())
235 for (Functions_citer i = functions.begin(); i != functions.end(); i++) {
236 if (name == (*i).name && (*f = (*i).b_func)) {
250 if (functions.empty())
253 for (Functions_citer i = functions.begin(); i != functions.end(); i++) {
254 if (name == (*i).name && (*f = (*i).bt_func)) {
268 if (functions.empty())
271 for (Functions_citer i = functions.begin(); i != functions.end(); i++)
272 if (name == (*i).name && (*f = (*i).p_func)) {
304 if (expr.size() != 1)
305 throw InternalErr(__FILE__, __LINE__,
"The length of the list of CE clauses is not 1.");
309 if (cp->
value(dds, &result))
329 for (
unsigned int i = 0; i < expr.size(); ++i) {
357 throw InternalErr(__FILE__, __LINE__,
"The constraint expression is empty.");
360 for (
unsigned int i = 0; i < expr.size(); ++i) {
363 if (cp->
value(dds, &result)) {
370 throw Error(
"A function was called but failed to return a value.");
395 throw InternalErr(__FILE__, __LINE__,
"The constraint expression is empty.");
400 for (
unsigned int i = 0; i < expr.size(); ++i) {
403 if (cp->
value(dds, &result)) {
408 throw Error(
"A function was called but failed to return a value.");
422 for (
Clause_iter i = expr.begin(); i != expr.end(); i++) {
423 boolean =
boolean && (*i)->boolean_clause();
439 DBG(cerr <<
"No selection recorded" << endl);
443 DBG(cerr <<
"Eval selection" << endl);
450 for (
Clause_iter i = expr.begin(); i != expr.end() && result; i++) {
452 if (!((*i)->boolean_clause()))
453 throw InternalErr(__FILE__, __LINE__,
"A selection expression must contain only boolean clauses.");
454 result = result && (*i)->value(dds);