Safe languages defer checking the preconditions of many program operations until run-time. When a run-time check fails, program execution is aborted with an explanatory diagnostic. Hence, good programmers try to ensure that misapplications are impossible by mentally analyzing what form of data can appear as input to each primitive operation. Unfortunately, programmers are not very good at this task and frequently make mistakes, leaving bugs in their code. Although our main concern is static program debugging and validation, our smart environments will also perform some important code optimizations.
Every precondition proven by the analysis eliminates a run-time check from the generated code.
The same information can be used to optimize data representations.