ABSTRACT

The purpose of this chapter is to introduce probabilistic branching statements. We will start by describing the probabilistic “if-then-else” statement which, as in standard programming, can naturally be extended to a probabilistic “case” statement. From an inference point of view, the probabilistic if-then-else statement is simply the integration over the probability distribution on a binary variable representing the truth value of the condition used in the classical “if” statement. The main difference with the classical approach is that the Bayesian program will explore both branches when the truth value of the condition is given by a probability distribution. This allows us to mix

Let’s recall the Khepera robot (see Chapter 4) and formalize the programs to push a part or to follow its contour. The probabilistic variables Dir, Prox, and Rot, respectively, denote the direction of the nearest obstacle, its proximity, and the rotational speed of the robot (the robot is assumed to move at constant speed).