Maps to: Stanford CS 257 Introduction to Automated Reasoning (Winter 2026), Lecture 11 · Tue 02/10/2026 · First-order theories: arithmetic I (Hanna Lachnitt). Reading: Kroening & Strichman (DP) §5.1–5.2. Basis: The Stanford slides are on Canvas and not public. This lecture follows the public Iowa deck Theory Solvers II (CS:4980, Cesare Tinelli, Spring 2024). That deck says it is adapted from slides by Clark Barrett, Caroline Trippel and Andrew (Haoze) Wu (Stanford), with slides contributed by Guy Katz, and it covers:
- QF_LRA and linear programming;
- the simplex method in dictionary form: slack variables, pivoting, Dantzig’s rule, initialization by an auxiliary problem, degeneracy, cycling and Bland’s rule;
- the reduction of satisfiability to LP;
- a neural-network verification example.
The deck’s last slide lists “general LPs with bounds” and “infeasible subsets (theory explanations)” as improvements. §5 develops exactly those, following Dutertre and de Moura (2006), the version of simplex inside SMT solvers. “The slides” below means the Iowa deck.
These notes add:
- a module,
simplex.py: the textbook simplex with a trace, the general simplex with bounds, Farkas certificates and δ-rationals, Fourier–Motzkin elimination, and an LRA theory solver for Lecture 10’s CDCL(T);- the slides’ dictionaries reproduced pivot by pivot;
- Chvátal’s cycling example and the Klee–Minty cube;
- job-shop scheduling, and the slides’ network verified (its property fails);
- every answer certified.
The experiments and their code were designed for these notes and do not reflect what was said in class. Code:
code/lecture11/(3 scripts + 1 module; Python standard library only; 1 to 3 seconds each) Reading time: 3 hours including running the code
0. How to read this lecture
0.1 Learning goals
After this lecture you should be able to:
- Define QF_LRA, a linear program, feasible / optimal / unbounded, and picture the feasible set as a convex polyhedron.
- Run the simplex method on a dictionary: choose the entering and leaving variables, pivot, and recognize optimality.
- Initialize simplex with the auxiliary problem, and explain degeneracy, cycling and Bland’s rule.
- Reduce satisfiability of linear literals to an LP, as the slides do, and say why SMT solvers do something else.
- Run the general simplex with bounds, explain a conflict, and check its Farkas certificate.
- Handle strict inequalities with δ-rationals and turn a δ-solution into a real one.
- Explain why the general simplex is incremental and backtrackable, and plug it into CDCL(T) with bound propagation.
0.2 Prerequisites and scope
| Assumed | Introduced here | Developed later |
|---|---|---|
| CDCL(T), the theory-solver interface (Lecture 10) | the LRA theory solver | integers: branch and bound, cuts (Lecture 12) |
| linear equations, Gaussian elimination | simplex, Bland’s rule, Farkas’ lemma | Fourier–Motzkin in depth, difference logic (Lecture 12) |
| first-order theories (Lecture 8) | , QF_LRA | combining LRA with EUF (Lecture 18) |
Scope: linear real arithmetic, where multiplication is only by numerals. Nonlinear real arithmetic (decidable, Tarski; cylindrical algebraic decomposition) is outside this course.
0.3 Map
§1 QF_LRA and linear programs ← code 01
§2 the simplex method: dictionaries and pivots ← code 01
§3 initialization, degeneracy, cycling, Bland, the worst case ← code 01
§4 satisfiability as linear programming (the slides) ← code 02
§5 the general simplex of SMT solvers ← code 02
§6 pivoting rules, and Fourier–Motzkin ← code 02
§7 LRA inside CDCL(T) ← code 03
§8 summary §9 common pitfalls §10 exercises §11 further reading §12 next lecture
0.4 Notation
| Symbol | Meaning |
|---|---|
| constraint matrix, right-hand sides, objective: maximize subject to | |
| basic / non-basic | left-hand / right-hand variables of a dictionary (non-basic ones are at their bounds) |
| lower and upper bound of variable in the general simplex | |
| the current assignment | |
| a δ-rational: is a positive infinitesimal | |
| Farkas multipliers |
0.5 The code of this lecture
One module, simplex.py:
- numbers: exact
Fractions everywhere, andDeltaRationalfor ; - linear terms:
linearize,Constraint(withcanonical, which sets the first coefficient to 1 so equivalent forms share a slack),atom_constraint; - textbook simplex:
Dictionary(pivot, Dantzig / Bland rules, cycle detection, traces) andtwo_phase; - general simplex:
GeneralSimplex(tableau, bounds with tags,check()with Bland or greedy pivoting, Farkas explanations, undo, traces), plusconcrete_deltaandfarkas_check; fourier_motzkin, an independent decision procedure;- the theory solver
LRA, with bound propagation, pluspreprocess(arithmetic equalities into two ≤),solve_lra,check_model_lraandfm_unsat; - the benchmarks: the slides’ LPs, Chvátal’s example,
klee_minty, random systems,job_shop, the ReLU network.
1. QF_LRA and linear programs
1.1 The theory
The theory of real arithmetic has signature plus numerals, and interprets them over . QF_LRA is its quantifier-free, linear fragment: every has a numeral as one argument. A literal is then a linear constraint with , possibly negated.
The slides note that many SMT solvers, cvc5 and Z3 among them, use a version of the simplex method as their QF_LRA theory solver.
1.2 Linear programs
A linear program (LP) asks:
maximize subject to .
The slides’ terminology, on maximize subject to , (script 01, Part 1):
| point | feasible? | objective |
|---|---|---|
| (0, 0) | no | – |
| (−2, 1) | yes | 4 |
| (−10, 13) | yes | 36 |
This LP is unbounded. Along , the point stays feasible for , and the objective grows without limit.
Geometry (the slides):
- the feasible set is a convex polyhedron, an intersection of half-spaces;
- the LP is infeasible iff the polyhedron is empty, and unbounded iff it is open in the direction of ;
- a bounded LP attains its optimum at a vertex.

