Maths encyclopedia and lessons  
Search

Mathematics Encyclopedia and Lessons

 
     
 

Lessons

Popular
Subjects

algebra
arithmetic
calculus
equations
geometry
differential equations
trigonometry
number theory
probability theory
more
 

References

applied mathematics
mathematical games
mathematicians
more
 
 

Precondition

In logic a precondition is a condition that has to be met, before a main argument can have any value.

In computer programming, a precondition is a fact that must always be true just prior to the execution of some section of code. Preconditions are sometimes tested using assertions within the code itself. Often, preconditions are simply included in the documentation of the affected section of code. If a precondition is violated, the effect of the section of code becomes undefined and thus may or may not carry out its intended work. Security problems can arise due to incorrect preconditions - e.g. a section of code that has the precondition that the input is correct, when it may not be.


See also

01-04-2007 01:18:14
The contents of this article are licensed from Wikipedia.org
under the GNU Free Documentation License. How to see transparent copy