In this section, we explain how the powdr compiler reduces a program made of virtual and constrained machines to a set of AIRs.
The first step is to reduce virtual machines to constrained machines. This step is run on all machines and does not affect constrained machines. As a result of this step, for each machine:
- Local instructions are reduced to constraints
- External instructions are reduced to links
- Functions are reduced to operations
Block enforcement applies on constrained machines. It makes sure that the
operation_id is constant within each machine block.
At this point, all machines contain only:
- an optional degree
- links to other machines
Let's define AIR as a data structure with only these elements.
Starting from the main machine's type, we create a tree of AIR objects by traversing its submachines, recursively instantiating each machine as an AIR. Let's define the AIR tree as the resulting tree.