Invariant (computer science) |
In computer science, optimising compilers, the methodology of design by contract and formal methods pay close attention to invariant quantities in computer programs, where the set of transformations involved is the execution of the steps of the computer program.
A loop invariant is a constraint on the input to an iterative loop (e.g., a while loop) that should be satisfied by every Iteration of the loop.
A class invariant is a constraint on the state of an object (computer science) that should be satisfied by every method (computer science) of the class (computer science).
Const correctness is another form of invariance in computer science.|
|