Skip to content
Snippets Groups Projects
Commit ab9e7cc8 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Improve the csimpl tactic, this gives a minor overall speedup.

parent 0cf35200
No related branches found
No related tags found
No related merge requests found
...@@ -171,27 +171,29 @@ Ltac fold_classes := ...@@ -171,27 +171,29 @@ Ltac fold_classes :=
repeat change (@alter _ _ _ (@alter _ _ _ F)) with (@alter _ _ _ F) repeat change (@alter _ _ _ (@alter _ _ _ F)) with (@alter _ _ _ F)
end end
end. end.
Ltac fold_classes_hyps := Ltac fold_classes_hyps H :=
repeat match goal with repeat match type of H with
| _ : appcontext [ ?F ] |- _ => | appcontext [ ?F ] =>
progress match type of F with progress match type of F with
| FMap _ => | FMap _ =>
change F with (@fmap _ F) in *; change F with (@fmap _ F) in H;
repeat change (@fmap _ (@fmap _ F)) with (@fmap _ F) in * repeat change (@fmap _ (@fmap _ F)) with (@fmap _ F) in H
| MBind _ => | MBind _ =>
change F with (@mbind _ F) in *; change F with (@mbind _ F) in H;
repeat change (@mbind _ (@mbind _ F)) with (@mbind _ F) in * repeat change (@mbind _ (@mbind _ F)) with (@mbind _ F) in H
| OMap _ => | OMap _ =>
change F with (@omap _ F) in *; change F with (@omap _ F) in H;
repeat change (@omap _ (@omap _ F)) with (@omap _ F) in * repeat change (@omap _ (@omap _ F)) with (@omap _ F) in H
| Alter _ _ _ => | Alter _ _ _ =>
change F with (@alter _ _ _ F) in *; change F with (@alter _ _ _ F) in H;
repeat change (@alter _ _ _ (@alter _ _ _ F)) with (@alter _ _ _ F) in * repeat change (@alter _ _ _ (@alter _ _ _ F)) with (@alter _ _ _ F) in H
end end
end. end.
Tactic Notation "csimpl" "in" "*" := Tactic Notation "csimpl" "in" hyp(H) :=
try (progress simpl in *; fold_classes; fold_classes_hyps). try (progress simpl in H; fold_classes_hyps H).
Tactic Notation "csimpl" := try (progress simpl; fold_classes). Tactic Notation "csimpl" := try (progress simpl; fold_classes).
Tactic Notation "csimpl" "in" "*" :=
repeat_on_hyps (fun H => csimpl in H); csimpl.
Ltac simplify_equality := repeat Ltac simplify_equality := repeat
match goal with match goal with
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment