aGrUM 2.3.2
a C++ library for (probabilistic) graphical models
errors.cpp
Go to the documentation of this file.
1/****************************************************************************
2 * This file is part of the aGrUM/pyAgrum library. *
3 * *
4 * Copyright (c) 2005-2025 by *
5 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
6 * - Christophe GONZALES(_at_AMU) *
7 * *
8 * The aGrUM/pyAgrum library is free software; you can redistribute it *
9 * and/or modify it under the terms of either : *
10 * *
11 * - the GNU Lesser General Public License as published by *
12 * the Free Software Foundation, either version 3 of the License, *
13 * or (at your option) any later version, *
14 * - the MIT license (MIT), *
15 * - or both in dual license, as here. *
16 * *
17 * (see https://agrum.gitlab.io/articles/dual-licenses-lgplv3mit.html) *
18 * *
19 * This aGrUM/pyAgrum library is distributed in the hope that it will be *
20 * useful, but WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
21 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES MERCHANTABILITY or FITNESS *
22 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *
23 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
24 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
25 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR *
26 * OTHER DEALINGS IN THE SOFTWARE. *
27 * *
28 * See LICENCES for more details. *
29 * *
30 * SPDX-FileCopyrightText: Copyright 2005-2025 *
31 * - Pierre-Henri WUILLEMIN(_at_LIP6) *
32 * - Christophe GONZALES(_at_AMU) *
33 * SPDX-License-Identifier: LGPL-3.0-or-later OR MIT *
34 * *
35 * Contact : info_at_agrum_dot_org *
36 * homepage : http://agrum.gitlab.io *
37 * gitlab : https://gitlab.com/agrumery/agrum *
38 * *
39 ****************************************************************************/
40
41
49
51
52#ifndef DOXYGEN_SHOULD_SKIP_THIS
53
54namespace gum {
55 namespace prm {
56 namespace o3prm {
57
58 void O3PRM_TYPE_NOT_FOUND(const O3Label& val, ErrorsContainer& errors) {
59 auto pos = val.position();
60 std::stringstream msg;
61 msg << "Error : "
62 << "Unknown type " << val.label();
63 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
64 }
65
66 void O3PRM_TYPE_AMBIGUOUS(const O3Label& val,
67 const std::vector< std::string >& matches,
68 ErrorsContainer& errors) {
69 const auto& pos = val.position();
70 std::stringstream msg;
71 msg << "Error : "
72 << "Ambiguous name " << val.label() << ", found more than one elligible types: ";
73 for (std::size_t i = 0; i < matches.size() - 1; ++i) {
74 msg << matches[i] << ", ";
75 }
76 msg << matches.back();
77 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
78 }
79
80 void O3PRM_TYPE_RESERVED(const O3Label& val, ErrorsContainer& errors) {
81 const auto& pos = val.position();
82 std::stringstream msg;
83 msg << "Error : "
84 << "Type name " << val.label() << " is reserved";
85 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
86 }
87
88 void O3PRM_TYPE_DUPPLICATE(const O3Label& val, ErrorsContainer& errors) {
89 const auto& pos = val.position();
90 std::stringstream msg;
91 msg << "Error : "
92 << "Type " << val.label() << " exists already";
93 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
94 }
95
96 void O3PRM_TYPE_CYCLIC_INHERITANCE(const O3Label& sub_type,
97 const O3Label& super_type,
98 ErrorsContainer& errors) {
99 const auto& pos = sub_type.position();
100 std::stringstream msg;
101 msg << "Error : "
102 << "Cyclic inheritance between type " << sub_type.label() << " and type "
103 << super_type.label();
104 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
105 }
106
107 void
108 O3PRM_TYPE_UNKNOWN_LABEL(const O3Label& type, const O3Label& l, ErrorsContainer& errors) {
109 const auto& pos = l.position();
110 std::stringstream msg;
111 msg << "Error : "
112 << "Unknown label " << l.label() << " in " << type.label();
113 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
114 }
115
116 void O3PRM_TYPE_INVALID_RANGE(const O3IntType& val, ErrorsContainer& errors) {
117 const auto& pos = val.position();
118 std::stringstream msg;
119 msg << "Error : "
120 << "Invalid range " << val.start().value() << " -> " << val.end().value();
121 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
122 }
123
124 void O3PRM_TYPE_INVALID_RANGE(const O3RealType& val, ErrorsContainer& errors) {
125 const auto& pos = val.position();
126 std::stringstream msg;
127 msg << "Error : "
128 << "Found " << val.values().size() << " values in range expected at least 3";
129 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
130 }
131
132 void O3PRM_CLASS_NOT_FOUND(const O3Label& val, ErrorsContainer& errors) {
133 const auto& pos = val.position();
134 std::stringstream msg;
135 msg << "Error : "
136 << "Unknown class " << val.label();
137 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
138 GUM_ERROR(FatalError, msg.str())
139 }
140
141 void O3PRM_CLASS_AMBIGUOUS(const O3Label& val,
142 const std::vector< std::string >& matches,
143 ErrorsContainer& errors) {
144 const auto& pos = val.position();
145 std::stringstream msg;
146 msg << "Error : "
147 << "Name " << val.label() << " is ambiguous: ";
148 for (std::size_t i = 0; i < matches.size() - 1; ++i) {
149 msg << matches[i] << ", ";
150 }
151 msg << matches.back();
152 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
153 }
154
155 void O3PRM_CLASS_DUPLICATE(const O3Label& val, ErrorsContainer& errors) {
156 // Raised if duplicate type names
157 const auto& pos = val.position();
158 std::stringstream msg;
159 msg << "Error : "
160 << "Class name " << val.label() << " exists already";
161 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
162 }
163
164 void O3PRM_CLASS_CYLIC_INHERITANCE(const O3Label& sub,
165 const O3Label& super,
166 ErrorsContainer& errors) {
167 // Cyclic inheritance
168 const auto& pos = sub.position();
169 std::stringstream msg;
170 msg << "Error : "
171 << "Cyclic inheritance between class " << sub.label() << " and class " << super.label();
172 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
173 }
174
175 void O3PRM_CLASS_ATTR_IMPLEMENTATION(const O3Label& c,
176 const O3Label& i,
177 const O3Label& attr,
178 ErrorsContainer& errors) {
179 const auto& pos = attr.position();
180 std::stringstream msg;
181 msg << "Error : "
182 << "Class " << c.label() << " attribute " << attr.label()
183 << " does not respect interface " << i.label();
184 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
185 }
186
187 void O3PRM_CLASS_AGG_IMPLEMENTATION(const O3Label& c,
188 const O3Label& i,
189 const O3Label& attr,
190 ErrorsContainer& errors) {
191 const auto& pos = attr.position();
192 std::stringstream msg;
193 msg << "Error : "
194 << "Class " << c.label() << " aggregate " << attr.label()
195 << " does not respect interface " << i.label();
196 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
197 }
198
199 void O3PRM_CLASS_REF_IMPLEMENTATION(const O3Label& c,
200 const O3Label& i,
201 const O3Label& ref,
202 ErrorsContainer& errors) {
203 const auto& pos = ref.position();
204 std::stringstream msg;
205 msg << "Error : "
206 << "Class " << c.label() << " reference " << ref.label()
207 << " does not respect interface " << i.label();
208 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
209 }
210
211 void O3PRM_CLASS_MISSING_ATTRIBUTES(const O3Label& c,
212 const O3Label& i,
213 ErrorsContainer& errors) {
214 const auto& pos = c.position();
215 std::stringstream msg;
216 msg << "Error : "
217 << "Class " << c.label() << " does not implement all of interface " << i.label()
218 << " attributes";
219 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
220 }
221
222 void O3PRM_CLASS_DUPLICATE_REFERENCE(const O3Label& ref, ErrorsContainer& errors) {
223 const auto& pos = ref.position();
224 std::stringstream msg;
225 msg << "Error : "
226 << "Reference Slot name " << ref.label() << " exists already";
227 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
228 }
229
230 void O3PRM_CLASS_SELF_REFERENCE(const O3Label& c,
231 const O3Label& ref,
232 ErrorsContainer& errors) {
233 const auto& pos = ref.position();
234 std::stringstream msg;
235 msg << "Error : "
236 << "Class " << c.label() << " cannot reference itself";
237 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
238 }
239
240 void O3PRM_CLASS_ILLEGAL_SUB_REFERENCE(const O3Label& c,
241 const O3Label& sub,
242 ErrorsContainer& errors) {
243 const auto& pos = sub.position();
244 std::stringstream msg;
245 msg << "Error : "
246 << "Class " << c.label() << " cannot reference subclass " << sub.label();
247 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
248 }
249
250 void O3PRM_CLASS_PARENT_NOT_FOUND(const O3Label& parent, ErrorsContainer& errors) {
251 const auto& pos = parent.position();
252 std::stringstream msg;
253 msg << "Error : "
254 << "Parent " << parent.label() << " not found";
255 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
256 }
257
258 void O3PRM_CLASS_ILLEGAL_PARENT(const O3Label& parent, ErrorsContainer& errors) {
259 const auto& pos = parent.position();
260 std::stringstream msg;
261 msg << "Error : "
262 << "Illegal parent " << parent.label();
263 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
264 }
265
266 void O3PRM_CLASS_LINK_NOT_FOUND(const O3Label& chain,
267 const std::string& s,
268 ErrorsContainer& errors) {
269 const auto& pos = chain.position();
270 std::stringstream msg;
271 msg << "Error : "
272 << "Link " << s << " in chain " << chain.label() << " not found";
273 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
274 }
275
276 void O3PRM_CLASS_ILLEGAL_CPT_SIZE(const std::string& c,
277 const O3Label& attr,
278 Size found,
279 Size expected,
280 ErrorsContainer& errors) {
281 const auto& pos = attr.position();
282 std::stringstream msg;
283 msg << "Error : "
284 << "Illegal CPT size, expected " << expected << " found " << found << " for attribute "
285 << c << "." << attr.label();
286 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
287 }
288
289 void O3PRM_CLASS_ILLEGAL_CPT_VALUE(const std::string& c,
290 const O3Label& attr,
291 const O3Formula& f,
292 ErrorsContainer& errors) {
293 const auto& pos = f.position();
294 std::stringstream msg;
295 msg << "Error : "
296 << "Illegal CPT value \"" << f.formula().formula() << "\" in attribute " << c << "."
297 << attr.label();
298 try {
299 auto result = f.formula().result();
300 msg << ", formula resolve to " << result;
301 } catch (...) {
302 msg << ", could not resolve the following formula: "
303 << "\"" << f.formula().formula() << "\"";
304 }
305 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
306 }
307
308 void O3PRM_CLASS_CPT_DOES_NOT_SUM_TO_1(const std::string& c,
309 const O3Label& attr,
310 float f,
311 ErrorsContainer& errors) {
312 const auto& pos = attr.position();
313 std::stringstream msg;
314 msg << "Error : "
315 << "PRMAttribute " << c << "." << attr.label() << " CPT does not sum to 1, found " << f;
316 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
317 }
318
319 void O3PRM_CLASS_CPT_DOES_NOT_SUM_TO_1_WARNING(const std::string& c,
320 const O3Label& attr,
321 float f,
322 ErrorsContainer& errors) {
323 const auto& pos = attr.position();
324 std::stringstream msg;
325 msg << "Warning : "
326 << "PRMAttribute " << c << "." << attr.label() << " CPT does not sum to 1, found " << f;
327 errors.addWarning(msg.str(), pos.file(), pos.line(), pos.column());
328 }
329
330 void O3PRM_CLASS_ILLEGAL_RULE_SIZE(const O3RuleCPT::O3Rule& rule,
331 size_t found,
332 size_t expected,
333 ErrorsContainer& errors) {
334 const auto& pos = rule.first.front().position();
335 std::stringstream msg;
336 msg << "Error : "
337 << "Expected " << expected << " value(s), found " << found;
338 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
339 }
340
341 void O3PRM_CLASS_ILLEGAL_RULE_LABEL(const O3RuleCPT::O3Rule& rule,
342 const O3Label& label,
343 const O3Label& parent,
344 ErrorsContainer& errors) {
345 const auto& pos = label.position();
346 std::stringstream msg;
347 msg << "Error : "
348 << "Label " << label << " is not part of " << parent << " domain";
349 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
350 }
351
352 void O3PRM_CLASS_WRONG_PARENT(const O3Label& prnt, ErrorsContainer& errors) {
353 const auto& pos = prnt.position();
354 std::stringstream msg;
355 msg << "Error : "
356 << "Illegal parent " << prnt;
357 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
358 }
359
360 void O3PRM_CLASS_WRONG_PARENT_TYPE(const O3Label& prnt,
361 const std::string& expected,
362 const std::string& found,
363 ErrorsContainer& errors) {
364 const auto& pos = prnt.position();
365 std::stringstream msg;
366 msg << "Error : "
367 << "Expected type " << expected << " for parent " << prnt.label() << ", found "
368 << found;
369 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
370 }
371
372 void O3PRM_CLASS_ILLEGAL_OVERLOAD(const O3Label& elt,
373 const O3Label& c,
374 ErrorsContainer& errors) {
375 const auto& pos = elt.position();
376 std::stringstream msg;
377 msg << "Error : "
378 << "Illegal overload of element " << elt.label() << " from class " << c.label();
379 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
380 }
381
382 void O3PRM_CLASS_AGG_PARAMETERS(const O3Label& agg,
383 Size expected,
384 Size found,
385 ErrorsContainer& errors) {
386 const auto& pos = agg.position();
387 std::stringstream msg;
388 msg << "Error : "
389 << "Expected " << expected << " parameters "
390 << ", found " << found;
391 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
392 }
393
394 void O3PRM_CLASS_AGG_PARAMETER_NOT_FOUND(const O3Label& agg,
395 const O3Label& param,
396 ErrorsContainer& errors) {
397 const auto& pos = param.position();
398 std::stringstream msg;
399 msg << "Error : "
400 << "Parameter " << param.label() << " in aggregate " << agg.label()
401 << " does not match any expected values";
402 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
403 }
404
405 void O3PRM_INTERFACE_ILLEGAL_ARRAY(const O3Label& val, ErrorsContainer& errors) {
406 const auto& pos = val.position();
407 std::stringstream msg;
408 msg << "Error : "
409 << "PRMAttribute " << val.label() << " can not be an array";
410 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
411 }
412
413 void O3PRM_INTERFACE_NOT_FOUND(const O3Label& val, ErrorsContainer& errors) {
414 const auto& pos = val.position();
415 std::stringstream msg;
416 msg << "Error : "
417 << "Interface " << val.label() << " not found";
418 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
419 }
420
421 void O3PRM_INTERFACE_AMBIGUOUS(const O3Label& val,
422 const std::vector< std::string >& matches,
423 ErrorsContainer& errors) {
424 const auto& pos = val.position();
425 std::stringstream msg;
426 msg << "Error : "
427 << "Name " << val.label() << " is ambiguous: ";
428 for (std::size_t i = 0; i < matches.size() - 1; ++i) {
429 msg << matches[i] << ", ";
430 }
431 msg << matches.back();
432 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
433 }
434
435 void O3PRM_INTERFACE_DUPLICATE(const O3Label& val, ErrorsContainer& errors) {
436 const auto& pos = val.position();
437 std::stringstream msg;
438 msg << "Error : "
439 << "Interface name " << val.label() << " exists already";
440 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
441 }
442
443 void O3PRM_INTERFACE_DUPLICATE_ELEMENT(const O3InterfaceElement& elt,
444 ErrorsContainer& errors) {
445 const auto& pos = elt.type().position();
446 std::stringstream msg;
447 msg << "Error : "
448 << "Element " << elt.name().label() << " already exists";
449 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
450 }
451
452 void O3PRM_INTERFACE_CYCLIC_INHERITANCE(const O3Label& sub,
453 const O3Label& super,
454 ErrorsContainer& errors) {
455 const auto& pos = super.position();
456 std::stringstream msg;
457 msg << "Error : "
458 << "Cyclic inheritance between interface " << sub.label() << " and interface "
459 << super.label();
460 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
461 }
462
463 void O3PRM_INTERFACE_SELF_REFERENCE(const O3Interface& i,
464 const O3InterfaceElement& r,
465 ErrorsContainer& errors) {
466 const auto& pos = r.type().position();
467 std::stringstream msg;
468 msg << "Error : "
469 << "Interface " << i.name().label() << " cannot reference itself";
470 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
471 }
472
473 void O3PRM_INTERFACE_ILLEGAL_SUB_REFERENCE(const O3Interface& i,
474 const O3InterfaceElement& ref,
475 ErrorsContainer& errors) {
476 const auto& pos = ref.type().position();
477 std::stringstream msg;
478 msg << "Error : "
479 << "Interface " << i.name().label() << " cannot reference subinterface "
480 << ref.type().label();
481 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
482 }
483
484 void O3PRM_INTERFACE_ILLEGAL_OVERLOAD(const O3InterfaceElement& elt,
485 ErrorsContainer& errors) {
486 const auto& pos = elt.type().position();
487 std::stringstream msg;
488 msg << "Error : "
489 << "Illegal overload of element " << elt.name().label();
490 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
491 }
492
493 void O3PRM_REFERENCE_NOT_FOUND(const O3Label& val, ErrorsContainer& errors) {
494 const auto& pos = val.position();
495 std::stringstream msg;
496 msg << "Error : "
497 << "Reference Slot type " << val.label() << " not found";
498 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
499 }
500
501 void O3PRM_REFERENCE_AMBIGUOUS(const O3Label& val,
502 const std::vector< std::string >& matches,
503 ErrorsContainer& errors) {
504 const auto& pos = val.position();
505 std::stringstream msg;
506 msg << "Error : "
507 << "Name " << val.label() << " is ambiguous: ";
508 for (std::size_t i = 0; i < matches.size() - 1; ++i) {
509 msg << matches[i] << ", ";
510 }
511 msg << matches.back();
512 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
513 }
514
515 void O3PRM_SYSTEM_INSTANTIATION_FAILED(const O3System& sys, ErrorsContainer& errors) {
516 const auto& pos = sys.name().position();
517 std::stringstream msg;
518 msg << "Error : "
519 << "Could not instantiate the system, some reference slots must be "
520 "unassigned";
521 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
522 }
523
524 void O3PRM_SYSTEM_NOT_A_CLASS(const O3Instance& i, ErrorsContainer& errors) {
525 const auto& pos = i.type().position();
526 std::stringstream msg;
527 msg << "Error : " << i.type().label() << " is not a class";
528 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
529 }
530
531 void O3PRM_SYSTEM_DUPLICATE_INSTANCE(const O3Instance& i, ErrorsContainer& errors) {
532 const auto& pos = i.type().position();
533 std::stringstream msg;
534 msg << "Error : "
535 << "Instance " << i.name().label() << " already exists";
536 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
537 }
538
539 void O3PRM_SYSTEM_NOT_A_PARAMETER(const O3InstanceParameter& param, ErrorsContainer& errors) {
540 const auto& pos = param.name().position();
541 std::stringstream msg;
542 msg << "Instance error : " << param.name().label() << " is not a parameter";
543 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
544 }
545
546 void O3PRM_SYSTEM_PARAMETER_NOT_FOUND(const O3InstanceParameter& param,
547 ErrorsContainer& errors) {
548 const auto& pos = param.name().position();
549 std::stringstream msg;
550 msg << "Error : "
551 << "Parameter " << param.name().label() << " not found";
552 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
553 }
554
555 void O3PRM_SYSTEM_PARAMETER_NOT_INT(const O3InstanceParameter& param,
556 ErrorsContainer& errors) {
557 const auto& pos = param.value().position();
558 std::stringstream msg;
559 msg << "Error : "
560 << "Parameter " << param.name().label() << " is an integer";
561 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
562 }
563
564 void O3PRM_SYSTEM_PARAMETER_NOT_FLOAT(const O3InstanceParameter& param,
565 ErrorsContainer& errors) {
566 const auto& pos = param.value().position();
567 std::stringstream msg;
568 msg << "Error : "
569 << "Parameter " << param.name().label() << " is a float";
570 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
571 }
572
573 void O3PRM_SYSTEM_INVALID_LEFT_VALUE(const O3Label& val, ErrorsContainer& errors) {
574 const auto& pos = val.position();
575 std::stringstream msg;
576 msg << "Error : "
577 << "Invalid left expression " << val.label();
578 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
579 }
580
581 void O3PRM_SYSTEM_INSTANCE_NOT_FOUND(const O3Label& i, ErrorsContainer& errors) {
582 const auto& pos = i.position();
583 std::stringstream msg;
584 msg << "Error : "
585 << "Instance " << i.label() << " not found";
586 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
587 }
588
589 void O3PRM_SYSTEM_REFERENCE_NOT_FOUND(const O3Label& ref,
590 const std::string& type,
591 ErrorsContainer& errors) {
592 const auto& pos = ref.position();
593 std::stringstream msg;
594 msg << "Error : "
595 << "Reference " << ref.label() << " not found in class " << type;
596 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
597 }
598
599 void O3PRM_SYSTEM_NOT_AN_ARRAY(const O3Label& val, ErrorsContainer& errors) {
600 const auto& pos = val.position();
601 std::stringstream msg;
602 msg << "Error : " << val.label() << " is not an array";
603 errors.addError(msg.str(), pos.file(), pos.line(), pos.column());
604 }
605
606 void O3PRM_DEPRECATED_TYPE_WARNING(const O3Label& val, ErrorsContainer& errors) {
607 const auto& pos = val.position();
608 std::stringstream msg;
609 msg << "Warning : " << val.label() << " is declared using a deprecated syntax.";
610 errors.addWarning(msg.str(), pos.file(), pos.line(), pos.column());
611 }
612
613
614 } // namespace o3prm
615 } // namespace prm
616} // namespace gum
617
618#endif // DOXYGEN_SHOULD_SKIP_THIS
The O3Formula is part of the AST of the O3PRM language.
Definition O3prm.h:105
The O3InstanceParameter is part of the AST of the O3PRM language.
Definition O3prm.h:779
The O3Instance is part of the AST of the O3PRM language.
Definition O3prm.h:811
The O3IntType is part of the AST of the O3PRM language.
Definition O3prm.h:266
The O3InterfaceElement is part of the AST of the O3PRM language.
Definition O3prm.h:342
The O3Interface is part of the AST of the O3PRM language.
Definition O3prm.h:375
The O3Label is part of the AST of the O3PRM language.
Definition O3prm.h:192
The O3RealType is part of the AST of the O3PRM language.
Definition O3prm.h:306
std::pair< O3LabelList, O3FormulaList > O3Rule
Definition O3prm.h:563
The O3System is part of the AST of the O3PRM language.
Definition O3prm.h:849
Functions for error messages.
#define GUM_ERROR(type, msg)
Definition exceptions.h:72
std::size_t Size
In aGrUM, hashed values are unsigned long int.
Definition types.h:74
namespace for all probabilistic relational models entities
Definition agrum.h:68
gum is the global namespace for all aGrUM entities
Definition agrum.h:46