Documentation

Lean.Elab.Tactic.Omega.Core

@[reducible, inline]

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

Instances For

    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.

      Instances For

        Print a Justification as an indented tree structure.

        Instances For

          Construct the proof term associated to a tidy step.

          Instances For

            Construct the proof term associated to a combine step.

            Instances For

              Construct the proof term associated to a combo step.

              Instances For

                Construct the proof term associated to a bmod step.

                Instances For

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

                  Instances For

                    A Justification bundled together with its parameters.

                    Instances For

                      tidy, implemented on Fact.

                      Instances For
                        def Lean.Elab.Tactic.Omega.Fact.combo (a : Int) (f : Fact) (b : Int) (g : Fact) :

                        combo, implemented on Fact.

                        Instances For

                          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.

                            Instances For

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

                              Instances For

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

                                Instances For

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

                                  Instances For

                                    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!

                                    Instances For

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

                                      Instances For

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

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

                                        Instances For

                                          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.

                                          Instances For

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

                                            Instances For

                                              Recursively solve all equalities.

                                              Constructing the proof term for addInequality.

                                              Instances For

                                                Constructing the proof term for addEquality.

                                                Instances For

                                                  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.)

                                                  Instances For

                                                    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.)

                                                    Instances For

                                                      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

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

                                                        Instances For

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

                                                          Instances For

                                                            Is the Fourier-Motzkin elimination known to be exact?

                                                            Instances For

                                                              Prepare the Fourier-Motzkin elimination data for each variable.

                                                              Instances For

                                                                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.

                                                                Instances For

                                                                  Run Fourier-Motzkin elimination on one variable.

                                                                  Instances For

                                                                    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.