Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Precondition
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Computer programming concept}} {{about|the computer programming concept|the legal term|sine qua non|other uses|Preconditioning (disambiguation)}} {{one source|date=September 2010}} In [[computer programming]], a '''precondition''' is a condition or [[Predicate (mathematics)|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. Preconditions that are missing, insufficient, or not formally proved (or have an incorrect attempted proof), or are not checked statically or dynamically, can give rise to [[Computer security|Security]] problems, particularly in unsafe languages that are not strongly typed. Often, preconditions are simply included in the documentation of the affected section of code. Preconditions are sometimes tested using [[Guard (computer science)|guards]] or [[Assertion (computing)|assertions]] within the code itself, and some languages have specific syntactic constructions for doing so.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)