Invariant (computer science)

   

In computer science, optimising compilers and the methodology of design by contract 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 a loop that should be satisfied by every iteration of the loop.

A class invariant is a constraint on the state of an object that should be satisfied by every method of the class.


Retrieved from "http://www.mywiseowl.com/articles/Invariant_%28computer_science%29"

This page has been accessed 124 times. This page was last modified 00:07, 17 Nov 2004. All text is available under the terms of the GNU Free Documentation License (see Copyrights for details).