  For a certain class of functions, the distribution of the function values can
be calculated in the trellis or a sub-trellis. The forward/backward recursion
known from the BCJR algorithm is generalized to compute the moments of these
distributions. In analogy to the symbol probabilities, by introducing a
constraint at a certain depth in the trellis we obtain symbol moments. These
moments are required for an efficient implementation of the discriminated
belief propagation algorithm in [2], and can furthermore be utilized to compute
conditional entropies in the trellis.
  The moment computation algorithm has the same asymptotic complexity as the
BCJR algorithm. It is applicable to any commutative semi-ring, thus actually
providing a generalization of the Viterbi algorithm.
