Skip to content
Snippets Groups Projects
Commit 7827f688 authored by Ralf Jung's avatar Ralf Jung
Browse files

some playing around with wp_tactics

parent 26341006
No related branches found
No related tags found
No related merge requests found
...@@ -84,7 +84,7 @@ Section LiftingTests. ...@@ -84,7 +84,7 @@ Section LiftingTests.
True wp (Σ:=globalF Σ) E (let: "x" := Pred '42 in Pred "x") (λ v, v = '40). True wp (Σ:=globalF Σ) E (let: "x" := Pred '42 in Pred "x") (λ v, v = '40).
Proof. Proof.
intros E. intros E.
wp_focus (Pred '42); rewrite -Pred_spec -later_intro. wp_focus (Pred _); rewrite -Pred_spec -later_intro.
wp_rec. rewrite -Pred_spec -later_intro; auto with I. wp_rec. rewrite -Pred_spec -later_intro; auto with I.
Qed. Qed.
End LiftingTests. End LiftingTests.
...@@ -4,12 +4,12 @@ Import uPred. ...@@ -4,12 +4,12 @@ Import uPred.
Ltac wp_strip_later := Ltac wp_strip_later :=
match goal with match goal with
| |- _, _ => let H := fresh in intro H; wp_strip_later; revert H | |- _, _ => let H := fresh in intro H; wp_strip_later; revert H
| |- _ _ => etransitivity; [|apply later_intro] | |- _ _ => etransitivity; [|by apply later_intro]
end. end.
Ltac wp_bind K := Ltac wp_bind K :=
lazymatch eval hnf in K with lazymatch eval hnf in K with
| [] => idtac | [] => idtac
| _ => etransitivity; [|apply (wp_bind K)]; simpl | _ => etransitivity; [|by apply (wp_bind K)]; simpl
end. end.
Ltac wp_finish := Ltac wp_finish :=
let rec go := let rec go :=
...@@ -44,7 +44,6 @@ Tactic Notation "wp_bin_op" ">" := ...@@ -44,7 +44,6 @@ Tactic Notation "wp_bin_op" ">" :=
wp_bind K; etransitivity; [|eapply wp_bin_op; reflexivity]; wp_finish wp_bind K; etransitivity; [|eapply wp_bin_op; reflexivity]; wp_finish
end) end)
end. end.
Tactic Notation "wp_bin_op" := wp_bin_op>; wp_strip_later. Tactic Notation "wp_bin_op" := wp_bin_op>; wp_strip_later.
Tactic Notation "wp_un_op" ">" := Tactic Notation "wp_un_op" ">" :=
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