Documentation

Lean.Replay

Lean.Environment.replay #

replay env constantMap will "replay" all the constants in constantMap : HashMap Name ConstantInfo into env, sending each declaration to the kernel for checking.

replay does not send constructors or recursors in constantMap to the kernel, but rather checks that they are identical to constructors or recursors generated in the environment after replaying any inductive definitions occurring in constantMap.

replay can be used either as:

Instances For
    @[reducible, inline]
    Equations
      Instances For

        Check if a Name still needs processing. If so, move it from remaining to pending.

        Equations
          Instances For

            Use the current Environment to throw a Kernel.Exception.

            Equations
              Instances For

                Add a declaration, possibly throwing a Kernel.Exception.

                Equations
                  Instances For

                    Check if a Name still needs to be processed (i.e. is in remaining).

                    If so, recursively replay any constants it refers to, to ensure we add declarations in the right order.

                    The construct the Declaration from its stored ConstantInfo, and add it to the environment.

                    Replay a set of constants one at a time.

                    Check that all postponed constructors are identical to those generated when we replayed the inductives.

                    Equations
                      Instances For

                        Check that all postponed recursors are identical to those generated when we replayed the inductives.

                        Equations
                          Instances For

                            "Replay" some constants into an Environment, sending them to the kernel for checking.

                            Throws a IO.userError if the kernel rejects a constant, or if there are malformed recursors or constructors for inductive types.

                            Equations
                              Instances For