Tuple Relation Calculus solver in Prolog