What is the adjective given to a mathematical operation/expression on a variable whose new value can only be described in terms of that variable's existing value? Sequential operation?
- Example: i = i + 1
- Counter-example: i = 3 + 1
I don't know if what I call a "sequential operation" is semantically opposite to "idempotent" operation/expression but it does seem like it (e.g. the counter-example shown doesn't change value depending on how often you execute it).
Why I'm asking I'm trying to distinguish between functions in my computer program where you need to read the existing value into memory before you can compute the value from those that can be expressed as simple literals. I need to state in my design document that my program must support both cases, and I want to use the mathematically correct term for it. (note it doesn't need to be numerical, it could be string concatenation vs string overwriting).
"Idempotent" means that repeating the operation doesn't change the outcome. That doesn't mean that it doesn't do changes. I.e., asignment is idempotent (asign 10 five times in a row, the result will always be 10); increment isn't (doing
i++once or twice in C gives different results). Perhaps you mean it has no side effects, or is a "pure" function (each time you call it with the same arguments, the value returned is the same)? Note that e.g. $\sin x$ is pure in this sense (each time you ask for $\sin 1$ you'll get the same result), functions likeprintf(3)ormalloc(3)in C aren't.