0xMiden / 0xMiden/air-script

modularity for boundary constraints

Đang mở
#240 1 bình luận 2 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Rust
Star
96
Fork
39
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

```
use system::system_constraints
use decoder::decoder_constraints
use stack::stack_constraints
use range::range_checker_constraints
use chiplets::chiplet_constraints

def MidenVmAir

# --- Declarations --------------------------------------------------------------------------------

trace_columns:
main: [system_cols[2], decoder_cols[23], stack_cols[19], range_cols[4], chiplet_cols[18]]
aux: [decoder_tables[3], stack_table, range_table, range_bus, chiplets_table, chiplets_bus]

public_inputs:
program_hash: [4]
stack_inputs: [16]
stack_outputs: [16]

# --- Constraints ---------------------------------------------------------------------------------

boundary_constraints:
# enforce the system boundary constraints on the system trace columns (2 constraints)
# enforce the decoder boundary constraints on the decoder trace columns
# enforce the stack boundary constraints on the stack trace columns (34 constraints)
# enforce the range checker boundary constraints on the range checker trace columns
# enforce the boundary constraints for the hasher, bitwise, and memory chiplets

integrity_constraints:
# enforce the system constraints on the system trace columns
enf system_constraints([system_cols])

# enforce the decoder constraints on the decoder trace columns
enf decoder_constraints([decoder_cols], [decoder_tables])

# enforce the stack constraints on the stack trace columns
enf stack_constraints([stack_cols], [stack_table])

# enforce the range checker constraints on the range checker trace columns
enf range_checker_constraints([range_cols], [range_table, range_bus])

# enforce the constraints for the hasher, bitwise, and memory chiplets on the chiplets columns
enf chiplet_constraints([chiplet_cols], [chiplets_table, chiplets_bus])
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.