Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide a convenience hypothesis with eqv assumptions in rewrite rules side-conditions #134

Merged
merged 2 commits into from
Dec 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/Rewriter/Rewriter/ProofsCommon.v
Original file line number Diff line number Diff line change
Expand Up @@ -3104,7 +3104,7 @@ Module Compilers.
{t} {p : pattern t} (r : @rewrite_rule_data t p)
: Prop
:= under_with_unification_resultT_relation_hetero
(fun _ => value_interp_related)
(fun _ e v => value_interp_related e v /\ Proper type.eqv v)
(fun evm => deep_rewrite_ruleTP_gen_good_relation)
(rew_replacement r)
(pattern_default_interp p).
Expand Down Expand Up @@ -3151,7 +3151,12 @@ Module Compilers.
intro H.
repeat (let x := fresh "x" in intro x; specialize (H x)).
intros X Y HXY.
pose proof (related_app_with_unification_resultT _ _ _ _ _ _ ltac:(eassumption) HXY) as H'.
assert (HYY : related_unification_resultT
(fun _ e v => value_interp_related e v /\ Proper type.eqv v) X Y).
{ eapply map_related_unification_resultT; [ | exact HXY ].
cbv beta; intros; split; try assumption.
eapply eqv_iff_value_interp_related1; eexists; eassumption. }
pose proof (related_app_with_unification_resultT _ _ _ _ _ _ ltac:(eassumption) HYY).
progress cbv [deep_rewrite_ruleTP_gen] in *.
match goal with
| [ H : option_eq ?R ?x ?y |- option_eq ?R' ?x' ?y' ]
Expand Down
1 change: 1 addition & 0 deletions src/Rewriter/Rewriter/ProofsCommonTactics.v
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ Module Compilers.
=> destruct (invert_expr.reflect_list ls) eqn:?
| [ |- context G[expr.interp_related_gen ?ident_interp (fun t : ?T => ?vii t ?b)] ]
=> progress change (fun t : T => vii t b) with (fun t : T => @Compile.value_interp_related _ _ _ ident_interp t b)
| [ H : _ /\ Proper _ _ |- _ ] => destruct H
end ].
Ltac preprocess base_interp_head := repeat preprocess_step base_interp_head.

Expand Down
Loading