Extensions of the Boole--Frechet inequalities give sharp bounds for the probabilities of compound events, particularly when only the probabilities of atomic events (that make up the compound events) are known. We present a constructive approach to obtaining generalized Boole--Frechet bounds using dynamic programming.