Worse still, you're going to suffer from the Halting problem . . . you can't write a program to determine whether another program halts or not in a finite amount of time . . . and for the same reason, you can't write a program that'll determine whether some other program will eventually do something undesirable.