0xMiden / 0xMiden/air-script

add new built-in $x for accessing x value at each row

オープン
#90 コメント 3 件 リアクション 2 件 担当者 0 名 GitHub で見る
on hold
主要言語
Rust
スター
96
フォーク
39
PR マージ指標
30日以内にマージされた PR はありません

説明

In order do define some constraints, we may want to be able to define lagrange polynomials directly. In such cases, the domain value that is used for interpolation is needed, so we need a shortcut for referring to this x-value at each row.

We can do this by adding a new built-in value $x that represents x at any given row.

Here's an example from @dlubarov at Polygon Zero of how this could give more flexibility in defining constraints:

```
// Boundary constraint.
a * l_0(x) = 0

// Every other row.
a * odd_row(x) = 0

def odd_row(x) = (x^(n/2) - 1)

def l_0(x) = (x^n - 1) / (x - 1)
```

Required changes:

- [ ] parser
- [ ] IR
- [ ] codegen

This adds flexibility to AirScript, but Miden VM does not need this at the moment, so we could keep updates to the miden codegen very minimal (i.e. just throw an error if this is used)

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

この課題では、パーサー、中間表現、コード生成を変更する必要があります。まず、$x のような組み込み機能が現在どのように処理されているかを理解するために、パーサーのソースコードを調べることから始めてください。値がどのように表現され伝播されるかを確認するために、中間表現を確認してください。コード生成については、$x が使用された場合に Miden VM バックエンドはエラーをスローする必要がありますが、他のバックエンドはそれをサポートする必要があります。新しい組み込み機能を追加するためのパターンを確認するために、既存の組み込み機能のテストを確認してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
rust
領域
compilers
issue の種類
機能追加
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。