In this chapter, we propose a codification of the focal elements based on a codification of Θ in order to program easily in Matlab a general belief function framework working for belief functions defined on 2Θ but also on DΘ.

Hence, in the following section we recall a short background of belief function theory. In section 3 we introduce our practical codification for a general belief function framework. In this section, we describe all the steps to fuse basic belief assignments in the order of necessity: the codification of Θ, the addition of the constraints, the codification of focal elements, the step of combination, the step of decision, if necessary the generation of a new power set: the *reduced hyper* power set DΘ
r and for the display, the decoding. We particularly investigate the step of the decision for the DSmT. In section 5 we give the major part of the Matlab codes of this framework.

## 2 Short Background Of Belief Functions Theory

In the DSmT, the mass functions m are defined by the mapping of the hyper power set DΘ onto [0, 1] with:

$$\sum_{X\in D^{\Theta}}m(X)=1,$$
$$\left({\boldsymbol{3}}\right)$$
m(X) = 1, (3)
with less terms in the sum than in the equation (3).
In the more general model, we can add constraints on some elements of
DΘ, that means that some elements can never be focal elements. Hence, if we
add the constraints that all the intersections of elements of Θ are impossible
(*i.e.* empty) we recover 2Θ. So, the constraints given by the application can
drastically reduce the number of possible focal elements and so the complexity of the framework. On the contrary of the suggestion given by the flowchart on the cover of the book [29] and the proposed codes in [15], we think that the constraints must be integrated directly in the codification of the focal elements of the mass functions as we shown in section 3. Hereunder, the hyper power
set DΘ taking into account the constraints is called the *reduced hyper power set*
and noted DΘ
r
. Hence, DΘ
rcan be DΘ, 2Θ, have a cardinality between these
two power sets or inferior to these two power sets. So the normality condition
is given by:
$$\sum_{X\in D_{r}^{\Theta}}m(X)=1.$$
m(X) = 1. (4)
Once defined the mass functions coming from numerous sources, many combination rules are possible (see [5, 31, 20, 35, 23] for recent reviews of the combination rules). The most of the combination rules are based on the conjunctive combination rule, given for mass functions defined on 2Θ by:

$$m_{c}(X)=\sum_{Y_{1}\cap\ldots\cap Y_{s}=X}\prod_{j=1}^{s}m_{j}(Y_{j}),$$
mj (Yj ), (5)
where Yj ∈ 2 Θ is the response of the source j, and mj (Yj ) the corresponding basic belief assignment. This rule is commutative, associative, not idempotent, and the major problem that try to resolve the majority of the rules is the increasing of the belief on the empty set with the number of sources and the

$$\left(5\right)$$
