Reputation: 29
this is the math formulation that I'm trying to recreate in Z3 SMT solver with python. My problem accrues on f_x_i
x = [Int(f"x{i}") for i in range(n)]
for i in range(0, n):
constraints.append(And(x[i] >= 0, x[i] <= m))
constraints.append(f_values[x[i]] >= e_values[i])
this the code that I'm trying to run and this is the error that I get:
onstraints.append(f_values[x[i]] >= e_values[i])
~~~~~~~~^^^^^^
TypeError: list indices must be integers or slices, not ArithRef
How can I get the value of x[i] and use it as an index?
Upvotes: 0
Views: 26