Flexible Pattern Discovery with (Extended) Disjunctive Logic Programming