There is an entire field of static analysis that is dedicated to practically solving undecidable problems.