|
|
|
The Daikon
implementation is designed to be simple, basic, and language-independent, to
reduce errors and increase robustness.
As a result, Daikon has no access to run-time types, and in fact the
only types seen by the engine are integers, strings, and sequences, for
predeclared variables.
|
|
The decision about
what fields to output is made statically, based on what fields the object is
known to contain.
|
|
The essential idea
is to rewrite the program with stricter (and more accurate) types. We determine those stricter types by doing
a dynamic analysis, of course!
|
|
[The feedback
mechanism isn’t completely automatic. The annotation is currently done by
hand -- and intentionally so. When the
output may be inaccurate, I choose to put a human in the loop.]
|
|
Slide used to say
“Annotate with refined type discovered by pass 1”.
|
|
Pass 2: front end reads source comments, proceeds
under the assumption that the object is actually of the specified type.
|
|
Sound for
deterministic programs: the attempted
type downcast (the attempt to access a specific field) will never fail.
|
|
But Daikon traps any
such errors that occur anyway.
|