Answer set programming for pattern generation in logical analysis of data