Linker
A linker is used to turn an AIR tree into a single PIL file. The linking process operates in the following way:
- Create an empty PIL file
- Start from the main AIR. If it defines a degree, let
main_degree
be that value. If it does not, letmain_degree
be1024
. - For each AIR
- Create a new namespace in the PIL file
- If a degree is defined, check that it equals
main_degree
and error out if it does not. If no degree is defined, set the degree tomain_degree
- Add the constraints to the namespace
- Turn the links into lookups and add them to the namespace
The result is a monolithic AIR where:
- each machine instance is a namespace
- all namespaces have the same degree
- links between instances are encoded as lookup identities
More flexible approaches to the linking process will be explored in the future, such as allowing for machine instances of different degrees.