Theorem: denoteOpArgs_res (MLIR/Semantics/Semantics.lean)

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
args : List (TypedSSAVal Δ)
⊢ ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ args env = Except.ok (r, env') → env' = env
Tactic:
induction args <;> intros env r env' H
State after:
case nil
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
H : denoteOpArgs Δ [] env = Except.ok (r, env')
⊢ env' = env

case cons
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head✝ : TypedSSAVal Δ
tail✝ : List (TypedSSAVal Δ)
tail_ih✝ :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail✝ env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
H : denoteOpArgs Δ (head✝ :: tail✝) env = Except.ok (r, env')
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
H : denoteOpArgs Δ [] env = Except.ok (r, env')
⊢ env' = env
Tactic:
case nil =>
  simp [denoteOpArgs] at *
  simp_monad at *
  cases H; subst r env
  simp
State after:
no goals

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
H : denoteOpArgs Δ (head :: tail) env = Except.ok (r, env')
⊢ env' = env
Tactic:
case cons head tail HInd =>
  simp [denoteOpArgs]; simp [denoteOpArgs] at H
  have ⟨headName, headτ⟩ := head
  simp_monad at *
  revert H
  cases Hhead: TopM.get headτ headName env <;> simp <;> intros H <;> try contradiction
  case ok r =>
  rw [TopM.get_unfold] at Hhead
  have ⟨rRes, rEnv⟩ := r; simp at Hhead; cases Hhead; subst rEnv
  simp [denoteOpArgs] at HInd
  split at H <;> try contradiction
  case h_2 tailR HTailR =>
  have ⟨tailRes, tailEnv⟩ := tailR
  simp at *
  specialize HInd HTailR
  cases H; subst env'
  assumption
State after:
no goals

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
H : denoteOpArgs Δ [] env = Except.ok (r, env')
⊢ env' = env
Tactic:
simp [denoteOpArgs] at *
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
H : pure [] env = Except.ok (r, env')
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
H : pure [] env = Except.ok (r, env')
⊢ env' = env
Tactic:
simp_monad at *
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
H : [] = r ∧ env = env'
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
H : [] = r ∧ env = env'
⊢ env' = env
Tactic:
cases H
State after:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
left✝ : [] = r
right✝ : env = env'
⊢ env' = env

State before:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
left✝ : [] = r
right✝ : env = env'
⊢ env' = env
Tactic:
subst r env
State after:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
env' : SSAEnv Δ
⊢ env' = env'

State before:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
env' : SSAEnv Δ
⊢ env' = env'
Tactic:
simp
State after:
no goals

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
H : denoteOpArgs Δ (head :: tail) env = Except.ok (r, env')
⊢ env' = env
Tactic:
simp [denoteOpArgs] at H
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
H :
  bind (TopM.get head.snd head.fst)
      (fun x => do
        let __do_lift ←
          mapM
              (fun x => do
                let __do_lift ← TopM.get x.snd x.fst
                pure { fst := x.snd, snd := __do_lift })
              tail
        pure ({ fst := head.snd, snd := x } :: __do_lift))
      env =
    Except.ok (r, env')
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
H :
  bind (TopM.get head.snd head.fst)
      (fun x => do
        let __do_lift ←
          mapM
              (fun x => do
                let __do_lift ← TopM.get x.snd x.fst
                pure { fst := x.snd, snd := __do_lift })
              tail
        pure ({ fst := head.snd, snd := x } :: __do_lift))
      env =
    Except.ok (r, env')
⊢ env' = env
Tactic:
have ⟨headName, headτ⟩ := head
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
H :
  bind (TopM.get (headName, headτ).snd (headName, headτ).fst)
      (fun x => do
        let __do_lift ←
          mapM
              (fun x => do
                let __do_lift ← TopM.get x.snd x.fst
                pure { fst := x.snd, snd := __do_lift })
              tail
        pure ({ fst := (headName, headτ).snd, snd := x } :: __do_lift))
      env =
    Except.ok (r, env')
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
H :
  bind (TopM.get (headName, headτ).snd (headName, headτ).fst)
      (fun x => do
        let __do_lift ←
          mapM
              (fun x => do
                let __do_lift ← TopM.get x.snd x.fst
                pure { fst := x.snd, snd := __do_lift })
              tail
        pure ({ fst := (headName, headτ).snd, snd := x } :: __do_lift))
      env =
    Except.ok (r, env')
⊢ env' = env
Tactic:
simp_monad at *
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
H :
  (match TopM.get headτ headName env with
    | Except.error err => Except.error err
    | Except.ok v =>
      match
        mapM
          (fun x s =>
            match TopM.get x.snd x.fst s with
            | Except.error err => Except.error err
            | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
          tail v.snd with
      | Except.error err => Except.error err
      | Except.ok v_1 => Except.ok ({ fst := headτ, snd := v.fst } :: v_1.fst, v_1.snd)) =
    Except.ok (r, env')
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
H :
  (match TopM.get headτ headName env with
    | Except.error err => Except.error err
    | Except.ok v =>
      match
        mapM
          (fun x s =>
            match TopM.get x.snd x.fst s with
            | Except.error err => Except.error err
            | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
          tail v.snd with
      | Except.error err => Except.error err
      | Except.ok v_1 => Except.ok ({ fst := headτ, snd := v.fst } :: v_1.fst, v_1.snd)) =
    Except.ok (r, env')
⊢ env' = env
Tactic:
revert H
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
⊢ (match TopM.get headτ headName env with
      | Except.error err => Except.error err
      | Except.ok v =>
        match
          mapM
            (fun x s =>
              match TopM.get x.snd x.fst s with
              | Except.error err => Except.error err
              | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
            tail v.snd with
        | Except.error err => Except.error err
        | Except.ok v_1 => Except.ok ({ fst := headτ, snd := v.fst } :: v_1.fst, v_1.snd)) =
      Except.ok (r, env') →
    env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
⊢ (match TopM.get headτ headName env with
      | Except.error err => Except.error err
      | Except.ok v =>
        match
          mapM
            (fun x s =>
              match TopM.get x.snd x.fst s with
              | Except.error err => Except.error err
              | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
            tail v.snd with
        | Except.error err => Except.error err
        | Except.ok v_1 => Except.ok ({ fst := headτ, snd := v.fst } :: v_1.fst, v_1.snd)) =
      Except.ok (r, env') →
    env' = env
Tactic:
cases Hhead: TopM.get headτ headName env <;> simp <;> intros H <;> try contradiction
State after:
case ok
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
a✝ : MLIRType.eval headτ × SSAEnv Δ
Hhead : TopM.get headτ headName env = Except.ok a✝
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail a✝.snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := a✝.fst } :: v.fst, v.snd)) =
    Except.ok (r, env')
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
Hhead : TopM.get headτ headName env = Except.ok r
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail r.snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := r.fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
⊢ env' = env
Tactic:
case ok r =>
rw [TopM.get_unfold] at Hhead
have ⟨rRes, rEnv⟩ := r; simp at Hhead; cases Hhead; subst rEnv
simp [denoteOpArgs] at HInd
split at H <;> try contradiction
case h_2 tailR HTailR =>
have ⟨tailRes, tailEnv⟩ := tailR
simp at *
specialize HInd HTailR
cases H; subst env'
assumption
State after:
no goals

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
Hhead : TopM.get headτ headName env = Except.ok r
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail r.snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := r.fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
⊢ env' = env
Tactic:
rw [TopM.get_unfold] at Hhead
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
Hhead :
  Except.ok
      (match SSAEnv.get headName headτ env with
        | some v => v
        | none => default,
        env) =
    Except.ok r
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail r.snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := r.fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
Hhead :
  Except.ok
      (match SSAEnv.get headName headτ env with
        | some v => v
        | none => default,
        env) =
    Except.ok r
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail r.snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := r.fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
⊢ env' = env
Tactic:
have ⟨rRes, rEnv⟩ := r
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
rEnv : SSAEnv Δ
Hhead :
  Except.ok
      (match SSAEnv.get headName headτ env with
        | some v => v
        | none => default,
        env) =
    Except.ok (rRes, rEnv)
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail (rRes, rEnv).snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := (rRes, rEnv).fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
rEnv : SSAEnv Δ
Hhead :
  Except.ok
      (match SSAEnv.get headName headτ env with
        | some v => v
        | none => default,
        env) =
    Except.ok (rRes, rEnv)
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail (rRes, rEnv).snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := (rRes, rEnv).fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
⊢ env' = env
Tactic:
simp at Hhead
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
rEnv : SSAEnv Δ
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail (rRes, rEnv).snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := (rRes, rEnv).fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
Hhead :
  (match SSAEnv.get headName headτ env with
      | some v => v
      | none => default) =
      rRes ∧
    env = rEnv
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
rEnv : SSAEnv Δ
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail (rRes, rEnv).snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := (rRes, rEnv).fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
Hhead :
  (match SSAEnv.get headName headτ env with
      | some v => v
      | none => default) =
      rRes ∧
    env = rEnv
⊢ env' = env
Tactic:
cases Hhead
State after:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
rEnv : SSAEnv Δ
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail (rRes, rEnv).snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := (rRes, rEnv).fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
right✝ : env = rEnv
⊢ env' = env

State before:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
rEnv : SSAEnv Δ
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail (rRes, rEnv).snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := (rRes, rEnv).fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
right✝ : env = rEnv
⊢ env' = env
Tactic:
subst rEnv
State after:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail (rRes, env).snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := (rRes, env).fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
⊢ env' = env

State before:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    denoteOpArgs Δ tail env = Except.ok (r, env') → env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail (rRes, env).snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := (rRes, env).fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
⊢ env' = env
Tactic:
simp [denoteOpArgs] at HInd
State after:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    mapM
          (fun x => do
            let __do_lift ← TopM.get x.snd x.fst
            pure { fst := x.snd, snd := __do_lift })
          tail env =
        Except.ok (r, env') →
      env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail (rRes, env).snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := (rRes, env).fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
⊢ env' = env

State before:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    mapM
          (fun x => do
            let __do_lift ← TopM.get x.snd x.fst
            pure { fst := x.snd, snd := __do_lift })
          tail env =
        Except.ok (r, env') →
      env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
H :
  (match
      mapM
        (fun x s =>
          match TopM.get x.snd x.fst s with
          | Except.error err => Except.error err
          | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
        tail (rRes, env).snd with
    | Except.error err => Except.error err
    | Except.ok v => Except.ok ({ fst := headτ, snd := (rRes, env).fst } :: v.fst, v.snd)) =
    Except.ok (r✝, env')
⊢ env' = env
Tactic:
split at H <;> try contradiction
State after:
case intro.h_2
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    mapM
          (fun x => do
            let __do_lift ← TopM.get x.snd x.fst
            pure { fst := x.snd, snd := __do_lift })
          tail env =
        Except.ok (r, env') →
      env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
v✝ : List (TypedArg Δ) × SSAEnv Δ
heq✝ :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail (rRes, env).snd =
    Except.ok v✝
H : Except.ok ({ fst := headτ, snd := (rRes, env).fst } :: v✝.fst, v✝.snd) = Except.ok (r✝, env')
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    mapM
          (fun x => do
            let __do_lift ← TopM.get x.snd x.fst
            pure { fst := x.snd, snd := __do_lift })
          tail env =
        Except.ok (r, env') →
      env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR : List (TypedArg Δ) × SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail (rRes, env).snd =
    Except.ok tailR
H : Except.ok ({ fst := headτ, snd := (rRes, env).fst } :: tailR.fst, tailR.snd) = Except.ok (r✝, env')
⊢ env' = env
Tactic:
case h_2 tailR HTailR =>
have ⟨tailRes, tailEnv⟩ := tailR
simp at *
specialize HInd HTailR
cases H; subst env'
assumption
State after:
no goals

State before:
case intro.h_1
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    mapM
          (fun x => do
            let __do_lift ← TopM.get x.snd x.fst
            pure { fst := x.snd, snd := __do_lift })
          tail env =
        Except.ok (r, env') →
      env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
err✝ : String × SSAEnv Δ
heq✝ :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail (rRes, env).snd =
    Except.error err✝
H : Except.error err✝ = Except.ok (r✝, env')
⊢ env' = env
Tactic:
contradiction
State after:
no goals

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    mapM
          (fun x => do
            let __do_lift ← TopM.get x.snd x.fst
            pure { fst := x.snd, snd := __do_lift })
          tail env =
        Except.ok (r, env') →
      env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR : List (TypedArg Δ) × SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail (rRes, env).snd =
    Except.ok tailR
H : Except.ok ({ fst := headτ, snd := (rRes, env).fst } :: tailR.fst, tailR.snd) = Except.ok (r✝, env')
⊢ env' = env
Tactic:
have ⟨tailRes, tailEnv⟩ := tailR
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    mapM
          (fun x => do
            let __do_lift ← TopM.get x.snd x.fst
            pure { fst := x.snd, snd := __do_lift })
          tail env =
        Except.ok (r, env') →
      env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR : List (TypedArg Δ) × SSAEnv Δ
tailRes : List (TypedArg Δ)
tailEnv : SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail (rRes, env).snd =
    Except.ok (tailRes, tailEnv)
H :
  Except.ok ({ fst := headτ, snd := (rRes, env).fst } :: (tailRes, tailEnv).fst, (tailRes, tailEnv).snd) =
    Except.ok (r✝, env')
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    mapM
          (fun x => do
            let __do_lift ← TopM.get x.snd x.fst
            pure { fst := x.snd, snd := __do_lift })
          tail env =
        Except.ok (r, env') →
      env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR : List (TypedArg Δ) × SSAEnv Δ
tailRes : List (TypedArg Δ)
tailEnv : SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail (rRes, env).snd =
    Except.ok (tailRes, tailEnv)
H :
  Except.ok ({ fst := headτ, snd := (rRes, env).fst } :: (tailRes, tailEnv).fst, (tailRes, tailEnv).snd) =
    Except.ok (r✝, env')
⊢ env' = env
Tactic:
simp at *
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    mapM
          (fun x => do
            let __do_lift ← TopM.get x.snd x.fst
            pure { fst := x.snd, snd := __do_lift })
          tail env =
        Except.ok (r, env') →
      env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR : List (TypedArg Δ) × SSAEnv Δ
tailRes : List (TypedArg Δ)
tailEnv : SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail env =
    Except.ok (tailRes, tailEnv)
H : { fst := headτ, snd := rRes } :: tailRes = r✝ ∧ tailEnv = env'
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
HInd :
  ∀ ⦃env : SSAEnv Δ⦄ ⦃r : List (TypedArg Δ)⦄ ⦃env' : SSAEnv Δ⦄,
    mapM
          (fun x => do
            let __do_lift ← TopM.get x.snd x.fst
            pure { fst := x.snd, snd := __do_lift })
          tail env =
        Except.ok (r, env') →
      env' = env
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR : List (TypedArg Δ) × SSAEnv Δ
tailRes : List (TypedArg Δ)
tailEnv : SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail env =
    Except.ok (tailRes, tailEnv)
H : { fst := headτ, snd := rRes } :: tailRes = r✝ ∧ tailEnv = env'
⊢ env' = env
Tactic:
specialize HInd HTailR
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR : List (TypedArg Δ) × SSAEnv Δ
tailRes : List (TypedArg Δ)
tailEnv : SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail env =
    Except.ok (tailRes, tailEnv)
H : { fst := headτ, snd := rRes } :: tailRes = r✝ ∧ tailEnv = env'
HInd : tailEnv = env
⊢ env' = env

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR : List (TypedArg Δ) × SSAEnv Δ
tailRes : List (TypedArg Δ)
tailEnv : SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail env =
    Except.ok (tailRes, tailEnv)
H : { fst := headτ, snd := rRes } :: tailRes = r✝ ∧ tailEnv = env'
HInd : tailEnv = env
⊢ env' = env
Tactic:
cases H
State after:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝¹ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR : List (TypedArg Δ) × SSAEnv Δ
tailRes : List (TypedArg Δ)
tailEnv : SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail env =
    Except.ok (tailRes, tailEnv)
HInd : tailEnv = env
left✝ : { fst := headτ, snd := rRes } :: tailRes = r✝
right✝ : tailEnv = env'
⊢ env' = env

State before:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
env' : SSAEnv Δ
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝¹ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR : List (TypedArg Δ) × SSAEnv Δ
tailRes : List (TypedArg Δ)
tailEnv : SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail env =
    Except.ok (tailRes, tailEnv)
HInd : tailEnv = env
left✝ : { fst := headτ, snd := rRes } :: tailRes = r✝
right✝ : tailEnv = env'
⊢ env' = env
Tactic:
subst env'
State after:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝¹ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR : List (TypedArg Δ) × SSAEnv Δ
tailRes : List (TypedArg Δ)
tailEnv : SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail env =
    Except.ok (tailRes, tailEnv)
HInd : tailEnv = env
left✝ : { fst := headτ, snd := rRes } :: tailRes = r✝
⊢ tailEnv = env

State before:
case intro
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α✝ σ✝ : Type
ε✝ : σ✝ → Type
Δ : Dialect α✝ σ✝ ε✝
S : Semantics Δ
head : TypedSSAVal Δ
tail : List (TypedSSAVal Δ)
env : SSAEnv Δ
r✝ : List (TypedArg Δ)
headName : SSAVal
headτ : MLIRType Δ
r : MLIRType.eval headτ × SSAEnv Δ
rRes : MLIRType.eval headτ
left✝¹ :
  (match SSAEnv.get headName headτ env with
    | some v => v
    | none => default) =
    rRes
x✝ : Except (String × SSAEnv Δ) (List (TypedArg Δ) × SSAEnv Δ)
tailR : List (TypedArg Δ) × SSAEnv Δ
tailRes : List (TypedArg Δ)
tailEnv : SSAEnv Δ
HTailR :
  mapM
      (fun x s =>
        match TopM.get x.snd x.fst s with
        | Except.error err => Except.error err
        | Except.ok v => Except.ok ({ fst := x.snd, snd := v.fst }, v.snd))
      tail env =
    Except.ok (tailRes, tailEnv)
HInd : tailEnv = env
left✝ : { fst := headτ, snd := rRes } :: tailRes = r✝
⊢ tailEnv = env
Tactic:
assumption
State after:
no goals