diff --git a/class_diagram.gaphor b/class_diagram.gaphor
new file mode 100644
index 0000000..80e0db2
--- /dev/null
+++ b/class_diagram.gaphor
@@ -0,0 +1,1762 @@
+
+
+
+
+
+Nouveau modèle
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+principal
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+New diagram
+
+
+
+
+powerset_function
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 113.0, 114.0)
+
+
+154.0
+
+
+66.0
+
+
+
+
+
+
+
+
+
+
+powerset_btree
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 306.0, 122.0)
+
+
+139.0
+
+
+54.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+(1.0, 0.0, 0.0, 1.0, 104.0, 111.0)
+
+
+[(163.0, 36.0), (202.0, 36.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+mobius_transform
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 17.0, 395.0)
+
+
+152.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 168.0, 414.0)
+
+
+[(-75.0, -19.0), (-8.0, -234.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+zeta_transform
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 211.5, 286.0)
+
+
+268.0
+
+
+151.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 295.0, 317.0)
+
+
+[(50.5, -31.0), (-59.0, -137.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+scheme_type_t
+
+
+
+
+
+
+
+1
+
+
+order_relation_t
+
+
+
+
+
+
+
+iota_sequence
+
+
+
+
+
+
+
+original_mobius_transform
+
+
+
+
+
+
+
+original_operation
+
+
+
+
+
+
+
+definition
+
+
+
+
+
+
+
+ordered_cardinalities_in_definition
+
+
+
+
+
+
+
+
+
+mass
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 7.0, 614.0)
+
+
+100.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 116.0, 520.0)
+
+
+[(-59.0, 94.0), (-59.0, -75.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+commonality
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 358.0, 501.0)
+
+
+111.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 388.0, 500.0)
+
+
+[(25.5, 1.0), (25.5, -63.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+decomposition_weight
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 86.0, 694.0)
+
+
+186.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 194.0, 558.0)
+
+
+[(-61.0, 136.0), (-61.0, -113.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+conjunctive_weight
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 179.0, 820.0)
+
+
+160.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 265.0, 784.0)
+
+
+[(-6.0, 36.0), (-41.0, -40.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+disjunctive_weight
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 7.0, 820.0)
+
+
+155.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 131.0, 767.0)
+
+
+[(-50.0, 53.0), (2.0, -23.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+implicability
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 228.0, 501.0)
+
+
+106.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 288.0, 499.0)
+
+
+[(-7.0, 2.0), (-7.0, -62.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+belief
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 172.0, 614.0)
+
+
+100.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 367.0, 640.0)
+
+
+[(-145.0, -26.0), (-108.0, -89.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+plausibility
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 284.0, 614.0)
+
+
+100.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 364.0, 600.0)
+
+
+[(-30.0, 14.0), (-53.0, -49.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+mobius_inversion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 892.0, 217.0)
+
+
+146.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+zeta_multiplicative_down_inclusion
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 1090.0, 379.0)
+
+
+285.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+mobius_additive_down_inclusion
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 1101.0, 460.0)
+
+
+265.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+zeta_additive_down_inclusion
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 1090.0, 294.0)
+
+
+290.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+mobius_multiplicative_down_inclusion
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 1078.5, 540.0)
+
+
+310.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+zeta_additive_up_inclusion
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 568.5, 294.0)
+
+
+217.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+zeta_multiplicative_up_inclusion
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 534.5, 379.0)
+
+
+285.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+mobius_additive_up_inclusion
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 544.5, 460.0)
+
+
+265.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+mobius_multiplicative_up_inclusion
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 534.5, 540.0)
+
+
+287.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+up_inclusion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 872.0, 379.0)
+
+
+106.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+down_inclusion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 909.0, 460.0)
+
+
+129.0
+
+
+50.0
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 940.0, 270.0)
+
+
+[(-10.0, 109.0), (-10.0, -3.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 1016.0, 272.0)
+
+
+[(-13.5, 188.0), (-13.5, -5.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 843.0, 307.0)
+
+
+[(-57.5, 12.0), (29.0, 72.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 839.0, 472.0)
+
+
+[(-19.5, -68.0), (33.0, -68.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 855.0, 485.0)
+
+
+[(-45.5, 0.0), (17.0, -71.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 876.0, 534.0)
+
+
+[(-54.5, 6.0), (-4.0, -105.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 1067.0, 319.0)
+
+
+[(23.0, 25.0), (-29.0, 141.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 976.0, 534.0)
+
+
+[(114.0, -105.0), (62.0, -58.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 924.0, 572.0)
+
+
+[(177.0, -87.0), (114.0, -87.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+0
+
+
+
+
+
+(1.0, 0.0, 0.0, 1.0, 971.0, 561.0)
+
+
+[(107.5, -21.0), (67.0, -51.0)]
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/class_diagram.svg b/class_diagram.svg
new file mode 100644
index 0000000..113e977
--- /dev/null
+++ b/class_diagram.svg
@@ -0,0 +1,986 @@
+
+
diff --git a/include/conjunctive_weight.hpp b/include/conjunctive_weight.hpp
index 5eedd55..4ec614f 100644
--- a/include/conjunctive_weight.hpp
+++ b/include/conjunctive_weight.hpp
@@ -71,6 +71,9 @@ namespace efficient_DST{
if(fod){
fod->value *= A->value;
}else{
+ // if there is no fod in definition, this means that its associated value is 1.
+ // Thus, as above, nullifying A implies multiplying 1 with A->value,
+ // which translates here to inserting A->value at fod.
this->definition.insert(~std::bitset(0), A->value);
}
}
@@ -84,22 +87,18 @@ namespace efficient_DST{
static void compute_fod_value_from_definition(powerset_btree& definition){
std::bitset fod_set = 0;
- fod_set.set();
- const std::vector* >& focal_log_elements = definition.strict_subsets_of(fod_set);
+ fod_set = ~fod_set;
+ const std::vector* >& focal_log_elements = definition.elements();
T val = 1;
for (size_t i = 0; i < focal_log_elements.size(); ++i){
- val /= focal_log_elements[i]->value;
- }
- set_N_value* fod_set_N_value = definition.sub_fod_of_size(N);
- if(fod_set_N_value){
- fod_set_N_value->value = val;
- }else{
- definition.insert(fod_set, val);
+ if (focal_log_elements[i]->set != fod_set)
+ val /= focal_log_elements[i]->value;
}
+ definition.update_or_insert(fod_set, val);
}
template
- conjunctive_weight apply(const conjunctive_weight& w2) const {
+ conjunctive_weight fuse_with(const conjunctive_weight& w2) const {
const fusion_rule fusion;
return fusion(*this, w2);
}
diff --git a/include/disjunctive_weight.hpp b/include/disjunctive_weight.hpp
index 0cd7053..ef48a06 100644
--- a/include/disjunctive_weight.hpp
+++ b/include/disjunctive_weight.hpp
@@ -71,6 +71,9 @@ namespace efficient_DST{
if(emptyset){
emptyset->value *= A->value;
}else{
+ // if there is no emptyset in definition, this means that its associated value is 1.
+ // Thus, as above, nullifying A implies multiplying 1 with A->value,
+ // which translates here to inserting A->value at emptyset.
this->definition.insert(std::bitset(0), A->value);
}
}
@@ -84,21 +87,17 @@ namespace efficient_DST{
static void compute_emptyset_value_from_definition(powerset_btree& definition){
std::bitset emptyset = 0;
- const std::vector* >& focal_log_elements = definition.strict_supersets_of(emptyset);
+ const std::vector* >& focal_log_elements = definition.elements();
T val = 1;
for (size_t i = 0; i < focal_log_elements.size(); ++i){
- val /= focal_log_elements[i]->value;
- }
- set_N_value* emptyset_set_N_value = definition.sub_fod_of_size(0);
- if(emptyset_set_N_value){
- emptyset_set_N_value->value = val;
- }else{
- definition.insert(emptyset, val);
+ if (focal_log_elements[i]->set != emptyset)
+ val /= focal_log_elements[i]->value;
}
+ definition.update_or_insert(emptyset, val);
}
template
- disjunctive_weight apply(const disjunctive_weight& v2) const {
+ disjunctive_weight fuse_with(const disjunctive_weight& v2) const {
const fusion_rule fusion;
return fusion(*this, v2);
}
diff --git a/include/iota_elements.hpp b/include/iota_elements.hpp
new file mode 100644
index 0000000..918dd61
--- /dev/null
+++ b/include/iota_elements.hpp
@@ -0,0 +1,144 @@
+#ifndef EFFICIENT_DST_IOTA_ELEMENTS_HPP
+#define EFFICIENT_DST_IOTA_ELEMENTS_HPP
+
+#include
+#include
+#include