A tabled Logic Programming and Deductive Database system