Video 6 of 53 · 4:40 · Foundations and representations
A filled grid and a shared program
In this video
Caption transcript
Show transcript
This overview explains the distinction between an explicit dense CM and the shared computation graph stored by CM-IR.
Building a program and materializing all its outputs incur different costs and satisfy different requests.
The program for A and B, then or C, stores operations that can be applied to a request.
Calling the first result S makes the dependency explicit.
The program is like a recipe: it explains how to obtain an output
from the current ingredients.
For input one one zero, evaluate S first and then combine it with C.
Both operations yield one.
This execution produces one answer for one request; the other seven assignments have not
been delivered simply because the program exists.
A complete explicit representation stores all eight answers in a declared layout.
In zero-first order, the outputs are zero, one, zero, one, zero, one, one, one.
This is the filled answer sheet, whereas the program is a reusable way
to calculate those entries.
An explicit CM stores a dense row-column truth layout.
CM-IR stores a canonicalized shared computation graph.
Building that graph and materializing all outputs are separate operations.
F takes the exclusive-or of two results: A AND B, and C OR D.
The AND node and the OR node feed their results into the final exclusive-or node.
Trace 1011 through them: zero and one give one.
Separately declare ascending AB rows and CD columns.
That output of one belongs at row index two, column index three.
Evaluating the other assignments fills the remaining cells.
The grid is 0111 in each of its first three rows, and 1000 in its last row.
The graph and grid describe the same function but store different artifacts.
A graph evaluation path may produce packed or reduced output under its API contract.
A kernel measurement does not automatically include graph construction, dense materialization or the public wrapper.
Return to the opening three-input recipe: S equals A and B, and F equals S or C.
This is separate from the intervening larger program.
A, B and C are Boolean inputs.
Set them to zero, one and zero respectively.
The first and combines zero with one and returns zero.
The final or combines that zero with C zero and also returns zero.
The program structure is unchanged from the earlier input that returned one.
Reusing a recipe therefore does not imply reusing its previous answer.
This case establishes a specific contrast.
Same compiled recipe.
Different input and different output.
Keep the input, intermediate values, and conclusion together when comparing it with the previous case.
The calculated answer belongs to this complete assignment under the stated rule.
If the caller needs only input one zero zero, the required answer is zero.
Constructing a full table may do work the caller did not request.
Whether that construction later pays off depends on the actual reuse and costs.
If the caller requests the full vector, every output must be supplied.
A compact intermediate program does not discharge that obligation by itself.
It must be executed or otherwise used to obtain all required answers.
For repeated requests, the two representations save different work.
Reusing a program can avoid rebuilding its structure; retaining a full
table can support lookup.
The useful comparison specifies residency, input changes, and delivery rather than
assuming that either form is universally better.
Keep the program representation distinct from the filled grid.
Charge materialization when the caller requires every output.

