@@ -66,6 +66,7 @@ data Tactic = Attack
6666 | Forall Name Raw
6767 | LetBind Name Raw Raw
6868 | Rewrite Raw
69+ | Equiv Raw
6970 | PatVar Name
7071 | PatBind Name
7172 | Focus Name
@@ -539,6 +540,13 @@ rewrite tm ctxt env (Bind x (Hole t) xp@(P _ x' _)) | x == x' =
539540 rname = MN 0 "replaced"
540541rewrite _ _ _ _ = fail "Can't rewrite here"
541542
543+equiv :: Raw -> RunTactic
544+equiv tm ctxt env (Bind x (Hole t) sc) =
545+ do (tmv, tmt) <- lift $ check ctxt env tm
546+ lift $ converts ctxt env tmv t
547+ return $ Bind x (Hole tmv) sc
548+equiv tm ctxt env _ = fail "Can't equiv here"
549+
542550patbind :: Name -> RunTactic
543551patbind n ctxt env (Bind x (Hole t) (P _ x' _)) | x == x' =
544552 do let t' = case t of
@@ -724,6 +732,7 @@ process t h = tactic (Just h) (mktac t)
724732 mktac (Forall n t) = forall n t
725733 mktac (LetBind n t v) = letbind n t v
726734 mktac (Rewrite t) = rewrite t
735+ mktac (Equiv t) = equiv t
727736 mktac (PatVar n) = patvar n
728737 mktac (PatBind n) = patbind n
729738 mktac (CheckIn r) = check_in r