Skip to content
Snippets Groups Projects
Commit 5415ad30 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Merge branch 'ralf/solve_ndisj' into 'master'

solve_ndisj: handle goals containing _ ∖ _ ∖ _

See merge request !303
parents cbf06f7e f1a4f71c
No related branches found
No related tags found
1 merge request!303solve_ndisj: handle goals containing _ ∖ _ ∖ _
Pipeline #50918 passed
...@@ -112,7 +112,8 @@ API-breaking change is listed. ...@@ -112,7 +112,8 @@ API-breaking change is listed.
- Add `mk_evar` tactic to generate evars (intended as a more useful replacement - Add `mk_evar` tactic to generate evars (intended as a more useful replacement
for Coq's `evar` tactic). for Coq's `evar` tactic).
- Make `solve_ndisj` able to solve more goals of the form `_ ⊆ ⊤ ∖ _`, - Make `solve_ndisj` able to solve more goals of the form `_ ⊆ ⊤ ∖ _`,
`_ ∖ _ ## _`, `_ ## _ ∖ _`, as well as `_ ## ∅` and `∅ ## _`. `_ ∖ _ ## _`, `_ ## _ ∖ _`, as well as `_ ## ∅` and `∅ ## _`,
and goals containing `_ ∖ _ ∖ _`.
- Improvements to curry: - Improvements to curry:
+ Swap names of `curry`/`uncurry`, `curry3`/`uncurry3`, `curry4`/`uncurry4`, + Swap names of `curry`/`uncurry`, `curry3`/`uncurry3`, `curry4`/`uncurry4`,
`gmap_curry`/`gmap_uncurry`, and `hcurry`/`huncurry` to be consistent with `gmap_curry`/`gmap_uncurry`, and `hcurry`/`huncurry` to be consistent with
......
...@@ -43,3 +43,7 @@ Proof. solve_ndisj. Qed. ...@@ -43,3 +43,7 @@ Proof. solve_ndisj. Qed.
Lemma test9 N1 N2 : Lemma test9 N1 N2 :
(N1 N2) ⊆@{coPset} N1.@"counter" N1.@"state" N2. (N1 N2) ⊆@{coPset} N1.@"counter" N1.@"state" N2.
Proof. solve_ndisj. Qed. Proof. solve_ndisj. Qed.
Lemma test10 N1 N2 E :
N1 E ## N1 N2 E.
Proof. solve_ndisj. Qed.
...@@ -97,13 +97,7 @@ Global Hint Resolve nclose_subseteq' | 100 : ndisj. ...@@ -97,13 +97,7 @@ Global Hint Resolve nclose_subseteq' | 100 : ndisj.
(** Rules for goals of the form [_ ## _] *) (** Rules for goals of the form [_ ## _] *)
(** The base rule that we want to ultimately get down to. *) (** The base rule that we want to ultimately get down to. *)
Global Hint Extern 0 (_ ## _) => apply ndot_ne_disjoint; congruence : ndisj. Global Hint Extern 0 (_ ## _) => apply ndot_ne_disjoint; congruence : ndisj.
(** Fallback, loses lots of information but lets other rules make progress. (** Trivial cases. *)
Tests show trying [disjoint_difference_l1] first gives better performance. *)
Local Definition coPset_disjoint_difference_l1 := disjoint_difference_l1 (C:=coPset).
Global Hint Resolve coPset_disjoint_difference_l1 | 50 : ndisj.
Local Definition coPset_disjoint_difference_l2 := disjoint_difference_l2 (C:=coPset).
Global Hint Resolve coPset_disjoint_difference_l2 | 100 : ndisj.
Global Hint Resolve ndot_preserve_disjoint_l ndot_preserve_disjoint_r | 100 : ndisj.
Local Definition coPset_disjoint_empty_l := disjoint_empty_l (C:=coPset). Local Definition coPset_disjoint_empty_l := disjoint_empty_l (C:=coPset).
Global Hint Resolve coPset_disjoint_empty_l : ndisj. Global Hint Resolve coPset_disjoint_empty_l : ndisj.
Local Definition coPset_disjoint_empty_r := disjoint_empty_r (C:=coPset). Local Definition coPset_disjoint_empty_r := disjoint_empty_r (C:=coPset).
...@@ -115,6 +109,20 @@ Global Hint Extern 10 (_ ## (_ ∖ _)) => ...@@ -115,6 +109,20 @@ Global Hint Extern 10 (_ ## (_ ∖ _)) =>
| |- (_ _) ## _ => fail (* ∖ on both sides, leave it be *) | |- (_ _) ## _ => fail (* ∖ on both sides, leave it be *)
| |- _ => symmetry | |- _ => symmetry
end : ndisj. end : ndisj.
(** Before we apply disjoint_difference, let's make sure we normalize the goal
to [_ ∖ (_ ∪ _)]. *)
Local Lemma coPset_difference_difference (X1 X2 X3 Y : coPset) :
X1 (X2 X3) ## Y
X1 X2 X3 ## Y.
Proof. set_solver. Qed.
Global Hint Resolve coPset_difference_difference | 20 : ndisj.
(** Fallback, loses lots of information but lets other rules make progress.
Tests show trying [disjoint_difference_l1] first gives better performance. *)
Local Definition coPset_disjoint_difference_l1 := disjoint_difference_l1 (C:=coPset).
Global Hint Resolve coPset_disjoint_difference_l1 | 50 : ndisj.
Local Definition coPset_disjoint_difference_l2 := disjoint_difference_l2 (C:=coPset).
Global Hint Resolve coPset_disjoint_difference_l2 | 100 : ndisj.
Global Hint Resolve ndot_preserve_disjoint_l ndot_preserve_disjoint_r | 100 : ndisj.
Ltac solve_ndisj := Ltac solve_ndisj :=
repeat match goal with repeat 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