Skip to main content

Module fibonacci

Module fibonacci 

Source
Expand description

Fibonacci AIR: a concrete example of the Air trait.

Proves correct computation of the Fibonacci sequence. The trace has 2 columns (a, b) and 2 transition constraints:

  • next_a - current_b = 0
  • next_b - current_a - current_b = 0

Given initial values (a_0, b_0), the trace computes:

Rowab
0a_0b_0
1b_0a_0 + b_0
2a_0 + b_0a_0 + 2*b_0

Structs§

FibonacciAir
The Fibonacci AIR.
FibonacciInput
Input to the Fibonacci AIR: initial values and step count.
StepCount
Number of computation steps (rows = steps + 1).