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 constants. The syntax was defined by @bobbinth in the original Constraints Description Language discussion here. Taken directly from @bobbinth's original post:
Constants could be of the following three types:
scalars
vectors
matrices
The constants should be declared in a separate section.
Declaring constants could be done like so:
constants:
a: 123 // a scalar constant
b: [1, 2, 3] // a vector constant
c: [
[1, 2, 3],
[4, 5, 6],
] // a matrix constant
Referring to vector constants inside expressions could be done with index notation:
let x = b[1]
let y = c[0][2]
Something like this could also be possible:
let x = c[1][1..3] // this sets x to [5, 6]
Other open suggestions by @grjte and @bobbinth to easily distinguish between trace columns and constants:
Use CAPITALS for constant names. If we do this, we should decide if we want to show an error to the user or a warning to use correct convention.
Another option is to prefix trace columns with a some special symbol.
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 need to add a check for mismatch in the number of columns in rows in a matrix to the IR and throw an error if they are unequal. For eg, the following should throw an error:
We should add support for constants. The syntax was defined by @bobbinth in the original Constraints Description Language discussion here. Taken directly from @bobbinth's original post:
Constants could be of the following three types:
The constants should be declared in a separate section.
Declaring constants could be done like so:
Referring to vector constants inside expressions could be done with index notation:
Something like this could also be possible:
Other open suggestions by @grjte and @bobbinth to easily distinguish between trace columns and constants:
This task involves making changes to the parser, IR and codegen.
The text was updated successfully, but these errors were encountered: