Global corrections
. Considering the program as a whole find a correct "nearby" program
. Nearness may be measured using certain metric
. PL/C compiler implemented this scheme: anything could be compiled!
. It is complicated and not a very good idea!
Ideally, we would like a compiler to make as few changes as possible in processing the incorrect input string. There are algorithms for choosing a minimal sequence of changes to obtain globally least-cost correction. Given an incorrect input string x and a grammar G, these algorithms will find a parse tree for a related string y such that the number of insertions, deletions, and changes of tokens required to transform x into y is as small as possible. Unfortunately, these methods are in general too costly to implement in terms of time and space, so these techniques are currently only of theoretical interest