2. The simplex method
2.1 Dictionaries
Dantzig’s simplex method (late 1940s; the slides date it 1949) walks from vertex to vertex. Take the standard form: maximize subject to and (every LP can be brought into it).
Add a slack variable per constraint, . The resulting dictionary writes the slacks and in terms of the original variables. The slides’ running example (script 01, Part 2):
x4 = 5 - 2x1 - 3x2 - x3
x5 = 11 - 4x1 - x2 - 2x3
x6 = 8 - 3x1 - 4x2 - 2x3
z = 5x1 + 4x2 + 3x3
Basic variables are on the left; non-basic ones are on the right, all 0. When every constant is the dictionary is feasible: the solution , , , .
2.2 Pivoting
Each step of the method makes three choices:
- Entering variable. A non-basic variable with a positive coefficient in : increasing it increases . Dantzig’s rule takes the largest coefficient, here .
- Leaving variable. The basic variable that first hits 0 as the entering one grows: the ratio test. Here , so leaves.
- Pivot. Solve ‘s equation for and substitute it everywhere.
Script 01 prints the slides’ dictionaries exactly:
pivot: x1 enters, x4 leaves; z: 0 -> 25/2
x1 = 5/2 - 3/2x2 - 1/2x3 - 1/2x4
x5 = 1 + 5x2 + 2x4
x6 = 1/2 + 1/2x2 - 1/2x3 + 3/2x4
z = 25/2 - 7/2x2 + 1/2x3 - 5/2x4
pivot: x3 enters, x6 leaves; z: 25/2 -> 13
x1 = 2 - 2x2 - 2x4 + x6
x3 = 1 + x2 + 3x4 - 2x6
x5 = 1 + 5x2 + 2x4
z = 13 - 3x2 - x4 - x6
Optimality. Every coefficient of is now negative, and . So for every feasible point, and is optimal.
The slides’ invariants:
- the number of equations never changes;
- every variable is either basic or non-basic;
- the non-basic variables sit at their bounds;
- the basic values follow from the equations.
Why exact arithmetic. The fractions 5/2 and 1/2 appear after one pivot. A floating-point simplex accumulates rounding error and can declare feasible what is not, or the reverse. For a decision procedure that is unacceptable, so every number in simplex.py is a Fraction. That is the slides’ first suggested improvement.
3. Initialization, degeneracy and termination
3.1 The auxiliary problem
If some , the origin is infeasible and there is no starting dictionary. The slides’ fix is to solve the auxiliary problem
maximize subject to , , .
A large enough satisfies every constraint. Script 01, Part 3 reproduces the slides’ example:
x3 = -2 - 2x1 + 3x2 + x0 one pivot (x0 enters, x4 leaves): x3 = 2 + 2x1 + 2x2 + x4
x4 = -4 - 4x1 + x2 + x0 x0 = 4 + 4x1 - x2 + x4
z = -x0 z = -4 - 4x1 + x2 - x4
The original problem is feasible iff the auxiliary optimum has (2 pivots here). Phase 2 then continues from that basis with the original objective. For the slides’ objective (maximize ) it finds the LP unbounded: can grow forever. Minimizing instead gives 8 at .
Phase 1 is a satisfiability check. It decides whether has a solution, with no objective. That is all an SMT solver needs (§5).
3.2 Cycling and Bland’s rule
The slides’ Theorem 1: simplex fails to terminate iff it cycles, generating the same dictionary infinitely often. The reasoning:
- there are finitely many bases;
- each determines its dictionary;
- never decreases.
Cycling therefore needs degenerate pivots, where the entering variable cannot actually grow and is unchanged.
Chvátal’s example (script 01, Part 4) shows it really happens:
| pivot | enters | leaves | z after |
|---|---|---|---|
| 1 | x1 | x5 | 0 |
| 2 | x2 | x6 | 0 |
| 3 | x3 | x1 | 0 |
| 4 | x4 | x2 | 0 |
| 5 | x5 | x3 | 0 |
| 6 | x6 | x4 | 0 |
After 6 degenerate pivots under Dantzig’s rule, the basis is {x5, x6, x7} again: the method loops forever.
Bland’s rule (1977) prevents this:
- the entering variable is the one with the smallest index among those that improve ;
- the leaving variable is the one with the smallest index among the tied candidates.
Theorem (Bland). With these choices simplex never cycles. On Chvátal’s example it reaches the optimum at after 7 pivots.
3.3 The worst case
On the Klee–Minty cube (1972), a squashed -dimensional cube, Dantzig’s rule visits every vertex:
| n | vertices | pivots, Dantzig | pivots, Bland |
|---|---|---|---|
| 4 | 16 | 15 | 9 |
| 8 | 256 | 255 | 67 |
| 11 | 2,048 | 2,047 | 287 |
Bland’s rule is no cure for the worst case: its counts grow by about 1.6 per dimension here, also exponentially. No pivoting rule is known to be polynomial.
The slides list the alternatives: the ellipsoid method (Khachiyan 1979) and interior-point methods (Karmarkar 1984) are polynomial. Simplex is the oldest and theoretically worst, and still the most popular, because it is fast in practice and, for SMT, because it is incremental (§5).
Run it:
python3 01_linear_programming.py(about 1 s), withfigures/01_lp_geometry.png.
4. Satisfiability as linear programming
The slides reduce the satisfiability of a set of linear literals to one LP in three steps:
- Equalities. becomes and .
- Negated inequalities. becomes with one fresh shared by all of them. If there are none, add .
- Maximize subject to the result. The literals are satisfiable iff the optimum is positive.
Script 02, Part 1 implements this, splitting each free into so the textbook simplex applies:
| literals | max y | LP reduction | general simplex | |
|---|---|---|---|---|
| A | 1 | SAT | SAT | |
| B | A | – | UNSAT | UNSAT |
| C | 0 | UNSAT | UNSAT |
In B even is infeasible ( contradicts ), so the LP itself is infeasible. In C the LP is feasible only with .
The reduction is correct but clumsy for SMT:
- it solves an optimization problem to answer yes or no;
- it encodes strictness in an extra variable;
- most importantly, it gives no explanation of an UNSAT answer.
5. The general simplex of SMT solvers
5.1 Equations fixed, bounds changing
Dutertre and de Moura (2006) separate what is fixed from what changes:
- every distinct linear form of the input gets one slack variable with the equation . The equations never change;
- every constraint becomes a bound on a single variable: is , where after canonicalization;
- asserting a constraint tightens a bound; retracting it restores the old bound.
The state:
- a tableau, with basic variables written as linear combinations of non-basic ones;
- bounds , each tagged with the constraint that set it;
- an assignment .
Invariant: every non-basic variable is within its bounds. Basic variables may be out of bounds; check() repairs them.
5.2 check()
repeat:
x_i := the basic variable of smallest index violating a bound; none -> SAT
if β(x_i) < ℓ_i:
x_j := the non-basic variable of smallest index that can move x_i up without leaving its own bounds
(a_ij > 0 and β(x_j) < u_j, or a_ij < 0 and β(x_j) > ℓ_j)
none -> UNSAT: explain
pivot x_i and x_j, and set x_i := ℓ_i
symmetric if β(x_i) > u_i
Choosing the smallest index in both places is Bland’s rule again, and it guarantees termination.
Script 02, Part 2 traces it on , , , :
$s1 = x + y $s2 = x - 1/2y $s3 = x - 2y (slacks of the three linear forms)
assert c1: bound $s1 ≥ 2; $s1 violates it: pivot with x, set $s1 := 2 -> x = 2, y = 0
assert c2: bound $s2 ≥ 0; consistent -> $s2 = 2
assert c3: bound $s3 ≤ -1; $s3 violates it: pivot with y, set $s3 := -1 -> x = 1, y = 1
assert c4: bound x ≤ 0; x violates it: pivot with $s3, set x := 0
CONFLICT on row $s2 = -1/2$s1 + 3/2x: no non-basic variable can move it
explanation: c2, c1, c4
5.3 Explanations and Farkas’ lemma
At the conflict, row needs . But and hold it at most at . Only those three bounds matter, so the explanation omits . Smaller explanations give stronger learned clauses in CDCL(T).
Farkas’ lemma. A system has no real solution iff there are with:
- (the zero linear form);
- , or when some strict inequality has .
The conflict row supplies the multipliers. Script 02 prints and checks them:
farkas_check verifies the certificate with additions alone. Like DRUP in Lecture 5, the checker needs no trust in the solver. The self-test checks this on the conflicts of 150 random systems.
5.4 Strict inequalities: δ-rationals
is not a bound. Dutertre and de Moura write it as for a symbolic positive infinitesimal δ. Values are pairs , compared lexicographically:
- first by ;
- then by .
Simplex runs unchanged on such pairs. Script 02, Part 3:
| constraints | result | δ-solution | concrete δ | real solution |
|---|---|---|---|---|
| SAT | 1/3 | |||
| UNSAT | – | – | – | |
| SAT | 1 |
A δ-solution becomes a real one by choosing δ small enough. For each bound with and , any works; take the minimum over all bounds. Here three strict steps share a gap of 1, so .
5.5 Incremental and backtrackable
The two properties CDCL(T) needs (Lecture 10, §5.6) come for free:
| random feasible systems | pivots, a check after each constraint | pivots, one check at the end | pivots after retracting the last constraint |
|---|---|---|---|
| 4 variables, 8 constraints | 4.8 | 4.2 | 0.0 |
| 10 variables, 20 constraints | 16.7 | 16.7 | 0.0 |
Incremental. Each check starts from the previous solution and only repairs it. Checking after every constraint costs about as many pivots in total as one check at the end.
Backtrackable. Retracting a constraint only loosens a bound, so the current assignment remains a solution: no pivots at all. The tableau stays; only the bound stack is popped.
Run it:
python3 02_general_simplex.py(about 2 s), withfigures/02_simplex_vs_fm.png.
6. Pivoting rules, and Fourier–Motzkin
Rules. Script 02, Part 5, one check on each of 30 random systems per size:
| variables | constraints | pivots, Bland | pivots, greedy | greedy over budget |
|---|---|---|---|---|
| 4 | 8 | 96 | 76 | 0 |
| 8 | 16 | 437 | 274 | 0 |
| 12 | 24 | 894 | 426 | 0 |
Bland’s rule is safe but slow. The greedy rule (largest violation, largest coefficient) needs about half the pivots at 12 variables and never cycled here. Real solvers use such heuristics and switch to Bland’s rule when they detect cycling, as the slides say.
Fourier–Motzkin elimination (Fourier 1826, Motzkin 1936) is the classic alternative.
- To eliminate , write every constraint mentioning it as a lower bound or an upper bound .
- Replace them by all pairs : that is exactly of the conjunction.
- Eliminating all variables leaves constant comparisons.
The procedure is simple and obviously correct, but each step can square the number of constraints:
| variables | constraints | simplex pivots | FM peak constraints |
|---|---|---|---|
| 5 | 15 | 6 | 219 |
| 6 | 18 | 8 | 122,911 |
So FM is a poor decision procedure and a good checker. fm_unsat re-checks every LRA theory lemma, which is a conjunction of a few literals, with code that shares nothing with the simplex. Lecture 12 returns to FM, its Omega-test refinement and integers.

