logic programming meets functional programming