Documentation

Lean.Elab.Tactic.Omega.Core

@[reducible, inline]

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

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

        Equations
          Instances For

            Print a Justification as an indented tree structure.

            Equations
              Instances For

                Construct the proof term associated to a tidy step.

                Equations
                  Instances For

                    Construct the proof term associated to a combine step.

                    Equations
                      Instances For

                        Construct the proof term associated to a combo step.

                        Equations
                          Instances For

                            Construct the proof term associated to a bmod step.

                            Equations
                              Instances For

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

                                Equations
                                  Instances For

                                    A Justification bundled together with its parameters.

                                    Instances For

                                      tidy, implemented on Fact.

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

                                          combo, implemented on Fact.

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

                                                Equations
                                                  Instances For

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

                                                    Equations
                                                      Instances For

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

                                                        Equations
                                                          Instances For

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

                                                            Equations
                                                              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!

                                                                Equations
                                                                  Instances For

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

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

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

                                                                            Equations
                                                                              Instances For

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

                                                                                Equations
                                                                                  Instances For

                                                                                    Recursively solve all equalities.

                                                                                    Constructing the proof term for addInequality.

                                                                                    Equations
                                                                                      Instances For

                                                                                        Constructing the proof term for addEquality.

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

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

                                                                                                Equations
                                                                                                  Instances For

                                                                                                    Folding addEquality over a list.

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

                                                                                                          Equations
                                                                                                            Instances For

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

                                                                                                              Equations
                                                                                                                Instances For

                                                                                                                  Is the Fourier-Motzkin elimination known to be exact?

                                                                                                                  Equations
                                                                                                                    Instances For

                                                                                                                      Prepare the Fourier-Motzkin elimination data for each variable.

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

                                                                                                                          Equations
                                                                                                                            Instances For

                                                                                                                              Run Fourier-Motzkin elimination on one variable.

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