Reducing nondeterminism while specializing logic programs