added code for generation of expression based on probability tables