Skip to content

Algorithms

Nathan Carter edited this page May 27, 2020 · 2 revisions

Whenever a client makes any of the API calls described on the Clients page, the LDE initiates the four consecutive processing steps shown in the bottom row of the figure on the Design Overview page. Naturally, the LDE begins by modifying the IT in obedience to the specific API method called. It also calls markDirty() in the modified node(s), which cascades upward, meaning that all ancestors are also marked dirty for interpretation.

Some time shortly thereafter, the LDE runs the Modification and Interpretation phases, the latter of which processes the entire IT starting at the root and recurring downward, in $\ll$ order (which therefore also respects accessibility order) by default (unless overridden by a particular subclass of IE). The initiation of these phases could happen immediately after the LDE finishes obeying the client's API calls, or the LDE might insert an artificial delay (say, 50ms, for example), so as to process the results of a few API calls with a single run of these phases, for efficiency.

The first run of the Interpretation phase creates the OT; each subsequent run replaces the previous OT with a new one. (Although the entire tree is replaced with a new one, it will often be that the new tree was created from large re-used pieces of the old tree, and only a few changes.) It might seem natural to call this process "reinterpretation," but we will not make things confusing by introducing two terms, so will just use the term "interpretation" consistently.

Upon completion of the Interpretation phase, the Scoping phase begins, and traverses the OT in $\ll$ order, computing the scopes of all implicitly and explicitly declared variables. This information is necessary for the final phase, Validation, which begins immediately after Scoping ends, and grades each step of work in the OT, in no defined order.

Each of these four processing steps--Modification, Interpretation, Scoping, and Validation--are covered in detail below, each in its own section. Because each is lengthy, we do not include them all on this page, but rather break them into their own pages:

Clone this wiki locally