Commit 1d7df046 authored by Michael Sammler's avatar Michael Sammler
Browse files

different liUnfoldLetGoal

parent 351e5533
Pipeline #57786 canceled with stage
in 14 seconds
...@@ -279,6 +279,7 @@ Ltac liEnforceInvariant := ...@@ -279,6 +279,7 @@ Ltac liEnforceInvariant :=
) )
end. end.
(*
Ltac liFresh := Ltac liFresh :=
lazymatch goal with lazymatch goal with
| [ H := Envs _ _ ?n |- _ ] => | [ H := Envs _ _ ?n |- _ ] =>
...@@ -295,16 +296,30 @@ Ltac liFresh := ...@@ -295,16 +296,30 @@ Ltac liFresh :=
end in end in
constr:(IAnon n) constr:(IAnon n)
end. end.
*)
Tactic Notation "li_let_bind" constr(T) tactic3(tac) :=
try (assert_fails (is_var T);
let H := fresh "GOAL" in
pose H := (LET_ID T);
let G := tac H in
change_no_check G).
Ltac liUnfoldLetGoal := Ltac liUnfoldLetGoal :=
match goal with lazymatch goal with
| |- envs_entails _ ?P => | |- envs_entails ?Δ ?P =>
let rec go P tac := let h := get_head P in
match P with is_var h;
| ?Q ?R => go Q tac let u := eval unfold h in h in
| _ => is_var P; tac P lazymatch u with
end in | LET_ID ?G =>
go P ltac:(fun P => unfold LET_ID in P; unfold P; try clear P) lazymatch P with
| context C [h] =>
let X := context C [G] in
change_no_check (envs_entails Δ G);
try clear h
end
end
end. end.
Ltac liUnfoldLetsInContext := Ltac liUnfoldLetsInContext :=
......
...@@ -95,18 +95,17 @@ End automation. ...@@ -95,18 +95,17 @@ End automation.
Ltac liRIntroduceLetInGoal := Ltac liRIntroduceLetInGoal :=
lazymatch goal with lazymatch goal with
| |- @envs_entails ?PROP ?Δ ?P => | |- @envs_entails ?PROP ?Δ ?P =>
let H := fresh "GOAL" in
lazymatch P with lazymatch P with
| @bi_wand ?PROP ?Q ?T => | @bi_wand ?PROP ?Q ?T =>
pose H := (LET_ID T); change_no_check (@envs_entails PROP Δ (@bi_wand PROP Q H)) li_let_bind T (fun H => constr:(@envs_entails PROP Δ (@bi_wand PROP Q H)))
| @typed_val_expr ?Σ ?tG ?e ?T => | @typed_val_expr ?Σ ?tG ?e ?T =>
pose (H := LET_ID T); change_no_check (@envs_entails PROP Δ (@typed_val_expr Σ tG e H)) li_let_bind T (fun H => constr:(@envs_entails PROP Δ (@typed_val_expr Σ tG e H)))
| @typed_write ?Σ ?tG ?b ?e ?ot ?v ?ty ?Mov ?T => | @typed_write ?Σ ?tG ?b ?e ?ot ?v ?ty ?Mov ?T =>
pose (H := LET_ID T); change_no_check (@envs_entails PROP Δ (@typed_write Σ tG b e ot v ty Mov H)) li_let_bind T (fun H => constr:(@envs_entails PROP Δ (@typed_write Σ tG b e ot v ty Mov H)))
| @typed_place ?Σ ?tG ?P ?l1 ?β1 ?ty1 ?T => | @typed_place ?Σ ?tG ?P ?l1 ?β1 ?ty1 ?T =>
pose (H := LET_ID T); change_no_check (@envs_entails PROP Δ (@typed_place Σ tG P l1 β1 ty1 H)) li_let_bind T (fun H => constr:(@envs_entails PROP Δ (@typed_place Σ tG P l1 β1 ty1 H)))
| @typed_bin_op ?Σ ?tG ?v1 ?P1 ?v2 ?P2 ?op ?ot1 ?ot2 ?T => | @typed_bin_op ?Σ ?tG ?v1 ?P1 ?v2 ?P2 ?op ?ot1 ?ot2 ?T =>
pose (H := LET_ID T); change_no_check (@envs_entails PROP Δ (@typed_bin_op Σ tG v1 P1 v2 P2 op ot1 ot2 H)) li_let_bind T (fun H => constr:(@envs_entails PROP Δ (@typed_bin_op Σ tG v1 P1 v2 P2 op ot1 ot2 H)))
end end
end. end.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment