blob: c02be80a762925fc7e41adf91f7b0ac34d71fdad [file]
/-
Copyright (c) 2026 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Leonardo de Moura
-/
module
prelude
public import Lean.Meta.Sym.Simp.Result
namespace Lean.Meta.Sym.Simp
public abbrev Simproc.andThen (f g : Simproc) : Simproc := fun e₁ => do
let r ← f e₁
match r with
| .step _ _ true | .rfl true => return r
| .rfl false => g e₁
| .step e₂ h₁ false => mkEqTransResult e₁ e₂ h₁ (← g e₂)
public instance : AndThen Simproc where
andThen f g := Simproc.andThen f (g ())
public abbrev Simproc.orElse (f g : Simproc) : Simproc := fun e₁ => do
let r ← f e₁
match r with
| .step _ _ _ | .rfl true => return r
| .rfl false => g e₁
public instance : OrElse Simproc where
orElse f g := Simproc.orElse f (g ())
end Lean.Meta.Sym.Simp