The condition required of a starting program state for a stated correctness guarantee. In the summation loop verification, n∈Z and n≥0 admit n=0 and n=4, but exclude n=−1. The accompanying model assumes exact integer arithmetic and terminating elementary operations. The initial values of i,s need no restriction because initialization overwrites them before use.
A precondition is a logical assumption, not automatically an executable check. Writing
require in a procedure states its contract; an implementation that checks or rejects invalid inputs needs that behavior specified too. Weakening a precondition admits more starts and therefore demands more proof: dropping n≥0 here makes n=−2 a terminating counterexample to 2s=n(n+1), since initialization returns zero while n(n+1)=2. Ancestors (6)
Incoming links (116)
- Action exclusion axiom
- Action precondition axiom
- Action schema
- Algorithm correctness
- Array multiset
- Automated planning
- Behavioral subtyping
- Binary array sum by recursion
- Factorial recursion and returning frames
- Formal specification
- Forward state-space planning
- Goal regression
- Ground action
- Hoare logic
- Hoare triple
- Loop invariant
- Partial correctness
- Past exam of the computer science course of the University of Oxford / 2015 / Intelligent systems / 2 / b / Solution
- Past exam of the computer science course of the University of Oxford / 2015 / Intelligent systems / 2 / e / Solution
- Past exam of the computer science course of the University of Oxford / 2019 / Artificial intelligence / 3 / b / Solution
- Past exam of the computer science course of the University of Oxford / 2019 / Artificial intelligence / 3 / e / Solution
- Past exam of the computer science course of the University of Oxford / 2020 / Artificial intelligence / 1 / e / Solution
- Past exam of the computer science course of the University of Oxford / 2021 / Artificial intelligence / 3 / a / Solution
- Past exam of the computer science course of the University of Oxford / 2021 / Artificial intelligence / 3 / b / Solution
- Past exam of the computer science course of the University of Oxford / 2021 / Artificial intelligence / 3 / f / Solution
- Past exam of the computer science course of the University of Oxford / 2022 / Artificial intelligence / 1 / b / Solution
- Past exam of the computer science course of the University of Oxford / 2022 / Artificial intelligence / 1 / c / Solution
- Past exam of the computer science course of the University of Oxford / 2023 / Artificial intelligence / 2 / a / Solution
- Past exam of the computer science course of the University of Oxford / 2023 / Artificial intelligence / 2 / c / Solution
- Past exam of the computer science course of the University of Oxford / 2023 / Artificial intelligence / 2 / d / Solution
- Past exam of the computer science course of the University of Oxford / 2023 / Artificial intelligence / 2 / e / Solution
- Past exam of the computer science course of the University of Oxford / 2023 / Artificial intelligence / 2 / f / Solution
- Past exam of the computer science course of the University of Oxford / 2023 / Artificial intelligence / 2 / g / Solution
- Past exam of the computer science course of the University of Oxford / 2023 / Artificial intelligence / 2 / h / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2003 / Functional programming, data structures and algorithms, procedural programming, and digital hardware / 1 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2003 / Functional programming, data structures and algorithms, procedural programming, and digital hardware / 3 / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2003 / Functional programming, data structures and algorithms, procedural programming, and digital hardware / 7 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2003 / Functional programming, data structures and algorithms, procedural programming, and digital hardware / 8 / d / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2003 / Functional programming, data structures and algorithms, procedural programming, and digital hardware / 9 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2005 / Functional programming, data structures and algorithms, procedural programming, and digital hardware / 6 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2005 / Functional programming, data structures and algorithms, procedural programming, and digital hardware / 8 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2013 / Imperative programming / 1 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2013 / Imperative programming / 1 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2013 / Imperative programming / 3 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2013 / Imperative programming / 5 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2015 / Imperative programming / 1 / e / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2015 / Imperative programming / 3 / c / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2015 / Imperative programming / 3 / g / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2015 / Imperative programming / 8 / c / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2015 / Imperative programming (resit) / 1 / d / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2015 / Imperative programming (resit) / 4 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2015 / Imperative programming (resit) / 6 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2015 / Imperative programming (resit) / 8 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2016 / Imperative programming (resit) / 2 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2016 / Imperative programming (resit) / 3 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2018 / Imperative programming / 1 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2018 / Imperative programming / 2 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2018 / Imperative programming / 2 / d / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2018 / Imperative programming / 3 / c / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2018 / Imperative programming / 3 / d / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2018 / Imperative programming / 3 / e / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2018 / Imperative programming / 4 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2018 / Imperative programming / 4 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2018 / Imperative programming / 4 / d / i / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2018 / Imperative programming / 7 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming / 2 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming / 3 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming / 3 / c / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming / 3 / d / i / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming / 5 / d / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming resit / 2 / c / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming resit / 3 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming resit / 3 / e / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming resit / 3 / f / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming resit / 6 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming resit / 6 / c / i / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming resit / 7 / b / ii / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2019 / Imperative programming resit / 7 / b / i / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Functional programming, design and analysis of algorithms (resit) / 4 / d / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming / 1 / c / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming / 2 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming / 3 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming / 3 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming / 3 / c / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming / 4 / c / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming / 4 / d / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming / 5 / d / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming / 6 / c / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming (resit) / 3 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming (resit) / 3 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming (resit) / 3 / d / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming (resit) / 4 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2021 / Imperative programming (resit) / 4 / d / i / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2022 / Imperative programming (resit) / 6 / a / i / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2022 / Imperative programming (resit) / 6 / b / ii / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2022 / Imperative programming (resit) / 7 / a / ii / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2022 / Imperative programming (resit) / 7 / a / i / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2022 / Imperative programming (resit) / 8 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2022 / Imperative programming (resit) / 8 / d / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2023 / Imperative programming / 2 / d / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2023 / Imperative programming / 3 / b / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2023 / Imperative programming / 5 / a / Solution
- Past exam of the year 1 of the computer science course of the University of Oxford / 2023 / Imperative programming / 8 / d / Solution
- Plan
- Planning safety certificate
- Postcondition
- Precondition
- Precondition-free STRIPS planning
- Prefix maximum correctness example
- Sequential SATPlan correctness
- STRIPS
- Subtype polymorphism
- Summation loop verification
- Total correctness
- Type signature
- Well-founded progress in recursion
Discussion (0) New discussion
There are no discussions about this article yet.
Articles by others on the same topic (1)
A precondition is a condition or requirement that must be satisfied or fulfilled before a certain action or function can be executed or a particular scenario can take place. In programming and software development, preconditions are often used to specify the necessary state of the system or inputs required for a function or method to perform correctly. For example, in a function that calculates the square root of a number, a precondition might be that the input number must be non-negative.