Bounded model checking 2026-10-31
A formal verification method that encodes a bounded execution and a violated specification as a Boolean satisfiability problem. A satisfying assignment yields a counterexample. For infinite-path properties, a lasso path can finitely represent a repeated execution. Failure to find a counterexample at one finite bound alone does not prove an unbounded property.[ref]
Formal verification Created 2026-10-13 Updated 2026-10-18
Establishing specified properties of a system using formal proofs about a precise model. Formal verification connects an implementation to a formal specification; correctness of the model and its assumptions still matters when applying the result to a physical system.
For a small example, the summation loop verification below starts with executable steps and asks two separate questions: does any returned value satisfy the postcondition, and does execution reach that return? A loop invariant answers the first; a loop variant answers the second. This turns an unbounded family of permitted inputs into a few reusable proof obligations.
The model must specify programming language semantics, including the meaning of variable assignments, comparisons and integer arithmetic. A proof about exact mathematical integers need not describe a machine that wraps on integer overflow. Similarly, a correct formal proof of a weak or mistaken formal specification does not establish the intended behavior. Choosing the right formal specification and relating the model to the implemented system remain substantive tasks.
Software testing examines chosen executions and can expose a counterexample. A formal proof instead justifies a statement throughout its stated model; it does not require executing every permitted input. This makes formal verification valuable when rare boundary cases matter, while software testing can still reveal an incorrect model or misunderstood requirement.
In 1969, Tony Hoare presented rules for variable assignment, composition and iteration in a small programming language. His paper explicitly says those rules do not prove successful termination, and discusses the dependence of arithmetic reasoning on the chosen overflow behavior. These reservations already make the model's scope part of the argument.[ref]
Mathematical proof Created 2026-09-24 Updated 2026-10-14
A mathematical proof is a finite deductive argument from stated assumptions to a conclusion. It explains why the conclusion follows for every instance covered by its hypotheses. An informal mathematical proof can omit routine detail while making its assumptions and deductions clear; a formal proof expresses them in a specified formal language with specified inference rules. The distinction between assumptions, propositions, and deductions is introduced in Leighton and Rubinfeld, What is a proof?, sections 1–3.
Checking examples can suggest a pattern, but need not establish a universally quantified claim. For example, the polynomial is a prime number for every integer , as direct trial division verifies. At it equals , a composite number. Those first forty successes do not prove the claim for all natural numbers; one counterexample disproves it. The point is not to discard computation: it can find a conjecture, detect a mistake, or verify a finite exhaustive case analysis. The question is whether the cases checked cover the statement being claimed.
For a positive example, the sum of two even integers is even: writing them as and with gives , and is an integer. This direct argument handles every allowed pair at once. A useful mathematical proof therefore does more than certify an answer: it exposes the mechanism and the exact assumptions that make the answer transferable.
Denote the three families found in part (a) by , and , where . All are fair paths in a transition system. The verdicts are
Each verdict follows from the infinite path in a transition system semantics, rather than from a finite prefix alone.
For , take . From onwards, is always false, so there is no time after which is always true. Therefore the first specification fails, with fair counterexample . The path in a transition system is another fair counterexample, because it encounters , where is false, infinitely often. Each does satisfy , since satisfies forever.
For , take . Its next state is , so is true, but is false as just shown. Thus the second specification fails, with fair counterexample . Alternatively, has next state , making its antecedent true and its consequent false. For with , the next state is still , so this implication is true there because its antecedent is false; this does not rescue a universally quantified specification.
For , the fair path in a transition system reaches , where is false. Thus the third specification fails, with fair counterexample . In fact every fair initial path in a transition system reaches or , so none satisfies .
For , strong until requires an eventual position satisfying , together with at every earlier position. On , is true forever, so never holds. Thus the fourth specification fails, with fair counterexample . On each , holds until entry into , after which holds forever. On each , holds until entry into , after which holds forever. These latter paths in a transition system satisfy the strong until requirement.
For , weak until permits either the preceding strong until behavior or . Every and satisfies the strong until behavior, and satisfies . These exhaust the fair initial paths in a transition system. Therefore the fifth specification holds on every fair initial path. Allowing the left operand to continue forever is exactly what distinguishes this answer from the previous one.
For , the two next-time operators belong to the left operand of strong until. The fair path in a transition system has true at positions zero and one, then false at every position from two onwards. Therefore first holds at position two. But is false already at position zero, since is false at position two. A witness for strong until cannot occur at zero or one, where its right operand is false, or at two or later, where its left operand has already failed. Thus the sixth specification fails, with fair counterexample .
Indeed, every fair initial path in a transition system fails the sixth specification. On , the right operand never holds. On and , let be the first position of the permanent tail. The left operand is false at , strictly before any possible right-operand witness. This also checks that the two next-time operators cannot be ignored or shifted onto the whole strong until formula.
To apply bounded model checking, seek an initial path in a transition system satisfying
A satisfying assignment for its bounded encoding is enough to disprove the specification. Use a lasso path: positions follow the transition relation, and a final arrow returns from to some , . The repeated part is . On such a lasso path, is equivalent to having true at some position of the repeated part.
For this example an explicit Boolean formula for the bounded search is
Here means and means that the source diagram has the arrow ; each can be encoded by finite Boolean variables for the states. The loop requirements are the fairness assumption and the negated specification respectively. Unrolling the transition relation and adding a loop closure is the usual bounded model checking construction.[ref]
At bound , an initial self-loop would be needed. The only such choice is , whose repeated label satisfies and . It violates both loop requirements. The other initial state, , has no self-loop. Thus has no satisfying assignment.
At bound , choose
Both required arrows and exist. At , is false and hence is false, so both repeated-part requirements are true. Equivalently, the label values are and . These values give a satisfying assignment of , representing the fair counterexample . Consequently
Here the bound counts forward arrows before the returning arrow, so stores two positions and describes a two-state repeated part. There is no need for a completeness bound: the exhibited fair counterexample settles the negative answer. These satisfying assignments are checked directly; no claim of executing an external SAT solver is needed.
Solutions to the paper dated 1 June 2015.[ref] Every numbered subpart is treated. The original assertions in 2(b) and 2(c) are false: the two-bin repeated singleton-removal allocation gives exact counterexamples. Those answers explain the defect and the intended conditional calculation; 2(d) also supplies an independent, valid bound for the actual process.
There is no proof of the printed assertion: it is false for the stated expectations. The original explicitly defines as the expected remaining count, so replacing it by a deterministic upper envelope changes the problem.[ref]
Let be the actual count after rounds and . The union bound gives the valid conditional estimate
By the law of total expectation, the resulting unconditional bound is
Discarding the variance term is an expectation closure error for a nonlinear recurrence. In particular, Jensen's inequality says , which cannot justify the requested upper bound.
For an exact counterexample, start with two balls and two bins. A round serves both balls if they land separately and serves neither if they collide. Each outcome has probability , independently in successive rounds while both balls remain. Consequently
At , the requested inequality would say , but
The printed bound also fails for the actual expectations. In the two-bin counterexample from part (b), at the true value and proposed bound are
The supplied premise does hold in this example: . Thus the problem is the invalid recurrence in part (b), rather than failure of the supplied starting estimate.[ref]
The intended mathematical induction is valid conditionally on the recurrence. For a deterministic nonnegative sequence satisfying and , the base case is . If , then
This proves the proposed form for but cannot identify with .
Figure 1.
Exact two-bin survivor expectation and the invalid printed bound
. Details.
With the conventional strictly positive step costs, the five answers in printed order are false, false, true, true, true. The third answer needs that positivity convention: it is false in general if zero-cost edges and unrestricted ties are admitted. Take the goal test on selection from the search frontier, and assume a finite reachable problem with a reachable goal state; finite branching factor and a positive lower bound on step costs give the corresponding tree search guarantees on an infinite problem. These assumptions make the usual A-star search guarantees precise.[ref]
For the first assertion, use a directed graph with transitions of cost , of cost and of cost , where is the only goal state. The perfect heuristic is , , . Greedy best-first search selects the direct goal of cost because its priority is zero. The least path cost is . Knowing the exact remaining distance does not account for an expensive transition already taken.
The same counterexample settles the second assertion. Greedy best-first search selects , while A-star search selects : after expanding , the A-star search priorities are for and for the direct copy of . Thus even the expanded state sets differ.
For the third assertion, let the current nonterminal search node have finite remaining distance . The first transition of a least-cost continuation has some successor with
Every older entry in the search frontier has estimate at least , since the current entry was selected with minimum estimate. A newly generated successor with strictly smaller estimate therefore wins over every older entry. Whichever new successor is selected has smaller remaining distance than the current search node, so the argument repeats. Consequently the selected search nodes form one parent–child chain; include the selected goal, or append it if “expanded” excludes goal processing. This greedy perfect-heuristic descent does not imply least path cost, as the first counterexample demonstrates.
The zero-cost qualification is substantive. Give two successors of cost , add of cost , and add and of cost . The perfect heuristic has values at , at and at . Alphabetical priority ties let greedy best-first search select , which is not one graph path. Thus the unqualified third assertion requires a cost or tie convention absent from the printed text.
For the fourth assertion, a least remaining distance satisfies
on every edge, by taking that edge and then a least-cost continuation. Thus is a consistent heuristic. The usual A-star search graph search finalizes each expanded state's least path cost and returns a least-cost goal.
For the fifth assertion, write . Before a goal is selected, an unexpanded prefix of an optimal graph path remains on the search frontier, with . A-star search therefore selects only search nodes with . Since ,
This compares remaining cost, not search depth or accumulated path cost. The statement can fail with negative costs; those are outside the convention used here.
The usual alpha-beta pruning inference fails because increasing B's utility need not decrease A's utility. A partially explored B-node may have found a child unfavorable to A, but B may prefer an unseen child favorable to A as well. An observed low A-coordinate therefore supplies no upper bound on the A-coordinate ultimately propagated by B.
For a concrete counterexample, let a root A-node already have an alternative outcome . In another B-node, the first explored child yields . A zero-sum-style cutoff would discard its remaining children because . But an unseen child with outcome is preferred by B, and makes the complete B-node return , which A strictly prefers to its incumbent. Such a cutoff changes the answer.
The problem persists even after observing a large B-coordinate: without a known relation between coordinates or useful global utility bounds, an unseen pair may have still larger values for both players. Hence there is no generally valid ordinary scalar alpha-beta pruning rule for unrestricted general-sum games. This does not rule out all search pruning: additional bounds, dominance information or a relationship between players' utilities can justify specific cutoffs, as in (g).
No: arbitrary ties can produce an assignment that is not Pareto optimal. A two-student counterexample suffices. Give the first student value for both rooms; give the second student value for and for . If the first student breaks the tie by taking , the second must take , and the utility vector is .
Swapping the rooms gives utility vector , so it is a Pareto improvement. Both choices in the original run maximized the corresponding student's available room value. The strict-ranking argument from (a) fails because the first student's utility need not decrease when that student's room changes.
The printed assertion is false as a supremum bound uniform over shrinking bandwidths. The supplied hint proves a pointwise stochastic order with constants uniform in . Taking the supremum inside the probability changes the problem: a growing number of spatial windows produces a logarithmic cost. We first establish the valid consequence of the hint, then give a counterexample satisfying the printed assumptions.
For , let , and . The Invariant distribution of an Itô diffusion has a probability density function bounded above and bounded away from zero on the required compact interval. Choosing therefore gives constants such that , uniformly for and .
For the centered function , . Outside , . The given second-moment estimate and the Chebyshev inequality yield
On the event , the drift coefficient contributes an average whose error is at most , by Hölder continuity. The Itô isometry and stationarity give . Another use of the Chebyshev inequality proves
This also accounts for the zero-denominator convention through the first exceptional event. The bound proves pointwise , uniformly in the location's tail probabilities. It supplies no bound for the probability of a supremum over all locations.
For an explicit counterexample, take and the bounded globally Lipschitz function
It has Lipschitz constant , exponent , and satisfies the inward-drift conditions with , . The stochastic differential equation has a unique strong solution of a stochastic differential equation. Its Invariant distribution of an Itô diffusion has density
The exponent is zero on , equals when , and equals outside . This verifies integrability, positivity and a constant density on the central interval. Start the Itô diffusion in this Invariant distribution of an Itô diffusion to obtain the required stationary process.
Set and choose windows with centers , . Their intervals are disjoint and lie in , where the drift is zero. Write
Then whenever . The same occupation bound as above gives for . With , a union bound and the Chebyshev inequality imply
The quadratic variations are , and the cross quadratic covariations vanish since the windows are disjoint. Each clock tends to infinity almost surely: for any fixed window, the occupation estimate at times , followed by the Borel-Cantelli lemmas, gives . The Knight theorem for orthogonal martingales therefore represents using independent standard Brownian motions . This theorem is applied to the finite collection for each ; no growing-dimensional central limit theorem is being assumed.
On the preceding clock event, compare each time-changed Brownian motion with its value at deterministic time . The Brownian reflection principle and a union bound show that, for every fixed ,
This bound does not require the Brownian motions to be independent of their clocks. In particular, in probability. The variables are independent random variables. Their Gaussian maximum exceeds with probability tending to one: for , integration of the normal density over gives , and hence
Since on the clock event, it follows that, for some ,
But for this bandwidth. Thus the error after subtraction of and multiplication by is not bounded in probability, contradicting the printed stochastic order. The valid pointwise bound above is provable; the uniform shrinking-bandwidth assertion is not. This counterexample shows why a uniform rate needs at least a enlargement of the noise scale. If is instead held fixed and constants may depend on , this counterexample does not contradict that different interpretation.
No. Take
It contains more than one point and has the fixed-point property of a closed interval, but it is not homeomorphic to the closed unit disc. Indeed, deleting any point with disconnects , so such a point is a cut point. Deleting one point from a two-dimensional closed disc leaves a path-connected space. Since being a cut point is preserved by homeomorphisms, the two spaces cannot be homeomorphic. This gives the required counterexample.
Choose a fresh parameter . The universal quantifier elimination rule supplies both the implication and its premise at that same parameter:
1  ∀x. (P(x) → Q(x))        premise
2  | ∀x. P(x)               assumption
3  | P(a)                   ∀-elim 2
4  | P(a) → Q(a)            ∀-elim 1
5  | Q(a)                   →-elim 4,3
6  | ∀x. Q(x)               ∀-intro 5, a fresh
7  (∀x. P(x)) → (∀x. Q(x))  →-intro 2–6
The eigenvariable condition holds because is absent from both undischarged assumptions at line 6. Hence the universally quantified implication is proved.
The proposed version with merely in the antecedent is not derivable. For a counterexample, take a two-element domain with and both true precisely at zero. The universal premise holds. Under the assignment , is true but is false. By soundness, a formal proof cannot exist. Attempting the previous derivation would fail exactly at universal quantifier introduction rule: the parameter would occur in the undischarged assumption , so it would not be fresh.
Take , so but . The ratio is unbounded, precluding any eventual constant upper bound in big O notation. False: in general . This is a counterexample involving function composition, not pointwise addition.
For , choose the first elements of . Every sum of a subset has a unique binary representation, so distinct subsets cannot have the same sum. To see this directly, take the largest power of two belonging to exactly one of two proposed subsets. It exceeds the sum of all smaller powers, and therefore cannot be cancelled by their difference. Thus these chosen sets are dissociated sets and do not have the two-sum property.
If cardinality zero is included, the empty set has only one subset, so it cannot supply two distinct ones either. There is a counterexample at every cardinality from through .
Yes in special cases; an ordinary finite iterator that progresses through its input needs changing consumption state. For a genuine immutable counterexample, an iterator over an infinite constant sequence needs no changing fields:
final class Ones extends Iterator[Int] {
  def hasNext: Boolean = true
  def next(): Int = 1
}
Removing the first entry of that sequence leaves the same sequence, so this satisfies the iterator behaviour without changing object state. A permanently empty iterator is another example.
For a normal finite nonempty traversal, however, repeated next() calls must eventually change the returned entry or availability, so the implementation needs mutable cursor state somewhere. Declaring only val fields is not a proof of deep immutability: those fields can refer to another mutable iterator, an array, or a stateful closure. The standard API's description of iterators as mutable captures the usual consuming case, rather than enforcing a mutable field in every possible implementation.
For a counterexample to closure under union of antisymmetric relations, take , , and . Each is an antisymmetric relation: neither contains an off-diagonal pair together with its reverse. But contains both and while . Therefore is not an antisymmetric relation.
Use a type with distinct values a and n, and let s _ y = y. Suppose a direct right fold with the same result type represented this left fold. The empty list forces k = n. The singleton lists force c n n = n and c a n = a. But then
foldr c k [a,n] = c a (c n n) = c a n = a,
foldl s n [a,n] = n.
Since a /= n, this is a counterexample. A direct right fold cannot recover whether its tail result n came from the empty list or from the singleton [n]. The obstruction already occurs on finite total inputs, so it also rules out an implementation valid on all lazy lists.
Precondition Created 2026-10-18 Updated 2026-10-25
The condition required of a starting program state for a stated correctness guarantee. In the summation loop verification, and admit and , but exclude . The accompanying model assumes exact integer arithmetic and terminating elementary operations. The initial values of 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 here makes a terminating counterexample to , since initialization returns zero while .