Languages for constrained binary segmentation based on maximum a posteriori probability labeling