The envisioned technology is applicable to both safe and unsafe languages, but we will initially concentrate on the former because they have a rigorous, compiler-independent semantics that is amenable to analysis. Safe languages like Scheme and ML have rigorous semantic definitions and safe implementations. Safe behavior is an essential property of reliable software, but it is not sufficient .
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. At each application where the invariants do not imply the preconditions, the analysis highlights the site indicating that the preconditions are unproven and will be checked at run-time, potentially aborting program execution. Although our main concern is static program debugging and validation, our smart environments will also perform some important code optimizations.