The CEP library makes it simple to write a program to describe that can tell if X is followed by Y.
val pattern = Pattern.begin("start").where(_.value == "X")
.next("end).where(_.value == "Y")
But how would i describe a program where I don't care about the order of X and Y only that one follows the other. e.g X, Y and Y, X are both interesting. However, X,X or Y,Y isn't interesting, so i can't match on a third shared property.