aGrUM 3.1.1
a C++ library for (probabilistic) graphical models
O3prm.cpp
Go to the documentation of this file.
1/****************************************************************************
2 * This file is part of the aGrUM/pyAgrum library. *
3 * *
4 * Copyright (c) 2005-2026 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-2026 *
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
52namespace gum {
53 namespace prm {
54 namespace o3prm {
55
56 O3Position::O3Position() : _file_(""), _line_(0), _column_(0) { GUM_CONSTRUCTOR(O3Position); }
57
58 O3Position::O3Position(std::string_view file, int line, int column) :
60 GUM_CONSTRUCTOR(O3Position);
61 }
62
64 _file_(src._file_), _line_(src._line_), _column_(src._column_) {
65 GUM_CONS_CPY(O3Position);
66 }
67
69 _file_(std::move(src._file_)), _line_(std::move(src._line_)),
70 _column_(std::move(src._column_)) {
71 GUM_CONS_MOV(O3Position);
72 }
73
75 GUM_DESTRUCTOR(O3Position);
76 ;
77 }
78
80 if (this == &src) { return *this; }
81 _file_ = src._file_;
82 _line_ = src._line_;
83 _column_ = src._column_;
84 return *this;
85 }
86
88 if (this == &src) { return *this; }
89 _file_ = std::move(src._file_);
90 _line_ = std::move(src._line_);
91 _column_ = std::move(src._column_);
92 return *this;
93 }
94
95 std::string& O3Position::file() { return _file_; }
96
97 const std::string& O3Position::file() const { return _file_; }
98
99 int& O3Position::line() { return _line_; }
100
101 int O3Position::line() const { return _line_; }
102
103 int& O3Position::column() { return _column_; }
104
105 int O3Position::column() const { return _column_; }
106
108 GUM_CONSTRUCTOR(O3Integer);
109 ;
110 }
111
113 GUM_CONSTRUCTOR(O3Integer);
114 }
115
117 GUM_CONS_CPY(O3Integer);
118 }
119
121 _pos_(std::move(src._pos_)), _value_(std::move(src._value_)) {
122 GUM_CONS_MOV(O3Integer);
123 }
124
126 GUM_DESTRUCTOR(O3Integer);
127 ;
128 }
129
131 if (this == &src) { return *this; }
132 _pos_ = src._pos_;
133 _value_ = src._value_;
134 return *this;
135 }
136
138 if (this == &src) { return *this; }
139 _pos_ = std::move(src._pos_);
140 _value_ = std::move(src._value_);
141 return *this;
142 }
143
144 const O3Position& O3Integer::position() const { return _pos_; }
145
147
148 int O3Integer::value() const { return _value_; }
149
150 int& O3Integer::value() { return _value_; }
151
153 GUM_CONSTRUCTOR(O3Float);
154 ;
155 }
156
157 O3Float::O3Float(const O3Position& pos, float value) : _pos_(pos), _value_(value) {
158 GUM_CONSTRUCTOR(O3Float);
159 }
160
162 GUM_CONS_CPY(O3Float);
163 }
164
166 _pos_(std::move(src._pos_)), _value_(std::move(src._value_)) {
167 GUM_CONS_MOV(O3Float);
168 }
169
171 GUM_DESTRUCTOR(O3Float);
172 ;
173 }
174
176 if (this == &src) { return *this; }
177 _pos_ = src._pos_;
178 _value_ = src._value_;
179 return *this;
180 }
181
183 if (this == &src) { return *this; }
184 _pos_ = std::move(src._pos_);
185 _value_ = std::move(src._value_);
186 return *this;
187 }
188
189 const O3Position& O3Float::position() const { return _pos_; }
190
192
193 float O3Float::value() const { return _value_; }
194
195 float& O3Float::value() { return _value_; }
196
197 O3Formula::O3Formula() : _pos_(), _formula_(std::unique_ptr< Formula >(new Formula(""))) {
198 GUM_CONSTRUCTOR(O3Formula);
199 }
200
202 _pos_(pos), _formula_(std::unique_ptr< Formula >(new Formula(formula))) {
203 GUM_CONSTRUCTOR(O3Formula);
204 }
205
207 _pos_(src._pos_), _formula_(std::unique_ptr< Formula >(new Formula(src.formula()))) {
208 GUM_CONS_CPY(O3Formula);
209 }
210
212 _pos_(std::move(src._pos_)), _formula_(std::move(src._formula_)) {
213 GUM_CONS_MOV(O3Formula);
214 }
215
217 GUM_DESTRUCTOR(O3Formula);
218 ;
219 }
220
222 if (this == &src) { return *this; }
223 _pos_ = src._pos_;
224 _formula_ = std::unique_ptr< Formula >(new Formula(src.formula()));
225 return *this;
226 }
227
229 if (this == &src) { return *this; }
230 _pos_ = std::move(src._pos_);
231 _formula_ = std::move(src._formula_);
232 return *this;
233 }
234
235 const O3Position& O3Formula::position() const { return _pos_; }
236
238
239 const Formula& O3Formula::formula() const { return *_formula_; }
240
242
244 GUM_CONSTRUCTOR(O3Label);
245 ;
246 }
247
248 O3Label::O3Label(const O3Position& pos, std::string_view label) : _pos_(pos), _label_(label) {
249 GUM_CONSTRUCTOR(O3Label);
250 }
251
253 GUM_CONS_CPY(O3Label);
254 }
255
257 _pos_(std::move(src._pos_)), _label_(std::move(src._label_)) {
258 GUM_CONS_MOV(O3Label);
259 }
260
262 GUM_DESTRUCTOR(O3Label);
263 ;
264 }
265
267 if (this == &src) { return *this; }
268 _pos_ = src._pos_;
269 _label_ = src._label_;
270 return *this;
271 }
272
274 if (this == &src) { return *this; }
275 _pos_ = std::move(src._pos_);
276 _label_ = std::move(src._label_);
277 return *this;
278 }
279
280 const O3Position& O3Label::position() const { return _pos_; }
281
283
284 const std::string& O3Label::label() const { return _label_; }
285
286 std::string& O3Label::label() { return _label_; }
287
289 GUM_CONSTRUCTOR(O3Type);
290 ;
291 }
292
293 O3Type::O3Type(const O3Type& src) :
296 GUM_CONS_CPY(O3Type);
297 }
298
300 _pos_(std::move(src._pos_)), _name_(std::move(src._name_)),
301 _superLabel_(std::move(src._superLabel_)), _labels_(std::move(src._labels_)),
302 _dep_flag_(std::move(src._dep_flag_)) {
303 GUM_CONS_MOV(O3Type);
304 }
305
307 GUM_DESTRUCTOR(O3Type);
308 ;
309 }
310
312 if (this == &src) { return *this; }
313 _pos_ = src._pos_;
314 _name_ = src._name_;
316 _labels_ = src._labels_;
318 return *this;
319 }
320
322 if (this == &src) { return *this; }
323 _pos_ = std::move(src._pos_);
324 _name_ = std::move(src._name_);
325 _superLabel_ = std::move(src._superLabel_);
326 _labels_ = std::move(src._labels_);
327 _dep_flag_ = std::move(src._dep_flag_);
328 return *this;
329 }
330
332
333 const O3Label& O3Type::name() const { return _name_; }
334
336
337 const O3Label& O3Type::superLabel() const { return _superLabel_; }
338
340
341 const O3Type::LabelMap& O3Type::labels() const { return _labels_; }
342
344
345 const O3Position& O3Type::position() const { return _pos_; }
346
348
349 const bool& O3Type::o3prm_deprecated() const { return _dep_flag_; }
350
352 GUM_CONSTRUCTOR(O3IntType);
353 ;
354 }
355
357 _pos_(src._pos_), _name_(src._name_), _start_(src._start_), _end_(src._end_),
359 GUM_CONS_CPY(O3IntType);
360 }
361
363 _pos_(std::move(src._pos_)), _name_(std::move(src._name_)),
364 _start_(std::move(src._start_)), _end_(std::move(src._end_)),
365 _dep_flag_(std::move(src._dep_flag_)) {
366 GUM_CONS_MOV(O3IntType);
367 }
368
370 GUM_DESTRUCTOR(O3IntType);
371 ;
372 }
373
375 if (this == &src) { return *this; }
376 _pos_ = src._pos_;
377 _name_ = src._name_;
378 _start_ = src._start_;
379 _end_ = src._end_;
381 return *this;
382 }
383
385 if (this == &src) { return *this; }
386 _pos_ = std::move(src._pos_);
387 _name_ = std::move(src._name_);
388 _start_ = std::move(src._start_);
389 _end_ = std::move(src._end_);
390 _dep_flag_ = std::move(src._dep_flag_);
391 return *this;
392 }
393
395
396 const O3Label& O3IntType::name() const { return _name_; }
397
399
400 const O3Integer& O3IntType::start() const { return _start_; }
401
403
404 const O3Integer& O3IntType::end() const { return _end_; }
405
407
408 const O3Position& O3IntType::position() const { return _pos_; }
409
411
412 const bool& O3IntType::o3prm_deprecated() const { return _dep_flag_; }
413
415 GUM_CONSTRUCTOR(O3RealType);
416 ;
417 }
418
421 GUM_CONS_CPY(O3RealType);
422 }
423
425 _pos_(std::move(src._pos_)), _name_(std::move(src._name_)),
426 _values_(std::move(src._values_)), _dep_flag_(std::move(src._dep_flag_)) {
427 GUM_CONS_MOV(O3RealType);
428 }
429
431 GUM_DESTRUCTOR(O3RealType);
432 ;
433 }
434
436 if (this == &src) { return *this; }
437
438 _pos_ = src._pos_;
439 _name_ = src._name_;
440 _values_ = src._values_;
442 return *this;
443 }
444
446 if (this == &src) { return *this; }
447
448 _pos_ = std::move(src._pos_);
449 _name_ = std::move(src._name_);
450 _values_ = std::move(src._values_);
451 _dep_flag_ = std::move(src._dep_flag_);
452 return *this;
453 }
454
456
457 const O3Position& O3RealType::position() const { return _pos_; }
458
460
461 const O3Label& O3RealType::name() const { return _name_; }
462
463 std::vector< O3Float >& O3RealType::values() { return _values_; }
464
465 const std::vector< O3Float >& O3RealType::values() const { return _values_; }
466
468
469 const bool& O3RealType::o3prm_deprecated() const { return _dep_flag_; }
470
472 GUM_CONSTRUCTOR(O3PRM);
473 // Creating the boolean type
474 auto name = O3Label(O3Position(), "boolean");
475 auto f = O3Label(O3Position(), "false");
476 auto t = O3Label(O3Position(), "true");
477 auto labels = O3Type::LabelMap();
478 labels.push_back(O3Type::LabelPair(f, O3Label()));
479 labels.push_back(O3Type::LabelPair(t, O3Label()));
480 auto boolean = std::unique_ptr< O3Type >(new O3Type());
481 boolean->name() = std::move(name);
482 boolean->labels() = std::move(labels);
483 _types_.push_back(std::move(boolean));
484 }
485
486 O3PRM::O3PRM(const O3PRM& src) {
487 GUM_CONS_CPY(O3PRM);
488 for (const auto& t: src._types_) {
489 _types_.emplace_back(new O3Type(*t));
490 }
491 for (const auto& t: src._int_types_) {
492 _int_types_.emplace_back(new O3IntType(*t));
493 }
494 for (const auto& t: src._real_types_) {
495 _real_types_.emplace_back(new O3RealType(*t));
496 }
497 for (const auto& i: src._interfaces_) {
498 _interfaces_.emplace_back(new O3Interface(*i));
500 for (const auto& c: src._classes_) {
501 _classes_.emplace_back(new O3Class(*c));
502 }
503 for (const auto& s: src._systems_) {
504 _systems_.emplace_back(new O3System(*s));
505 }
506 for (const auto& i: src._imports_) {
507 _imports_.emplace_back(new O3Import(*i));
508 }
509 }
510
512 _types_(std::move(src._types_)), _int_types_(std::move(src._int_types_)),
513 _real_types_(std::move(src._real_types_)), _interfaces_(std::move(src._interfaces_)),
514 _classes_(std::move(src._classes_)), _systems_(std::move(src._systems_)),
515 _imports_(std::move(src._imports_)) {
516 GUM_CONS_MOV(O3PRM);
517 }
518
520 GUM_DESTRUCTOR(O3PRM);
521 ;
522 }
523
525 if (this == &src) { return *this; }
526 for (const auto& t: src._types_) {
527 _types_.emplace_back(new O3Type(*t));
528 }
529 for (const auto& t: src._int_types_) {
530 _int_types_.emplace_back(new O3IntType(*t));
531 }
532 for (const auto& t: src._real_types_) {
533 _real_types_.emplace_back(new O3RealType(*t));
534 }
535 for (const auto& i: src._interfaces_) {
536 _interfaces_.emplace_back(new O3Interface(*i));
537 }
538 for (const auto& c: src._classes_) {
539 _classes_.emplace_back(new O3Class(*c));
540 }
541 for (const auto& s: src._systems_) {
542 _systems_.emplace_back(new O3System(*s));
543 }
544 for (const auto& i: src._imports_) {
545 _imports_.emplace_back(new O3Import(*i));
546 }
547 return *this;
548 }
549
551 if (this == &src) { return *this; }
552 _types_ = std::move(src._types_);
553 _int_types_ = std::move(src._int_types_);
554 _real_types_ = std::move(src._real_types_);
555 _interfaces_ = std::move(src._interfaces_);
556 _classes_ = std::move(src._classes_);
557 _systems_ = std::move(src._systems_);
558 _imports_ = std::move(src._imports_);
559 return *this;
560 }
561
563
564 const O3PRM::O3TypeList& O3PRM::types() const { return _types_; }
565
567
569
571
573
575
577
579
580 const O3PRM::O3ClassList& O3PRM::classes() const { return _classes_; }
581
583
585
587
589
593
595 const O3Label& name,
596 bool isArray) :
598 GUM_CONSTRUCTOR(O3InterfaceElement);
599 }
600
605
607 _type_(std::move(src._type_)), _name_(std::move(src._name_)),
608 _isArray_(std::move(src._isArray_)) {
609 GUM_CONS_MOV(O3InterfaceElement);
610 }
611
613
615 if (this == &src) { return *this; }
616 _type_ = src._type_;
617 _name_ = src._name_;
618 _isArray_ = src._isArray_;
619 return *this;
620 }
621
623 if (this == &src) { return *this; }
624 _type_ = std::move(src._type_);
625 _name_ = std::move(src._name_);
626 _isArray_ = std::move(src._isArray_);
627 return *this;
628 }
629
631
632 const O3Label& O3InterfaceElement::type() const { return _type_; }
633
635
636 const O3Label& O3InterfaceElement::name() const { return _name_; }
637
639
640 bool O3InterfaceElement::isArray() const { return _isArray_; }
641
643 GUM_CONSTRUCTOR(O3Interface);
644 }
645
648 GUM_CONS_CPY(O3Interface);
649 auto copy = new O3InterfaceElementList(src.elements());
650 _elts_ = std::unique_ptr< O3InterfaceElementList >(copy);
651 }
652
654 _pos_(std::move(src._pos_)), _name_(std::move(src._name_)),
655 _superLabel_(std::move(src._superLabel_)), _elts_(std::move(src._elts_)) {
656 GUM_CONS_MOV(O3Interface);
657 }
658
660 GUM_DESTRUCTOR(O3Interface);
661 ;
662 }
663
665 if (this == &src) { return *this; }
666 _pos_ = src._pos_;
667 _name_ = src._name_;
669 auto copy = new O3InterfaceElementList(src.elements());
670 _elts_ = std::unique_ptr< O3InterfaceElementList >(copy);
671 return *this;
672 }
673
675 if (this == &src) { return *this; }
676 _pos_ = std::move(src._pos_);
677 _name_ = std::move(src._name_);
678 _superLabel_ = std::move(src._superLabel_);
679 _elts_ = std::move(src._elts_);
680 return *this;
681 }
682
684
685 const O3Position& O3Interface::position() const { return _pos_; }
686
688
689 const O3Label& O3Interface::name() const { return _name_; }
690
692
694
696
698
700 GUM_CONSTRUCTOR(O3Attribute);
701 ;
702 }
703
705 const O3Label& name,
706 const O3LabelList& parents) :
708 GUM_CONSTRUCTOR(O3Attribute);
709 }
710
712 _type_(src._type_), _name_(src._name_), _parents_(src._parents_) {
713 GUM_CONS_CPY(O3Attribute);
714 }
715
717 _type_(std::move(src._type_)), _name_(std::move(src._name_)),
718 _parents_(std::move(src._parents_)) {
719 GUM_CONS_MOV(O3Attribute);
720 }
721
723 GUM_DESTRUCTOR(O3Attribute);
724 ;
725 }
726
728 if (this == &src) { return *this; }
729 _type_ = src._type_;
730 _name_ = src._name_;
731 _parents_ = src._parents_;
732 return *this;
733 }
734
736 if (this == &src) { return *this; }
737 _type_ = std::move(src._type_);
738 _name_ = std::move(src._name_);
739 _parents_ = std::move(src._parents_);
740 return *this;
741 }
742
744
745 const O3Label& O3Attribute::type() const { return _type_; }
746
748
749 const O3Label& O3Attribute::name() const { return _name_; }
750
752
754
756 GUM_CONSTRUCTOR(O3RawCPT);
757 }
758
760 const O3Label& name,
761 const O3LabelList& parents,
763 GUM_CONSTRUCTOR(O3RawCPT);
764 auto copy = new O3FormulaList(values);
765 _values_ = std::unique_ptr< O3FormulaList >(copy);
766 }
767
769 GUM_CONS_CPY(O3RawCPT);
770 auto copy = new O3FormulaList(*(src._values_));
771 _values_ = std::unique_ptr< O3FormulaList >(copy);
772 }
773
775 GUM_CONS_MOV(O3RawCPT);
776 }
777
779 GUM_DESTRUCTOR(O3RawCPT);
780 ;
781 }
782
784 if (this == &src) { return *this; }
786 auto copy = new O3FormulaList(*(src._values_));
787 _values_ = std::unique_ptr< O3FormulaList >(copy);
788 return *this;
789 }
790
792 if (this == &src) { return *this; }
794 _values_ = std::move(src._values_);
795 return *this;
796 }
797
799
801
802 std::unique_ptr< O3Attribute > O3RawCPT::copy() const {
803 auto copy = new O3RawCPT(*this);
804 return std::unique_ptr< O3Attribute >(copy);
805 }
806
808 GUM_CONSTRUCTOR(O3RuleCPT);
809 }
810
812 const O3Label& name,
814 O3RuleList&& rules) :
816 _rules_(std::unique_ptr< O3RuleList >(new O3RuleList(rules))) {
817 GUM_CONSTRUCTOR(O3RuleCPT);
818 }
819
821 O3Attribute(src), _rules_(std::unique_ptr< O3RuleList >(new O3RuleList(src.rules()))) {
822 GUM_CONS_CPY(O3RuleCPT);
823 }
824
826 GUM_CONS_MOV(O3RuleCPT);
827 }
828
830 GUM_DESTRUCTOR(O3RuleCPT);
831 ;
832 }
833
835 if (this == &src) { return *this; }
836
838 _rules_ = std::unique_ptr< O3RuleList >(new O3RuleList(src.rules()));
839 return *this;
840 }
841
843 if (this == &src) { return *this; }
844
846 _rules_ = std::move(src._rules_);
847 return *this;
848 }
849
851
853
854 std::unique_ptr< O3Attribute > O3RuleCPT::copy() const {
855 auto copy = new O3RuleCPT(*this);
856 return std::unique_ptr< O3Attribute >(copy);
857 }
858
860 GUM_CONSTRUCTOR(O3Class);
861
862 auto i = new O3LabelList();
863 _interfaces_ = std::unique_ptr< O3LabelList >(i);
864
865 auto p = new O3ParameterList();
866 _params_ = std::unique_ptr< O3ParameterList >(p);
867
868 auto r = new O3ReferenceSlotList();
869 _refs_ = std::unique_ptr< O3ReferenceSlotList >(r);
870
871 auto e = new O3AttributeList();
872 _attrs_ = std::unique_ptr< O3AttributeList >(e);
873
874 auto a = new O3AggregateList();
875 _aggs_ = std::unique_ptr< O3AggregateList >(a);
876 }
877
880 GUM_CONS_CPY(O3Class);
881 auto i = new O3LabelList(src.interfaces());
882 _interfaces_ = std::unique_ptr< O3LabelList >(i);
883
884 auto p = new O3ParameterList(src.parameters());
885 _params_ = std::unique_ptr< O3ParameterList >(p);
886
887 auto r = new O3ReferenceSlotList(src.referenceSlots());
888 _refs_ = std::unique_ptr< O3ReferenceSlotList >(r);
889
890 auto e = new O3AttributeList();
891 _attrs_ = std::unique_ptr< O3AttributeList >(e);
892 for (const auto& elt: src.attributes()) {
893 _attrs_->push_back(elt->copy());
894 }
895
896 auto a = new O3AggregateList(src.aggregates());
897 _aggs_ = std::unique_ptr< O3AggregateList >(a);
898 }
899
901 _pos_(std::move(src._pos_)), _name_(std::move(src._name_)),
902 _superLabel_(std::move(src._superLabel_)), _interfaces_(std::move(src._interfaces_)),
903 _params_(std::move(src._params_)), _refs_(std::move(src._refs_)),
904 _attrs_(std::move(src._attrs_)), _aggs_(std::move(src._aggs_)) {
905 GUM_CONS_MOV(O3Class);
906 }
907
909 GUM_DESTRUCTOR(O3Class);
910 ;
911 }
912
914 if (this == &src) { return *this; }
915 _pos_ = src._pos_;
916 _name_ = src._name_;
918
919 auto i = new O3LabelList(src.interfaces());
920 _interfaces_ = std::unique_ptr< O3LabelList >(i);
921
922 auto p = new O3ParameterList(src.parameters());
923 _params_ = std::unique_ptr< O3ParameterList >(p);
924
925 auto r = new O3ReferenceSlotList(src.referenceSlots());
926 _refs_ = std::unique_ptr< O3ReferenceSlotList >(r);
927
928 auto e = new O3AttributeList();
929 _attrs_ = std::unique_ptr< O3AttributeList >(e);
930 for (const auto& elt: src.attributes()) {
931 _attrs_->push_back(elt->copy());
932 }
933
934 auto a = new O3AggregateList(src.aggregates());
935 _aggs_ = std::unique_ptr< O3AggregateList >(a);
936 return *this;
937 }
938
940 if (this == &src) { return *this; }
941 _pos_ = std::move(src._pos_);
942 _name_ = std::move(src._name_);
943 _superLabel_ = std::move(src._superLabel_);
944 _interfaces_ = std::move(src._interfaces_);
945 _params_ = std::move(src._params_);
946 _refs_ = std::move(src._refs_);
947 _attrs_ = std::move(src._attrs_);
948 _aggs_ = std::move(src._aggs_);
949 return *this;
950 }
951
952 const O3Position& O3Class::position() const { return _pos_; }
953
955
956 const O3Label& O3Class::name() const { return _name_; }
957
959
960 const O3Label& O3Class::superLabel() const { return _superLabel_; }
961
963
965
967
969
971
973
975
977
979
981
983
987
989 _type_(O3Parameter::PRMType::INT), _pos_(pos), _name_(name),
990 _value_(O3Float(value.position(), (float)value.value())) {
991 GUM_CONSTRUCTOR(O3Parameter);
992 }
993
996 GUM_CONSTRUCTOR(O3Parameter);
997 }
998
1000 _type_(src._type_), _pos_(src._pos_), _name_(src._name_), _value_(src._value_) {
1001 GUM_CONS_CPY(O3Parameter);
1002 }
1003
1005 _type_(std::move(src._type_)), _pos_(std::move(src._pos_)), _name_(std::move(src._name_)),
1006 _value_(std::move(src._value_)) {
1007 GUM_CONS_MOV(O3Parameter);
1008 }
1009
1011 GUM_DESTRUCTOR(O3Parameter);
1012 ;
1013 }
1014
1016 if (this == &src) { return *this; }
1017 _type_ = src._type_;
1018 _pos_ = src._pos_;
1019 _name_ = src._name_;
1020 _value_ = src._value_;
1021 return *this;
1022 }
1023
1025 if (this == &src) { return *this; }
1026 _type_ = std::move(src._type_);
1027 _pos_ = std::move(src._pos_);
1028 _name_ = std::move(src._name_);
1029 _value_ = std::move(src._value_);
1030 return *this;
1031 }
1032
1034
1036
1038
1039 const O3Position& O3Parameter::position() const { return _pos_; }
1040
1042
1043 const O3Label& O3Parameter::name() const { return _name_; }
1044
1046
1047 const O3Float& O3Parameter::value() const { return _value_; }
1048
1050 GUM_CONSTRUCTOR(O3ReferenceSlot);
1051 ;
1052 }
1053
1056 GUM_CONSTRUCTOR(O3ReferenceSlot);
1057 }
1058
1060 _type_(src._type_), _name_(src._name_), _isArray_(src._isArray_) {
1061 GUM_CONS_CPY(O3ReferenceSlot);
1062 }
1063
1065 _type_(std::move(src._type_)), _name_(std::move(src._name_)),
1066 _isArray_(std::move(src._isArray_)) {
1067 GUM_CONS_MOV(O3ReferenceSlot);
1068 }
1069
1071 GUM_DESTRUCTOR(O3ReferenceSlot);
1072 ;
1073 }
1074
1076 if (this == &src) { return *this; }
1077 _type_ = src._type_;
1078 _name_ = src._name_;
1079 _isArray_ = src._isArray_;
1080 return *this;
1081 }
1082
1084 if (this == &src) { return *this; }
1085 _type_ = std::move(src._type_);
1086 _name_ = std::move(src._name_);
1087 _isArray_ = std::move(src._isArray_);
1088 return *this;
1089 }
1090
1092
1093 const O3Label& O3ReferenceSlot::type() const { return _type_; }
1094
1096
1097 const O3Label& O3ReferenceSlot::name() const { return _name_; }
1098
1100
1101 bool O3ReferenceSlot::isArray() const { return _isArray_; }
1102
1107
1113
1115 _variableType_(std::move(src._variableType_)),
1116 _aggregateType_(std::move(src._aggregateType_)), _name_(std::move(src._name_)),
1117 _parents_(std::move(src._parents_)), _parameters_(std::move(src._parameters_)) {
1118 GUM_CONS_MOV(O3Aggregate);
1119 }
1120
1122 GUM_DESTRUCTOR(O3Aggregate);
1123 ;
1124 }
1125
1127 if (this == &src) { return *this; }
1130 _name_ = src._name_;
1131 _parents_ = src._parents_;
1133 return *this;
1134 }
1135
1137 if (this == &src) { return *this; }
1138 _aggregateType_ = std::move(src._aggregateType_);
1139 _variableType_ = std::move(src._variableType_);
1140 _name_ = std::move(src._name_);
1141 _parents_ = std::move(src._parents_);
1142 _parameters_ = std::move(src._parameters_);
1143 return *this;
1144 }
1145
1147
1149
1151
1153
1155
1156 const O3Label& O3Aggregate::name() const { return _name_; }
1157
1159
1161
1163
1165
1167 GUM_CONSTRUCTOR(O3Assignment);
1168 ;
1169 }
1170
1177
1182 _rightIndex_(std::move(src._rightIndex_)) {
1183 GUM_CONS_CPY(O3Assignment);
1184 }
1185
1187 GUM_DESTRUCTOR(O3Assignment);
1188 ;
1189 }
1190
1192 if (this == &src) { return *this; }
1198 return *this;
1199 }
1200
1202 if (this == &src) { return *this; }
1203 _leftInstance_ = std::move(src._leftInstance_);
1204 _leftIndex_ = std::move(src._leftIndex_);
1205 _leftReference_ = std::move(src._leftReference_);
1206 _rightInstance_ = std::move(src._rightInstance_);
1207 _rightIndex_ = std::move(src._rightIndex_);
1208 return *this;
1209 }
1210
1212
1214
1216
1218
1220
1222
1224
1226
1228
1230
1232 GUM_CONSTRUCTOR(O3Increment);
1233 ;
1234 }
1235
1242
1247 _rightIndex_(std::move(src._rightIndex_)) {
1248 GUM_CONS_CPY(O3Increment);
1249 }
1250
1252 GUM_DESTRUCTOR(O3Increment);
1253 ;
1254 }
1255
1257 if (this == &src) { return *this; }
1263 return *this;
1264 }
1265
1267 if (this == &src) { return *this; }
1268 _leftInstance_ = std::move(src._leftInstance_);
1269 _leftIndex_ = std::move(src._leftIndex_);
1270 _leftReference_ = std::move(src._leftReference_);
1271 _rightInstance_ = std::move(src._rightInstance_);
1272 _rightIndex_ = std::move(src._rightIndex_);
1273 return *this;
1274 }
1275
1277
1279
1281
1283
1285
1287
1289
1291
1293
1295
1297 GUM_CONSTRUCTOR(O3Instance);
1298 ;
1299 }
1300
1302 _type_(src._type_), _name_(src._name_), _size_(src._size_),
1304 GUM_CONS_CPY(O3Instance);
1305 }
1306
1308 _type_(std::move(src._type_)), _name_(std::move(src._name_)),
1309 _size_(std::move(src._size_)), _parameters_(std::move(src._parameters_)) {
1310 GUM_CONS_MOV(O3Instance);
1311 }
1312
1314 GUM_DESTRUCTOR(O3Instance);
1315 ;
1316 }
1317
1319 if (this == &src) { return *this; }
1320 _type_ = src._type_;
1321 _name_ = src._name_;
1322 _size_ = src._size_;
1324 return *this;
1325 }
1326
1328 if (this == &src) { return *this; }
1329 _type_ = std::move(src._type_);
1330 _name_ = std::move(src._name_);
1331 _size_ = std::move(src._size_);
1332 _parameters_ = std::move(src._parameters_);
1333 return *this;
1334 }
1335
1336 const O3Label& O3Instance::type() const { return _type_; }
1337
1339
1340 const O3Label& O3Instance::name() const { return _name_; }
1341
1343
1344 const O3Integer& O3Instance::size() const { return _size_; }
1345
1347
1351
1353
1355 GUM_CONSTRUCTOR(O3System);
1356 ;
1357 }
1358
1362 GUM_CONS_CPY(O3System);
1363 }
1364
1366 _name_(std::move(src._name_)), _instances_(std::move(src._instances_)),
1367 _assigments_(std::move(src._assigments_)), _increments_(std::move(src._increments_)) {
1368 GUM_CONS_MOV(O3System);
1369 }
1370
1372 GUM_DESTRUCTOR(O3System);
1373 ;
1374 }
1375
1377 if (this == &src) { return *this; }
1378 _name_ = src._name_;
1382 return *this;
1383 }
1384
1386 if (this == &src) { return *this; }
1387 _name_ = std::move(src._name_);
1388 _instances_ = std::move(src._instances_);
1389 _assigments_ = std::move(src._assigments_);
1390 _increments_ = std::move(src._increments_);
1391 return *this;
1392 }
1393
1394 const O3Label& O3System::name() const { return _name_; }
1395
1397
1399
1401
1403
1405
1407
1409
1410 std::ostream& operator<<(std::ostream& o, const O3Label& src) {
1411 o << src.label();
1412 return o;
1413 }
1414
1418
1423
1425 _name_(std::move(src._name_)), _value_(std::move(src._value_)),
1426 _isInteger_(std::move(src._isInteger_)) {
1427 GUM_CONS_MOV(O3InstanceParameter);
1428 }
1429
1431
1433 if (this == &src) { return *this; }
1434 _name_ = src._name_;
1435 _value_ = src._value_;
1437 return *this;
1438 }
1439
1441 if (this == &src) { return *this; }
1442 _name_ = std::move(src._name_);
1443 _value_ = std::move(src._value_);
1444 _isInteger_ = std::move(src._isInteger_);
1445 return *this;
1446 }
1447
1448 const O3Label& O3InstanceParameter::name() const { return _name_; }
1449
1451
1452 const O3Float& O3InstanceParameter::value() const { return _value_; }
1453
1455
1457
1459
1461 GUM_CONSTRUCTOR(O3Import);
1462 ;
1463 }
1464
1466 GUM_CONSTRUCTOR(O3Import);
1467 }
1468
1470 GUM_CONS_MOV(O3Import);
1471 }
1472
1474 GUM_DESTRUCTOR(O3Import);
1475 ;
1476 }
1477
1479 if (this == &src) { return *this; }
1480 _import_ = src._import_;
1481 return *this;
1482 }
1483
1485 if (this == &src) { return *this; }
1486 _import_ = std::move(src._import_);
1487 return *this;
1488 }
1489
1490 const O3Label& O3Import::import() const { return _import_; }
1491
1493
1494 } // namespace o3prm
1495 } // namespace prm
1496} // namespace gum
Headers for the AST of the O3PRM language.
Evaluates a string as a algebraic formula.
Definition formula.h:293
O3LabelList & parameters()
Definition O3prm.cpp:1162
O3Aggregate & operator=(const O3Aggregate &src)
Definition O3prm.cpp:1126
O3LabelList & parents()
Definition O3prm.cpp:1158
std::vector< O3Label > O3LabelList
Definition O3prm.h:602
O3Assignment & operator=(const O3Assignment &src)
Definition O3prm.cpp:1191
virtual O3Label & type()
Definition O3prm.cpp:743
virtual O3Attribute & operator=(const O3Attribute &src)
Definition O3prm.cpp:727
virtual O3Label & name()
Definition O3prm.cpp:747
std::vector< O3Label > O3LabelList
Definition O3prm.h:490
virtual O3LabelList & parents()
Definition O3prm.cpp:751
The O3Class is part of the AST of the O3PRM language.
Definition O3prm.h:642
O3ParameterList & parameters()
Definition O3prm.cpp:970
std::vector< std::unique_ptr< O3Attribute > > O3AttributeList
Definition O3prm.h:647
std::unique_ptr< O3ParameterList > _params_
Definition O3prm.h:687
std::vector< O3Aggregate > O3AggregateList
Definition O3prm.h:648
O3Position & position()
Definition O3prm.cpp:954
std::vector< O3Label > O3LabelList
Definition O3prm.h:644
std::vector< O3Parameter > O3ParameterList
Definition O3prm.h:645
std::unique_ptr< O3ReferenceSlotList > _refs_
Definition O3prm.h:688
O3AggregateList & aggregates()
Definition O3prm.cpp:980
O3LabelList & interfaces()
Definition O3prm.cpp:966
std::unique_ptr< O3AttributeList > _attrs_
Definition O3prm.h:689
std::unique_ptr< O3LabelList > _interfaces_
Definition O3prm.h:686
std::unique_ptr< O3AggregateList > _aggs_
Definition O3prm.h:690
O3ReferenceSlotList & referenceSlots()
Definition O3prm.cpp:974
O3Label & superLabel()
Definition O3prm.cpp:962
O3Class & operator=(const O3Class &src)
Definition O3prm.cpp:913
std::vector< O3ReferenceSlot > O3ReferenceSlotList
Definition O3prm.h:646
O3AttributeList & attributes()
Definition O3prm.cpp:976
The O3Float is part of the AST of the O3PRM language.
Definition O3prm.h:136
O3Position & position()
Definition O3prm.cpp:191
O3Float & operator=(const O3Float &src)
Definition O3prm.cpp:175
std::unique_ptr< Formula > _formula_
Definition O3prm.h:126
O3Formula & operator=(const O3Formula &src)
Definition O3prm.cpp:221
O3Position & position()
Definition O3prm.cpp:237
The O3Import is part of the AST of the O3PRM language.
Definition O3prm.h:891
O3Import & operator=(const O3Import &src)
Definition O3prm.cpp:1478
O3Increment & operator=(const O3Increment &src)
Definition O3prm.cpp:1256
O3InstanceParameter & operator=(const O3InstanceParameter &src)
Definition O3prm.cpp:1432
O3InstanceParameterList _parameters_
Definition O3prm.h:841
O3Instance & operator=(const O3Instance &src)
Definition O3prm.cpp:1318
O3InstanceParameterList & parameters()
Definition O3prm.cpp:1352
std::vector< O3InstanceParameter > O3InstanceParameterList
Definition O3prm.h:815
The O3IntType is part of the AST of the O3PRM language.
Definition O3prm.h:268
O3IntType & operator=(const O3IntType &src)
Definition O3prm.cpp:374
O3Position & position()
Definition O3prm.cpp:406
The O3Integer is part of the AST of the O3PRM language.
Definition O3prm.h:165
O3Integer & operator=(const O3Integer &src)
Definition O3prm.cpp:130
O3Position & position()
Definition O3prm.cpp:146
O3InterfaceElement & operator=(const O3InterfaceElement &src)
Definition O3prm.cpp:614
The O3Interface is part of the AST of the O3PRM language.
Definition O3prm.h:377
std::vector< O3InterfaceElement > O3InterfaceElementList
Definition O3prm.h:379
O3Interface & operator=(const O3Interface &src)
Definition O3prm.cpp:664
std::unique_ptr< O3InterfaceElementList > _elts_
Definition O3prm.h:405
O3Position & position()
Definition O3prm.cpp:683
O3InterfaceElementList & elements()
Definition O3prm.cpp:695
The O3Label is part of the AST of the O3PRM language.
Definition O3prm.h:194
std::string _label_
Definition O3prm.h:213
O3Label & operator=(const O3Label &src)
Definition O3prm.cpp:266
std::string & label()
Definition O3prm.cpp:286
O3Position & position()
Definition O3prm.cpp:282
O3SystemList _systems_
Definition O3prm.h:960
O3ImportList _imports_
Definition O3prm.h:961
std::vector< std::unique_ptr< O3Type > > O3TypeList
Definition O3prm.h:917
std::vector< std::unique_ptr< O3Interface > > O3InterfaceList
Definition O3prm.h:920
std::vector< std::unique_ptr< O3IntType > > O3IntTypeList
Definition O3prm.h:918
O3PRM & operator=(const O3PRM &src)
Definition O3prm.cpp:524
O3ClassList _classes_
Definition O3prm.h:959
O3ImportList & imports()
Definition O3prm.cpp:586
O3TypeList & types()
Definition O3prm.cpp:562
O3RealTypeList _real_types_
Definition O3prm.h:957
O3InterfaceList _interfaces_
Definition O3prm.h:958
std::vector< std::unique_ptr< O3RealType > > O3RealTypeList
Definition O3prm.h:919
O3ClassList & classes()
Definition O3prm.cpp:578
O3InterfaceList & interfaces()
Definition O3prm.cpp:574
O3RealTypeList & real_types()
Definition O3prm.cpp:570
std::vector< std::unique_ptr< O3Class > > O3ClassList
Definition O3prm.h:921
std::vector< std::unique_ptr< O3System > > O3SystemList
Definition O3prm.h:922
O3IntTypeList _int_types_
Definition O3prm.h:956
O3TypeList _types_
Definition O3prm.h:955
std::vector< std::unique_ptr< O3Import > > O3ImportList
Definition O3prm.h:923
O3SystemList & systems()
Definition O3prm.cpp:582
O3IntTypeList & int_types()
Definition O3prm.cpp:566
O3Parameter & operator=(const O3Parameter &src)
Definition O3prm.cpp:1015
The O3Position is part of the AST of the O3PRM language.
Definition O3prm.h:74
std::string & file()
Definition O3prm.cpp:95
O3Position & operator=(const O3Position &src)
Definition O3prm.cpp:79
virtual O3FormulaList & values()
Definition O3prm.cpp:798
std::unique_ptr< O3FormulaList > _values_
Definition O3prm.h:551
std::vector< O3Formula > O3FormulaList
Definition O3prm.h:527
std::unique_ptr< O3Attribute > copy() const override
Definition O3prm.cpp:802
virtual O3RawCPT & operator=(const O3RawCPT &src)
Definition O3prm.cpp:783
The O3RealType is part of the AST of the O3PRM language.
Definition O3prm.h:308
std::vector< O3Float > _values_
Definition O3prm.h:333
O3Position & position()
Definition O3prm.cpp:455
O3RealType & operator=(const O3RealType &src)
Definition O3prm.cpp:435
std::vector< O3Float > & values()
Definition O3prm.cpp:463
O3ReferenceSlot & operator=(const O3ReferenceSlot &src)
Definition O3prm.cpp:1075
std::unique_ptr< O3Attribute > copy() const override
Definition O3prm.cpp:854
virtual O3RuleCPT & operator=(const O3RuleCPT &src)
Definition O3prm.cpp:834
virtual O3RuleList & rules()
Definition O3prm.cpp:850
std::vector< O3Rule > O3RuleList
Definition O3prm.h:566
std::unique_ptr< O3RuleList > _rules_
Definition O3prm.h:590
The O3System is part of the AST of the O3PRM language.
Definition O3prm.h:851
std::vector< O3Increment > O3IncrementList
Definition O3prm.h:855
O3AssignmentList & assignments()
Definition O3prm.cpp:1404
O3AssignmentList _assigments_
Definition O3prm.h:880
std::vector< O3Instance > O3InstanceList
Definition O3prm.h:853
O3InstanceList & instances()
Definition O3prm.cpp:1400
O3System & operator=(const O3System &src)
Definition O3prm.cpp:1376
O3IncrementList & increments()
Definition O3prm.cpp:1408
O3InstanceList _instances_
Definition O3prm.h:879
O3IncrementList _increments_
Definition O3prm.h:881
std::vector< O3Assignment > O3AssignmentList
Definition O3prm.h:854
The O3Type is part of the AST of the O3PRM language.
Definition O3prm.h:225
O3Label & superLabel()
Definition O3prm.cpp:335
O3Type & operator=(const O3Type &src)
Definition O3prm.cpp:311
O3Position & position()
Definition O3prm.cpp:343
std::pair< O3Label, O3Label > LabelPair
Definition O3prm.h:227
std::vector< LabelPair > LabelMap
Definition O3prm.h:228
bool & o3prm_deprecated()
Definition O3prm.cpp:347
LabelMap & labels()
Definition O3prm.cpp:339
std::ostream & operator<<(std::ostream &o, const O3Label &src)
Definition O3prm.cpp:1410
namespace for all probabilistic relational models entities
Definition agrum.h:68
gum is the global namespace for all aGrUM entities
Definition agrum.h:46
STL namespace.