7. LRA inside CDCL(T)
7.1 The theory solver
The class LRA implements Lecture 10’s interface:
- Atoms. Every arithmetic atom is linearized, moved to and canonicalized (first coefficient 1). All atoms over the same form share one simplex variable.
- Equalities are rewritten before abstraction (
preprocess): becomes . Its negation is then the disjunction , a case split that belongs to the SAT solver, not a bound. - assert_lit. An atom set true asserts its bound. An atom set false asserts the bound of its negation: is .
- check runs
GeneralSimplex.check(). backtrack_to pops bounds. - Bound propagation. For atoms over the same form, an asserted entails and refutes , with the one-literal explanation .
- model returns rational values, with a concrete δ.
check_model_lrare-evaluates the input, andfm_unsatre-checks lemmas.
7.2 A traced run
Script 03, Part 1, on :
PROPAGATE 5, 6, 7, 8 (x + y ≤ 1, 1 ≤ x + y, 0 ≤ x, 0 ≤ y: unit clauses)
DECIDE •¬1 (x ≤ 0 false)
PROPAGATE 2 (so x ≥ 2)
T-CONFLICT {¬2, ¬8, ¬5} x ≥ 2, y ≥ 0, x + y ≤ 1 are inconsistent
LEARN+BACKJUMP {¬2}, level 0; PROPAGATE 1
DECIDE •¬3; PROPAGATE 4; T-CONFLICT {¬4, ¬7, ¬5}; LEARN {¬4}; PROPAGATE 3
T-CONFLICT {¬3, ¬1, ¬6} x ≤ 0, y ≤ 0, x + y ≥ 1 -> FAIL: UNSAT
Each lemma has three bounds, not all eight atoms. Replacing by makes the formula satisfiable with model , , which is checked against the input.
7.3 Scheduling
Job-shop scheduling. Each job is a sequence of tasks on machines, and a machine runs one task at a time. Each pair of tasks on one machine is a disjunction: one finishes before the other starts. CDCL(T) chooses the orders, and the simplex checks that they fit the horizon.
Binary search on the horizon turns the decision procedure into an optimizer. Script 03, Part 2 (5 jobs × 4 machines):
| horizon | result | decisions | conflicts | certificate |
|---|---|---|---|---|
| 49 | SAT | 86 | 6 | model ok |
| 28 | SAT | 213 | 23 | model ok |
| 24 | UNSAT | 222 | 36 | refutation ok |
| 26 | SAT | 321 | 63 | model ok |
| 25 | UNSAT | 244 | 52 | refutation ok |
The shortest makespan is 26, found with 6 SMT calls in 0.34 s. The interesting answer is the UNSAT at 25, “no shorter schedule exists”. Its certificate consists of lemmas re-checked by Fourier–Motzkin plus a DRUP proof.

