Defining indices and constraints.