forked from izgzhen/iris-coq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreduction.v
37 lines (35 loc) · 1.51 KB
/
reduction.v
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From iris.bi Require Import bi telescopes.
From iris.proofmode Require Import base environments.
(** Called by all tactics to perform computation to lookup items in the
context. We avoid reducing anything user-visible here to make sure we
do not reduce e.g. before unification happens in [iApply].*)
Declare Reduction pm_eval := cbv [
(* base *)
base.beq base.Pos_succ base.ascii_beq base.string_beq base.positive_beq base.ident_beq
(* environments *)
env_lookup env_lookup_delete env_delete env_app env_replace
env_dom env_intuitionistic env_spatial env_counter env_spatial_is_nil envs_dom
envs_lookup envs_lookup_delete envs_delete envs_snoc envs_app
envs_simple_replace envs_replace envs_split
envs_clear_spatial envs_clear_persistent envs_incr_counter
envs_split_go envs_split env_to_prop
(* PM option combinators *)
pm_option_bind pm_from_option pm_option_fun
].
Ltac pm_eval t :=
eval pm_eval in t.
Ltac pm_reduce :=
match goal with |- ?u => let v := pm_eval u in change v end.
Ltac pm_reflexivity := pm_reduce; exact eq_refl.
(** Called by many tactics for redexes that are created by instantiation.
This cannot create any envs redexes so we just do the cbn part. *)
Declare Reduction pm_prettify := cbn [
(* telescope combinators *)
tele_fold tele_bind tele_app
(* BI connectives *)
bi_persistently_if bi_affinely_if bi_intuitionistically_if
bi_wandM sbi_laterN
bi_tforall bi_texist
].
Ltac pm_prettify :=
match goal with |- ?u => let v := eval pm_prettify in u in change v end.