A dynamic approach to characterizing termination of general logic programs