Documentation

Aesop.EMap

structure Aesop.EMap (α : Type u_1) :
Type u_1

A map whose keys are expressions. Keys are identified up to defeq. We use reducible transparency and treat metavariables as rigid (i.e., unassignable).

  • rep : Lean.PArray (Option (Lean.Expr × α))

    The mappings stored in the map. Defeq expressions are identified, so for each equivalence class of defeq expressions we only store one representative. Missing values indicate expressions that were removed from the map.

  • idx : Lean.Meta.DiscrTree Nat

    An index for rep. For each expression e at index i in rep, idx.getMatch returns a list of indexes containing i. This is used as a pre-filter during lookups/insertions/modifications to reduce the number of defeq comparisons.

Instances For
    Equations
    Instances For
      @[implicit_reducible]
      instance Aesop.instInhabitedEMap {a✝ : Type u_1} :
      Inhabited (EMap a✝)
      Equations
      def Aesop.EMap.empty {α : Type u_1} :
      EMap α
      Equations
      • Aesop.EMap.empty = { rep := Lean.PersistentArray.empty, idx := Lean.Meta.DiscrTree.empty }
      Instances For
        @[implicit_reducible]
        instance Aesop.EMap.instEmptyCollection {α : Type u_1} :
        EmptyCollection (EMap α)
        Equations
        @[implicit_reducible]
        instance Aesop.EMap.instForMProdExpr {m : TypeType u_1} [Monad m] {α : Type u_2} :
        ForM m (EMap α) (Lean.Expr × α)
        Equations
        • One or more equations did not get rendered due to their size.
        @[implicit_reducible]
        instance Aesop.EMap.instForInProdExpr {m : TypeType u_1} [Monad m] {α : Type u_2} :
        ForIn m (EMap α) (Lean.Expr × α)
        Equations
        • One or more equations did not get rendered due to their size.
        def Aesop.EMap.foldlM {m : TypeType u_1} [Monad m] {σ : Type} {α : Type u_2} (init : σ) (f : σLean.Exprαm σ) (map : EMap α) :
        m σ
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          def Aesop.EMap.foldl {σ : Type} {α : Type u_1} (init : σ) (f : σLean.Exprασ) (map : EMap α) :
          σ
          Equations
          Instances For
            @[specialize #[]]
            def Aesop.EMap.alterM {m : TypeType u_1} [Monad m] [MonadLiftT Lean.MetaM m] {α β : Type} (e : Lean.Expr) (f : αm (Option α × β)) (map : EMap α) :
            m (EMap α × Option β)
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              def Aesop.EMap.alter {α β : Type} (e : Lean.Expr) (f : αOption α × β) (map : EMap α) :
              Lean.MetaM (EMap α × Option β)
              Equations
              Instances For
                @[specialize #[]]
                def Aesop.EMap.insertNew {m : TypeType u_1} [Monad m] [MonadLiftT Lean.MetaM m] {α : Type} (e : Lean.Expr) (a : α) (map : EMap α) :
                m (EMap α)
                Equations
                • Aesop.EMap.insertNew e a map = do let idxliftM (map.idx.insert e map.rep.size) pure { rep := Lean.PersistentArray.push map.rep (some (e, a)), idx := idx }
                Instances For
                  @[specialize #[]]
                  def Aesop.EMap.insertWithM {m : TypeType u_1} [Monad m] [MonadLiftT Lean.MetaM m] {α : Type} (e : Lean.Expr) (f : Option αm α) (map : EMap α) :
                  m (EMap α × Option α × α)
                  Equations
                  • One or more equations did not get rendered due to their size.
                  Instances For
                    def Aesop.EMap.insertWith {α : Type} (e : Lean.Expr) (f : Option αα) (map : EMap α) :
                    Lean.MetaM (EMap α × Option α × α)
                    Equations
                    Instances For
                      def Aesop.EMap.insert {α : Type} (e : Lean.Expr) (a : α) (map : EMap α) :
                      Lean.MetaM (EMap α)
                      Equations
                      Instances For
                        def Aesop.EMap.singleton {m : TypeType u_1} [Monad m] [MonadLiftT Lean.MetaM m] {α : Type} (e : Lean.Expr) (a : α) :
                        m (EMap α)
                        Equations
                        Instances For
                          def Aesop.EMap.findWithKey? {α : Type} (e : Lean.Expr) (map : EMap α) :
                          Lean.MetaM (Option (Lean.Expr × α))
                          Equations
                          • One or more equations did not get rendered due to their size.
                          Instances For
                            def Aesop.EMap.find? {α : Type} (e : Lean.Expr) (map : EMap α) :
                            Lean.MetaM (Option α)
                            Equations
                            Instances For
                              @[specialize #[]]
                              def Aesop.EMap.mapM {m : TypeType u_1} [Monad m] {α β : Type} (f : Lean.Exprαm β) (map : EMap α) :
                              m (EMap β)
                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                def Aesop.EMap.map {α β : Type} (f : Lean.Exprαβ) (map : EMap α) :
                                EMap β
                                Equations
                                Instances For