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

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
β : Type
Δ : Dialect α σ ε
ma : TopM Δ Unit
mb : TopM Δ β
env : SSAEnv Δ
⊢ run
      (do
        ma
        mb)
      env =
    match run ma env with
    | Except.ok (PUnit.unit, env') => run mb env'
    | Except.error e => Except.error e
Tactic:
simp[run]
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
β : Type
Δ : Dialect α σ ε
ma : TopM Δ Unit
mb : TopM Δ β
env : SSAEnv Δ
⊢ (do
      let p ← StateT.run ma env
      StateT.run mb p.snd) =
    match StateT.run ma env with
    | Except.ok (PUnit.unit, env') => StateT.run mb env'
    | Except.error e => Except.error e

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
β : Type
Δ : Dialect α σ ε
ma : TopM Δ Unit
mb : TopM Δ β
env : SSAEnv Δ
⊢ (do
      let p ← StateT.run ma env
      StateT.run mb p.snd) =
    match StateT.run ma env with
    | Except.ok (PUnit.unit, env') => StateT.run mb env'
    | Except.error e => Except.error e
Tactic:
cases H : StateT.run ma env
State after:
case error
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
β : Type
Δ : Dialect α σ ε
ma : TopM Δ Unit
mb : TopM Δ β
env : SSAEnv Δ
a✝ : String × SSAEnv Δ
H : StateT.run ma env = Except.error a✝
⊢ (do
      let p ← Except.error a✝
      StateT.run mb p.snd) =
    match Except.error a✝ with
    | Except.ok (PUnit.unit, env') => StateT.run mb env'
    | Except.error e => Except.error e

case ok
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
β : Type
Δ : Dialect α σ ε
ma : TopM Δ Unit
mb : TopM Δ β
env : SSAEnv Δ
a✝ : Unit × SSAEnv Δ
H : StateT.run ma env = Except.ok a✝
⊢ (do
      let p ← Except.ok a✝
      StateT.run mb p.snd) =
    match Except.ok a✝ with
    | Except.ok (PUnit.unit, env') => StateT.run mb env'
    | Except.error e => Except.error e

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
β : Type
Δ : Dialect α σ ε
ma : TopM Δ Unit
mb : TopM Δ β
env : SSAEnv Δ
err : String × SSAEnv Δ
H : StateT.run ma env = Except.error err
⊢ (do
      let p ← Except.error err
      StateT.run mb p.snd) =
    match Except.error err with
    | Except.ok (PUnit.unit, env') => StateT.run mb env'
    | Except.error e => Except.error e
Tactic:
case error err => {
  simp[H];
  simp[bind, Except.bind];
}
State after:
no goals

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
β : Type
Δ : Dialect α σ ε
ma : TopM Δ Unit
mb : TopM Δ β
env : SSAEnv Δ
out : Unit × SSAEnv Δ
H : StateT.run ma env = Except.ok out
⊢ (do
      let p ← Except.ok out
      StateT.run mb p.snd) =
    match Except.ok out with
    | Except.ok (PUnit.unit, env') => StateT.run mb env'
    | Except.error e => Except.error e
Tactic:
case ok out => {
  simp[H, bind, Except.bind];
}
State after:
no goals

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
β : Type
Δ : Dialect α σ ε
ma : TopM Δ Unit
mb : TopM Δ β
env : SSAEnv Δ
err : String × SSAEnv Δ
H : StateT.run ma env = Except.error err
⊢ (do
      let p ← Except.error err
      StateT.run mb p.snd) =
    match Except.error err with
    | Except.ok (PUnit.unit, env') => StateT.run mb env'
    | Except.error e => Except.error e
Tactic:
simp[H]
State after:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
β : Type
Δ : Dialect α σ ε
ma : TopM Δ Unit
mb : TopM Δ β
env : SSAEnv Δ
err : String × SSAEnv Δ
H : StateT.run ma env = Except.error err
⊢ (do
      let p ← Except.error err
      StateT.run mb p.snd) =
    Except.error err

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
β : Type
Δ : Dialect α σ ε
ma : TopM Δ Unit
mb : TopM Δ β
env : SSAEnv Δ
err : String × SSAEnv Δ
H : StateT.run ma env = Except.error err
⊢ (do
      let p ← Except.error err
      StateT.run mb p.snd) =
    Except.error err
Tactic:
simp[bind, Except.bind]
State after:
no goals

State before:
α₁ σ₁ : Type
ε₁ : σ₁ → Type
δ₁ : Dialect α₁ σ₁ ε₁
α₂ σ₂ : Type
ε₂ : σ₂ → Type
δ₂ : Dialect α₂ σ₂ ε₂
α σ : Type
ε : σ → Type
β : Type
Δ : Dialect α σ ε
ma : TopM Δ Unit
mb : TopM Δ β
env : SSAEnv Δ
out : Unit × SSAEnv Δ
H : StateT.run ma env = Except.ok out
⊢ (do
      let p ← Except.ok out
      StateT.run mb p.snd) =
    match Except.ok out with
    | Except.ok (PUnit.unit, env') => StateT.run mb env'
    | Except.error e => Except.error e
Tactic:
simp[H, bind, Except.bind]
State after:
no goals