Depth-Bounded Inference for Nonterminating Prologs