Theoretical Foundations of Dynamic Program Slicing