-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nicolas Nardino
committed
Feb 28, 2024
1 parent
af4b964
commit 2bf052b
Showing
2 changed files
with
33 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
From gitrees Require Import gitree lang_generic. | ||
From iris.proofmode Require Import base classes tactics environments. | ||
From iris.base_logic Require Import algebra. | ||
|
||
(* TODO: doc *) | ||
Ltac reshape_term α tac := | ||
match α with | ||
| (ofe_mor_car _ _ (λne x, ?k1 x) (ofe_mor_car _ _ (?k2 ?t) ?e)) => | ||
assert (AsVal e) by apply _; | ||
tac ((λne x, k1 (k2 x e)) t) | ||
| (ofe_mor_car _ _ (λne x, ?k1 x) (?k2 ?t)) => | ||
tac ((λne x, k1 (k2 x)) t) | ||
| (ofe_mor_car _ _ (?k ?t) ?e) => | ||
assert (AsVal e) by apply _; | ||
tac ((λne x, k x e) t) | ||
| (?k ?t) => | ||
tac ((λne x, k x) t) | ||
end. | ||
|
||
(* TODO: doc *) | ||
Ltac wp_ctx := | ||
match goal with | ||
|- envs_entails _ (wp _ ?e _ _ _) => | ||
reshape_term e ltac:(fun x => assert (e ≡ x) as -> by done) | ||
end. | ||
|
||
(* TODO: doc *) | ||
Ltac name_ctx k := | ||
match goal with | ||
|- envs_entails _ (wp _ (ofe_mor_car _ _ ?k1 _) _ _ _) => | ||
remember k1 as k | ||
end. |