Logic programming exercises