7.4 Verifying the slides’ neural network
The slides’ network has two inputs, two ReLU units and two outputs:
- and ;
- and ;
- inputs , .
Each ReLU is a disjunction . A property holds iff network ∧ ¬property is UNSAT (script 03, Part 3):
| property | result | meaning |
|---|---|---|
| (the slides) | SAT | fails: , gives |
| UNSAT | holds for every input (certified) | |
| UNSAT | holds | |
| SAT | fails at , () |
The slides use this network to illustrate the encoding. As stated, its property is false: both ReLUs can output the same value.
Real network verifiers handle the case splits that ReLUs force by extending the simplex with ReLU-aware pivoting: Reluplex and Marabou (Katz et al.; Guy Katz contributed some of the slides).
7.5 Ablation
Script 03, Part 4, 80 random QF_LRA formulas (47 SAT, 33 UNSAT, all 80 certified):
| configuration | decisions | conflicts | T-propagations |
|---|---|---|---|
| Bland, bound propagation | 3,494 | 1,245 | 1,504 |
| Bland, no propagation | 7,281 | 2,011 | 0 |
| greedy pivoting, propagation | 3,290 | 1,254 | 1,398 |
Bound propagation is a comparison of constants on one linear form, and it halves the decisions.
Run it:
python3 03_lra_in_cdclt.py(about 3 s), withfigures/03_schedule.png.
8. Summary
-
QF_LRA literals are linear constraints over the reals. Their conjunctions are decidable in polynomial time, and in practice by simplex.
-
The textbook simplex pivots between dictionaries:
- entering variable: a positive coefficient in ;
- leaving variable: the ratio test;
- optimal when no coefficient of is positive.
The code reproduces the slides’ dictionaries exactly.
-
Initialization is an auxiliary LP. Its optimum decides feasibility, so phase 1 is satisfiability.
-
Cycling needs degenerate pivots (Chvátal’s example: 6 pivots back to the start). Bland’s rule prevents it. The worst case is exponential for both rules (Klee–Minty).
-
The general simplex of SMT solvers keeps a fixed tableau and changes bounds. It is incremental, and backtracking needs no pivots. Its conflicts come with explanations and Farkas certificates that anyone can check.
-
Strict inequalities use δ-rationals; a concrete δ turns a δ-solution into a real solution.
-
Fourier–Motzkin is simple but explosive: 122,911 constraints at 6 variables. It serves as an independent lemma checker.
-
Inside CDCL(T), LRA handles scheduling (makespan 26, with “no 25” certified) and ReLU networks (the slides’ property fails). Bound propagation halves the decisions.
9. Common pitfalls
- Floating point. A simplex in floats is a heuristic, not a decision procedure. Use exact rationals. (The code once let a float in through an
int / intdivision, and the tableau filled up with 2251799813685249/4503599627370496.) - Forgetting . The textbook method assumes non-negative variables. A free variable must be split, , or handled with bounds as in the general simplex.
- Treating or a negated equality as a constraint. is a disjunction of two strict inequalities, so it belongs in the Boolean structure.
- Dropping strictness. is satisfiable for every , but is not. Without δ, strict inequalities are either lost or approximated unsoundly.
- Assuming Bland’s rule is fast. It guarantees termination, not speed.
- Explanations that are not minimal. A conflict explained by all asserted bounds is sound but weak. The row of the conflict gives a small, certifiable explanation.
- Backtracking the tableau. Unnecessary: pivots are equivalence transformations. Only the bounds must be restored.
10. Exercises
1. (pivoting) Starting from the slides’ first dictionary, pivot with Bland’s rule instead of Dantzig’s. Which variables enter and leave, and do you reach the same optimum?
Answer
First pivot. Bland picks the smallest index with a positive coefficient, which is , as Dantzig did. So the first pivot is the same: enters and leaves.
Second pivot. Only has a positive coefficient (), so enters and leaves.
Both rules reach at in 2 pivots, which two_phase(..., rule="bland") confirms.
2. (ratio test) Why must the leaving variable be the one with the smallest ratio? What goes wrong if leaves in the first pivot of the slides’ example?
Answer
Why the smallest. The entering variable can grow only until the first basic variable reaches 0. Beyond that point that variable turns negative and the solution is infeasible.
If leaves. Then , and : the dictionary is no longer feasible.
3. (degeneracy) Show that every pivot of Chvátal’s cycle is degenerate. Explain why cycling is impossible when no pivot is degenerate.
Answer
Every pivot is degenerate. All right-hand sides of the cycling rows are 0, so every ratio is 0. The entering variable stays at 0 and does not change (the table shows z = 0 throughout).
Why non-degenerate pivots cannot cycle. If every pivot strictly increased , no basis could repeat, because each basis has a fixed . There are finitely many bases, so the method would terminate.
4. (general simplex) Run check() by hand on , , , . Is it feasible? If not, give the explanation and a Farkas certificate.
Answer
Infeasible. From and we get , contradicting .
The certificate. Sum , which gives .
The explanation. It omits . The simplex finds it from the row of with at its upper bound and at its lower bound.
5. (δ) Find the concrete δ for , , , , and a real solution.
Answer
A δ-solution. , (or similar).
The bounds on δ. requires , i.e. .
A real solution. With : , .
6. (Farkas) Prove the easy direction of Farkas’ lemma: if multipliers with and exist, the system has no solution.
Answer
Combine the constraints. Suppose satisfies every . Multiplying by and adding gives .
The contradiction. The left side is the zero form, so . With strict inequalities and , the sum is strict (), also a contradiction.
The other direction. The hard direction (infeasible ⇒ multipliers exist) is what simplex constructs.
7. (FM) Eliminate from , , , , by hand. Is the system satisfiable?
Answer
The bounds on . Lower bounds ; upper bounds .
The pairs. , , , . With , these say : satisfiable.
A solution. E.g. , .
8. (CDCL(T)) Why does preprocess rewrite as two inequalities instead of letting the theory handle equality atoms directly? What would go wrong with an equality atom assigned false?
Answer
The negation is not a bound. A false equality atom means , which is . The general simplex handles conjunctions of bounds only, and a disjunction is not one.
What the rewrite buys. As two ≤ atoms, the negation becomes in the Boolean structure. CDCL splits on it as on any clause.
The alternative. Some solvers keep disequalities and split lazily (“splitting on demand”).
9. (programming) Add theory propagation through rows: after check(), compute for each basic variable the interval implied by its row and the bounds of the non-basic variables. Propagate the atoms over that variable that the interval decides. Measure the effect on script 03’s Part 4.
Answer sketch
The implied interval. For row , the lower bound is (when all are finite), and symmetrically for the upper bound.
What to propagate. An atom with the implied upper bound is entailed. Its explanation is the bounds used, which is also a Farkas certificate.
The trade-off. Expect fewer conflicts at some cost per check. This is what production solvers do (Dutertre and de Moura, §4).
10. (programming) Implement the dual view of conflicts: from a conflict row, construct the Farkas multipliers over the original atoms (not the slack bounds), and verify them with farkas_check inside check_unsat instead of Fourier–Motzkin.
Answer sketch
Mapping back to the atoms. Each bound carries its tag (SAT literal), which maps to an atom and its truth value. The canonical constraint of that literal, multiplied by the row coefficient, is the term of the sum.
What to store. Record the certificate in LRA.assert_lit / check, keyed by the lemma clause, and check it in check_unsat.
The payoff. No search in the checker at all.
11. Further reading
- G. B. Dantzig, Linear Programming and Extensions, Princeton 1963; V. Chvátal, Linear Programming, Freeman 1983 (dictionaries, cycling example, Bland’s rule).
- R. G. Bland, “New Finite Pivoting Rules for the Simplex Method”, Mathematics of Operations Research 1977.
- V. Klee, G. J. Minty, “How Good Is the Simplex Algorithm?”, 1972.
- B. Dutertre, L. de Moura, “A Fast Linear-Arithmetic Solver for DPLL(T)”, CAV 2006: the general simplex of this lecture.
- D. Kroening, O. Strichman, Decision Procedures, Chapter 5 (linear arithmetic, simplex, Fourier–Motzkin).
- G. Katz, C. Barrett, D. Dill, K. Julian, M. Kochenderfer, “Reluplex: An Efficient SMT Solver for Verifying Deep Neural Networks”, CAV 2017; and “The Marabou Framework”, CAV 2019.
- L. Khachiyan, “A Polynomial Algorithm in Linear Programming”, 1979; N. Karmarkar, “A New Polynomial-Time Algorithm for Linear Programming”, 1984.
12. Next lecture
Lecture 12: arithmetic II, integers. Over the integers, has no solution even though LRA finds .
- Branch and bound splits on fractional values: .
- Gomory cuts add constraints that remove fractional vertices.
- Fourier–Motzkin and the Omega test eliminate variables.
- Difference logic reduces to negative cycles in a graph.
We will see that branch and bound need not terminate on unbounded problems, and how solvers guarantee termination.