Documentation

Aesop.Tree.RunMetaM

The following functions let us run MetaM actions in the context of a rapp or goal. Rapps save the metavariable context in which they were run by storing a Meta.SavedState. When we, for example, apply a rule to a goal, we run the rule's action in the metavariable context of the goal (which is the metavariable context of the goal's parent rapp). The resulting metavariable context, in which the goal mvar is assigned to an expression generated by the rule, then becomes the metavariable context of the rule's rapp.

To save and restore metavariable contexts, we use the MonadBacktrack MetaM instance. This means that some elements of the state are persistent, notably caches and trace messages. These become part of the global state.

The environment is not persistent. This means that modifications of the environment made by a rule are not visible in the global state and are reset once the tactic exits. As a result, rules which modify the environment are likely to fail.

def Aesop.Rapp.runMetaM' {m : TypeType u_1} [Monad m] [MonadLiftT Lean.MetaM m] [MonadFinally m] {α : Type} (x : m α) (r : Rapp) :
m α
Equations
    Instances For
      def Aesop.Rapp.runMetaM {m : TypeType u_1} [Monad m] [MonadLiftT Lean.MetaM m] [MonadFinally m] {α : Type} (x : m α) (r : Rapp) :
      Equations
        Instances For
          def Aesop.Rapp.runMetaMModifying {m : TypeType u_1} [Monad m] [MonadLiftT Lean.MetaM m] [MonadFinally m] {α : Type} (x : m α) (r : Rapp) :
          m (α × Rapp)
          Equations
            Instances For
              def Aesop.RappRef.runMetaMModifying {m : TypeType} [Monad m] [MonadLiftT Lean.MetaM m] [MonadFinally m] {α : Type} (x : m α) (rref : RappRef) :
              m α
              Equations
                Instances For
                  Equations
                    Instances For
                      Equations
                        Instances For
                          def Aesop.Goal.runMetaMInParentState' {m : TypeType} [Monad m] [MonadLiftT Lean.MetaM m] [MonadFinally m] {α : Type} (x : m α) (g : Goal) :
                          m α
                          Equations
                            Instances For
                              Equations
                                Instances For
                                  def Aesop.Goal.runMetaMModifyingParentState {m : TypeType} [Monad m] [MonadLiftT Lean.MetaM m] [MonadFinally m] {α : Type} (x : m α) (g : Goal) :
                                  m α
                                  Equations
                                    Instances For
                                      Equations
                                        Instances For
                                          def Aesop.Rapp.runMetaMInParentState' {m : TypeType} [Monad m] [MonadLiftT Lean.MetaM m] [MonadFinally m] {α : Type} (x : m α) (r : Rapp) :
                                          m α
                                          Equations
                                            Instances For
                                              def Aesop.Rapp.runMetaMModifyingParentState {m : TypeType} [Monad m] [MonadLiftT Lean.MetaM m] [MonadFinally m] {α : Type} (x : m α) (r : Rapp) :
                                              m α
                                              Equations
                                                Instances For