Replies: 2 comments
-
To initialize a var currentState frontend.Variable = 0 That said, it is not possible to convert from x := api.Mul(c.X, c.Y)
api.AssertIsEqual(x, c.N) gets turned into
for which there are many valid solutions If you want to use lookups, then use Mux etc. |
Beta Was this translation helpful? Give feedback.
-
I'm also converting this issue as discussion as it is general question about gnark usage. We use issues for tracking bugs and feature development. |
Beta Was this translation helpful? Give feedback.
-
Description
I am trying to develop zk-regex with lookup table. But for now I am just trying to create one example circuit. I will make it more generic in the future. But I have problem with usage of currentState. I cannot use frontend variable in if condition so I need to use api.Select to adopt it. But in this case my currentState is only updated when charMatch satisfied but I cannot update it directly because it can be updated only with api.Select so I need to convert currentState from
currentState := 0
tocurrentStateVar := api.Add(0, 0)
but in this case I cannot use currentState for tranversing in my lookup because it is frontend variable right now such asc.LookupTable[currentStateVar][j][0]
. How can I solve this issue your help will be very appreciated. And this my test circuit and its code.Beta Was this translation helpful? Give feedback.
All reactions