AskDefine | Define precondition

Dictionary Definition



1 an assumption on which rests the validity or effect of something else [syn: condition, stipulation]
2 an assumption that is taken for granted [syn: given, presumption]
3 a condition that is a prerequisite v : put into the required condition beforehand

User Contributed Dictionary



  1. a pre-existing requirement to take a course of action.
    A marriage licence is a precondition for a wedding.


Extensive Definition

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 condition or predicate that must always be true just prior to the execution of some section of code or before an operation in a formal specification.
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.
Often, preconditions are simply included in the documentation of the affected section of code. Preconditions are sometimes tested using assertions within the code itself, and some languages have specific syntactic constructions for doing so.
For example: the factorial is only defined for integers greater than or equal to zero. So a program that calculates the factorial of an input number would have preconditions that the number be an integer and that it be greater than or equal to zero.
precondition in German: Vorbedingung (Informatik)
precondition in Spanish: Precondición
precondition in Ukrainian: Передумова (формальні методи)
Privacy Policy, About Us, Terms and Conditions, Contact Us
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2
Material from Wikipedia, Wiktionary, Dict
Valid HTML 4.01 Strict, Valid CSS Level 2.1