Logic Programming with Type Specifications