Open grjte opened 1 year ago
Agreed! Though I don't have a great suggestion yet and in my mind this is a "nice-to-have" to tackle later.
One note about the above example: some components may require access to traces for multiple segments. For example, decoder needs to be able to access some of the stack columns (e.g., to check the top value of the stack or to truncate the depth) and system columns - so, it may look more like:
# enforce the decoder constraints on the decoder trace columns
enf decoder_constraints([system_cols, decoder_cols, stack_cols], [decoder_tables])
I think we should think through modularity for boundary constraints. Evaluator functions aren't supported for boundary constraints (at least in our current design), and whatever method we use for enforcing boundary constraints in a modular way needs to be able to make use of public inputs. Therefore, enabling evaluator functions for boundary constraints wouldn't be sufficient in itself.
The problem is demonstrated by considering how the top-level Miden VM AIR could look if we define it in a modular way, as shown below. With modularity for boundary constraints, the main AIR definition is ~50 lines and very readable. Without it, we'll have ~100+ constraints in the boundary constraints section, and it will become the main part of the file.