Documentation

Lean.Elab.Tactic.Omega.Core

Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.
@[reducible, inline]

A delayed proof that a constraint is satisfied at the atoms.

Equations

Our internal representation of an argument "justifying" that a constraint holds on some coefficients. We'll use this to construct the proof term once a contradiction is found.

Instances For

Wrapping for Justification.tidy when tidy? is nonempty.

Equations

Print a Justification as an indented tree structure.

Equations

Construct the proof term associated to a tidy step.

Equations

Construct the proof term associated to a combine step.

Equations

Construct the proof term associated to a combo step.

Equations
  • One or more equations did not get rendered due to their size.

Construct the proof term associated to a bmod step.

Equations
  • One or more equations did not get rendered due to their size.

Constructs a proof that s.sat' c v = true

Equations

A Justification bundled together with its parameters.

Instances For

tidy, implemented on Fact.

Equations
  • f.tidy = match f.justification.tidy? with | some constraint, coeffs, justification => { coeffs := coeffs, constraint := constraint, justification := justification } | none => f
def Lean.Elab.Tactic.Omega.Fact.combo (a : Int) (f : Fact) (b : Int) (g : Fact) :

combo, implemented on Fact.

Equations
  • One or more equations did not get rendered due to their size.

A omega problem.

This is a hybrid structure: it contains both Expr objects giving proofs of the "ground" assumptions (or rather continuations which will produce the proofs when needed) and internal representations of the linear constraints that we manipulate in the algorithm.

While the algorithm is running we do not synthesize any new Expr proofs: proof extraction happens only once we've found a contradiction.

Instances For

Check if a problem has no constraints.

Equations
Equations
  • One or more equations did not get rendered due to their size.

Takes a proof that s.sat' x v for some s such that s.isImpossible, and constructs a proof of False.

Equations
  • One or more equations did not get rendered due to their size.

Insert a constraint into the problem, without checking if there is already a constraint for these coefficients.

Equations
  • One or more equations did not get rendered due to their size.

Add a constraint into the problem, combining it with any existing constraints for the same coefficients.

Equations
  • One or more equations did not get rendered due to their size.

Walk through the equalities, finding either the first equality with minimal coefficient ±1, or otherwise the equality with minimal (r.minNatAbs, r.maxNatAbs) (ordered lexicographically).

Returns the coefficients of the equality, along with the value of minNatAbs.

Although we don't need to run a termination proof here, it's nevertheless important that we use this ordering so the algorithm terminates in practice!

Equations
  • One or more equations did not get rendered due to their size.

If we have already solved some equalities, apply those to some new Fact.

Equations
  • One or more equations did not get rendered due to their size.

Solve an "easy" equality, i.e. one with a coefficient that is ±1.

After solving, the variable will have been eliminated from all constraints.

Equations
  • One or more equations did not get rendered due to their size.

We deal with a hard equality by introducing a new easy equality.

After solving the easy equality, the minimum lexicographic value of (c.minNatAbs, c.maxNatAbs) will have been reduced.

Equations
  • One or more equations did not get rendered due to their size.

Solve an equality, by deciding whether it is easy (has a ±1 coefficient) or hard, and delegating to the appropriate function.

Equations

Recursively solve all equalities.

Constructing the proof term for addInequality.

Equations
  • One or more equations did not get rendered due to their size.

Constructing the proof term for addEquality.

Equations
  • One or more equations did not get rendered due to their size.

Helper function for adding an inequality of the form const + Coeffs.dot coeffs atoms ≥ 0 to a Problem.

(This is only used while initializing a Problem. During elimination we use addConstraint.)

Equations
  • One or more equations did not get rendered due to their size.

Helper function for adding an equality of the form const + Coeffs.dot coeffs atoms = 0 to a Problem.

(This is only used while initializing a Problem. During elimination we use addConstraint.)

Equations
  • One or more equations did not get rendered due to their size.

Folding addInequality over a list.

Equations
  • One or more equations did not get rendered due to their size.

Folding addEquality over a list.

Equations
  • One or more equations did not get rendered due to their size.

Representation of the data required to run Fourier-Motzkin elimination on a variable.

  • var : Nat

    Which variable is being eliminated.

  • irrelevant : List Fact

    The "irrelevant" facts which do not involve the target variable.

  • lowerBounds : List (Fact × Int)

    The facts which give a lower bound on the target variable, and the coefficient of the target variable in each.

  • upperBounds : List (Fact × Int)

    The facts which give an upper bound on the target variable, and the coefficient of the target variable in each.

  • lowerExact : Bool

    Whether the elimination would be exact, because all of the lower bound coefficients are ±1.

  • upperExact : Bool

    Whether the elimination would be exact, because all of the upper bound coefficients are ±1.

Instances For
Equations
  • One or more equations did not get rendered due to their size.
Equations
  • One or more equations did not get rendered due to their size.

Is a Fourier-Motzkin elimination empty (i.e. there are no relevant constraints).

Equations

The number of new constraints that would be introduced by Fourier-Motzkin elimination.

Equations

Is the Fourier-Motzkin elimination known to be exact?

Equations

Prepare the Fourier-Motzkin elimination data for each variable.

Equations
  • One or more equations did not get rendered due to their size.

Decides which variable to run Fourier-Motzkin elimination on, and returns the associated data.

We prefer eliminations which introduce no new inequalities, or otherwise exact eliminations, and break ties by the number of new inequalities introduced.

Equations
  • One or more equations did not get rendered due to their size.

Run Fourier-Motzkin elimination on one variable.

Equations
  • One or more equations did not get rendered due to their size.

Run the omega algorithm (for now without dark and grey shadows!) on a problem.

As for runOmega, but assuming the first round of solving equalities has already happened.