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.
| Property | Value |
| dbpprop:abstract
|
- 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.
- Die Vorbedingung einer Funktion oder eines Programms gibt an, unter welchen Bedingungen das Verhalten der Funktion definiert ist. Die Vorbedingung ist Teil der formalen Spezifikation der Funktion (bzw. des Programms) und dient der Verifikation: Wenn sie gilt, so müssen nach Ausführung der Funktion alle Nachbedingungen erfüllt sein, sonst ist das Programm nicht korrekt. Das Konzept von Vor- und Nachbedingungen wird vor allem in der formalen Semantik benutzt: es stellt die Basis der axiomatischen Semantik dar. Das Ziel ist es dabei, aus den Vor- und Nachbedingungen der einzelnen Teile des Programms logisch die gewünschte Nachbedingung für das gesamte Programm zu folgern.
- Una precondición es una condición que ha de satisfacerse justo antes del comienzo de la ejecución de una porción de código (normalmente un subprograma o método). Por ejemplo: el factorial de un número sólo está definido para valores positivos (o cero). Por tanto, un subprograma que calcule el factorial de un número exigirá que dicho número sea mayor o igual que cero. Existen lenguajes de programación que incorporan construcciones sintácticas para reflejar las precondiciones de sus subprogramas o métodos. El cálculo del factorial en el lenguaje Eiffel, por ejemplo, quedaría así: factorial: INTEGER -- Calcula el factorial de un número. No está definido para cantidades negativas. require no_negativo: n >= 0 do if n = 0 then Result := 1 else Result := n * factorial(n - 1) end end En donde la palabra require introduce la precondición del método factorial.
- Передумо́ва — в програмуванні та формальних методах, передумовою виконання функції є правило, яке визначає, за яких умов функція матиме визначену поведінку. Передумова є частиною формальної специфікації і використовується для верифікації програм: в разі виконання передумов, мусять, відповідно, виконуватись і всі післяумови, в іншому випадку, функція не коректна. Концепція перед- та після умов використовується в формальній семантиці для створення основ для аксиоматичної семантики. Кінцевою метою є доведення правильності програми, виходячи із доведення правильності кожної окремої функції відповідно до її перед- та після- умов.
|
| dbpprop:hasPhotoCollection
| |
| rdfs:comment
|
- 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.
- Die Vorbedingung einer Funktion oder eines Programms gibt an, unter welchen Bedingungen das Verhalten der Funktion definiert ist. Die Vorbedingung ist Teil der formalen Spezifikation der Funktion (bzw. des Programms) und dient der Verifikation: Wenn sie gilt, so müssen nach Ausführung der Funktion alle Nachbedingungen erfüllt sein, sonst ist das Programm nicht korrekt.
- Una precondición es una condición que ha de satisfacerse justo antes del comienzo de la ejecución de una porción de código (normalmente un subprograma o método). Por ejemplo: el factorial de un número sólo está definido para valores positivos (o cero). Por tanto, un subprograma que calcule el factorial de un número exigirá que dicho número sea mayor o igual que cero.
- Передумо́ва — в програмуванні та формальних методах, передумовою виконання функції є правило, яке визначає, за яких умов функція матиме визначену поведінку.
|
| rdfs:label
|
- Precondition
- Vorbedingung (Informatik)
- Precondición
- Передумова (формальні методи)
|
| owl:sameAs
| |
| skos:subject
| |
| foaf:page
| |
| is dbpprop:redirect
of | |