Skip to content

Commit

Permalink
Test next operator in macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriseth committed Oct 31, 2023
1 parent caaa62a commit 4aad1d2
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions test_data/pil/fib_macro.pil
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,13 @@ pol constant ISLAST(i) { one_hot(i, %last_row) };

// ANCHOR: constraint_macro_definitions
macro constrain_equal_expr(A, B) { A - B };
macro force_equal_on_last_row(poly, value) { ISLAST * constrain_equal_expr(poly, value) = 0; };
macro force_equal_on_first_row(poly, value) { ISLAST * constrain_equal_expr(poly', value) = 0; };
// ANCHOR_END: constraint_macro_definitions

// TODO would be easier if we could use "'" as an operator,
// then we could write a "force_equal_on_first_row" macro,
// and the macro would add a "'" to the parameter.
// ANCHOR: constraint_macro_usage
force_equal_on_last_row(x', 1);
force_equal_on_first_row(x, 1);
// ANCHOR_END: constraint_macro_usage
force_equal_on_last_row(y', 1);
force_equal_on_first_row(y, 1);

macro on_regular_row(cond) { (1 - ISLAST) * cond = 0; };

Expand Down

0 comments on commit 4aad1d2

Please sign in to comment.