The conversation between human and AI assistant.
What do you mean by a loop invariant?
Can you give me an example?
Let's say you have a loop that adds up the values of an array. A loop invariant in this case would be that the sum of the values up to the current iteration is equal to the sum of all the values in the array.