You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should add support for variables. The syntax was defined by @bobbinth in the original Constraints Description Language discussion here. Taken from @bobbinth's original post:
A variable is defined using a let keyword. For e.g., let a = b * c
Variables could be of the following three types:
scalars
vectors
matrices
Declaring variables could be done like so:
trace_columns:
main: [a, b, c]
transition_constraints:
let x = a + 123 // a scalar variable
let y = [a + 1, b + 2, c + 3] // a vector variable
let z = [
[a + 1, b + 2, c + 3],
[a + 4, b + 5, c + 6],
] // a matrix variable
Referring to vector variables inside expressions could be done with index notation:
let a = [m, n]
let x = a[0] + 1
We could build variables from column references as well:
trace_columns:
main: [a, b]
let x = [a, b] // x is a vector with current values from a and b
let y = [a', b'] // y is a vector with next values from a and b
Variables should only be defined in boundary_constraints and transition_constraints sections.
This task involves making changes to the parser, IR and codegen.
parser
IR
codegen
The text was updated successfully, but these errors were encountered:
We should add support for variables. The syntax was defined by @bobbinth in the original Constraints Description Language discussion here. Taken from @bobbinth's original post:
A variable is defined using a
let
keyword. For e.g.,let a = b * c
Variables could be of the following three types:
Declaring variables could be done like so:
Referring to vector variables inside expressions could be done with index notation:
We could build variables from column references as well:
Variables should only be defined in
boundary_constraints
andtransition_constraints
sections.This task involves making changes to the parser, IR and codegen.
The text was updated successfully, but these errors were encountered: