0xMiden / 0xMiden/air-script

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

Aberta
#90 3 comentários 2 reações 0 responsáveis Ver no GitHub
on hold
Linguagem predominante
Rust
Estrelas
96
Forks
39
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

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)

Guia de contribuição

Abrir o guia de contribuição

Direção de pesquisa

The issue requires modifying the parser, intermediate representation, and codegen. Start by examining the parser source to understand how built-ins like $x are currently handled. Look at the IR to see how values are represented and propagated. For codegen, the Miden VM backend should throw an error if $x is used, while other backends need to support it. Check existing tests for built-ins to see the pattern for adding a new one.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
rust
Domínio
compilers
Tipo de issue
Funcionalidade
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
45/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.