Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
stdpp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adam
stdpp
Commits
9d08f65f
Commit
9d08f65f
authored
5 years ago
by
Ralf Jung
Browse files
Options
Downloads
Plain Diff
Merge branch 'ralf/solve_ndisj' into 'master'
make solve_ndisj more powerful Closes
#34
See merge request
!75
parents
3bf046f2
5695ee20
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
tests/solve_ndisj.ref
+0
-3
0 additions, 3 deletions
tests/solve_ndisj.ref
tests/solve_ndisj.v
+1
-8
1 addition, 8 deletions
tests/solve_ndisj.v
theories/namespaces.v
+19
-17
19 additions, 17 deletions
theories/namespaces.v
theories/sets.v
+14
-0
14 additions, 0 deletions
theories/sets.v
with
34 additions
and
28 deletions
tests/solve_ndisj.ref
+
0
−
3
View file @
9d08f65f
The command has indeed failed with message:
Ltac call to "solve_ndisj" failed.
No applicable tactic.
This diff is collapsed.
Click to expand it.
tests/solve_ndisj.v
+
1
−
8
View file @
9d08f65f
From
stdpp
Require
Import
namespaces
strings
.
From
stdpp
Require
Import
namespaces
strings
.
Set
Ltac
Backtrace
.
Lemma
test1
(
N1
N2
:
namespace
)
:
Lemma
test1
(
N1
N2
:
namespace
)
:
N1
##
N2
→
↑
N1
⊆@
{
coPset
}
⊤
∖
↑
N2
.
N1
##
N2
→
↑
N1
⊆@
{
coPset
}
⊤
∖
↑
N2
.
Proof
.
solve_ndisj
.
Qed
.
Proof
.
solve_ndisj
.
Qed
.
...
@@ -20,9 +18,4 @@ Proof. solve_ndisj. Qed.
...
@@ -20,9 +18,4 @@ Proof. solve_ndisj. Qed.
Lemma
test5
(
N1
N2
:
namespace
)
:
Lemma
test5
(
N1
N2
:
namespace
)
:
⊤
∖
↑
N1
∖
↑
N2
⊆@
{
coPset
}
⊤
∖
↑
N1
.
@
"x"
∖
↑
N2
∖
↑
N1
.
@
"y"
.
⊤
∖
↑
N1
∖
↑
N2
⊆@
{
coPset
}
⊤
∖
↑
N1
.
@
"x"
∖
↑
N2
∖
↑
N1
.
@
"y"
.
Proof
.
Proof
.
solve_ndisj
.
Qed
.
Fail
solve_ndisj
.
(* FIXME: it should be able to solve this. *)
apply
namespace_subseteq_difference
.
{
apply
ndot_preserve_disjoint_r
.
set_solver
.
}
solve_ndisj
.
Qed
.
This diff is collapsed.
Click to expand it.
theories/namespaces.v
+
19
−
17
View file @
9d08f65f
...
@@ -66,35 +66,37 @@ Section namespace.
...
@@ -66,35 +66,37 @@ Section namespace.
Lemma
ndot_preserve_disjoint_r
N
E
x
:
E
##
↑
N
→
E
##
↑
N
.
@
x
.
Lemma
ndot_preserve_disjoint_r
N
E
x
:
E
##
↑
N
→
E
##
↑
N
.
@
x
.
Proof
.
intros
.
by
apply
symmetry
,
ndot_preserve_disjoint_l
.
Qed
.
Proof
.
intros
.
by
apply
symmetry
,
ndot_preserve_disjoint_l
.
Qed
.
Lemma
namespace_subseteq_difference
E1
E2
E3
:
E1
##
E3
→
E1
⊆
E2
→
E1
⊆
E2
∖
E3
.
Proof
.
set_solver
.
Qed
.
Lemma
namespace_subseteq_difference_l
E1
E2
E3
:
E1
⊆
E3
→
E1
∖
E2
⊆
E3
.
Proof
.
set_solver
.
Qed
.
Lemma
ndisj_difference_l
E
N1
N2
:
↑
N2
⊆
(
↑
N1
:
coPset
)
→
E
∖
↑
N1
##
↑
N2
.
Proof
.
set_solver
.
Qed
.
End
namespace
.
End
namespace
.
(* The hope is that registering these will suffice to solve most goals
(*
*
The hope is that registering these will suffice to solve most goals
of the forms:
of the forms:
- [N1 ## N2]
- [N1 ## N2]
- [↑N1 ⊆ E ∖ ↑N2 ∖ .. ∖ ↑Nn]
- [↑N1 ⊆ E ∖ ↑N2 ∖ .. ∖ ↑Nn]
- [E1 ∖ ↑N1 ⊆ E2 ∖ ↑N2 ∖ .. ∖ ↑Nn] *)
- [E1 ∖ ↑N1 ⊆ E2 ∖ ↑N2 ∖ .. ∖ ↑Nn] *)
Create
HintDb
ndisj
.
Create
HintDb
ndisj
.
Hint
Resolve
namespace_subseteq_difference
:
ndisj
.
Hint
Extern
0
(_
##
_)
=>
apply
ndot_ne_disjoint
;
congruence
:
ndisj
.
(** Rules for goals of the form [_ ⊆ _] *)
Hint
Resolve
n
d
ot
_preserve_disjoint_l
ndot_preserve_disjoint_r
:
ndisj
.
(** If-and-only-if rules. Well,
not
quite, but for the fragment we are
Hint
Resolve
nclose_subseteq'
ndisj_difference_l
:
ndisj
.
considering they are. *)
Hint
Resolve
namespace_
subseteq_difference_
l
|
100
:
ndisj
.
Hint
Resolve
(
subseteq_difference_
r
(
A
:=
positive
)
(
C
:=
coPset
))
:
ndisj
.
Hint
Resolve
(
empty_subseteq
(
A
:=
positive
)
(
C
:=
coPset
))
:
ndisj
.
Hint
Resolve
(
empty_subseteq
(
A
:=
positive
)
(
C
:=
coPset
))
:
ndisj
.
Hint
Resolve
(
union_least
(
A
:=
positive
)
(
C
:=
coPset
))
:
ndisj
.
Hint
Resolve
(
union_least
(
A
:=
positive
)
(
C
:=
coPset
))
:
ndisj
.
(** Fallback, loses lots of information but lets other rules make progress. *)
Hint
Resolve
(
subseteq_difference_l
(
A
:=
positive
)
(
C
:=
coPset
))
|
100
:
ndisj
.
Hint
Resolve
nclose_subseteq'
|
100
:
ndisj
.
(** Rules for goals of the form [_ ## _] *)
(** The base rule that we want to ultimately get down to. *)
Hint
Extern
0
(_
##
_)
=>
apply
ndot_ne_disjoint
;
congruence
:
ndisj
.
(** Fallback, loses lots of information but lets other rules make progress.
Tests show trying [disjoint_difference_l1] first gives better performance. *)
Hint
Resolve
(
disjoint_difference_l1
(
A
:=
positive
)
(
C
:=
coPset
))
|
50
:
ndisj
.
Hint
Resolve
(
disjoint_difference_l2
(
A
:=
positive
)
(
C
:=
coPset
))
|
100
:
ndisj
.
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
|
H
:
_
∪
_
⊆
_
|
-
_
=>
apply
union_subseteq
in
H
as
[??]
|
H
:
_
∪
_
⊆
_
|
-
_
=>
apply
union_subseteq
in
H
as
[??]
end
;
end
;
solve
[
eauto
1
0
with
ndisj
]
.
solve
[
eauto
1
2
with
ndisj
]
.
Hint
Extern
1000
=>
solve_ndisj
:
solve_ndisj
.
Hint
Extern
1000
=>
solve_ndisj
:
solve_ndisj
.
This diff is collapsed.
Click to expand it.
theories/sets.v
+
14
−
0
View file @
9d08f65f
...
@@ -653,9 +653,23 @@ Section set.
...
@@ -653,9 +653,23 @@ Section set.
Lemma
difference_mono_r
X1
X2
Y
:
X1
⊆
X2
→
X1
∖
Y
⊆
X2
∖
Y
.
Lemma
difference_mono_r
X1
X2
Y
:
X1
⊆
X2
→
X1
∖
Y
⊆
X2
∖
Y
.
Proof
.
set_solver
.
Qed
.
Proof
.
set_solver
.
Qed
.
Lemma
subseteq_difference_r
X
Y1
Y2
:
X
##
Y2
→
X
⊆
Y1
→
X
⊆
Y1
∖
Y2
.
Proof
.
set_solver
.
Qed
.
Lemma
subseteq_difference_l
X1
X2
Y
:
X1
⊆
Y
→
X1
∖
X2
⊆
Y
.
Proof
.
set_solver
.
Qed
.
(** Disjointness *)
(** Disjointness *)
Lemma
disjoint_intersection
X
Y
:
X
##
Y
↔
X
∩
Y
≡
∅.
Lemma
disjoint_intersection
X
Y
:
X
##
Y
↔
X
∩
Y
≡
∅.
Proof
.
set_solver
.
Qed
.
Proof
.
set_solver
.
Qed
.
Lemma
disjoint_difference_l1
X1
X2
Y
:
Y
⊆
X2
→
X1
∖
X2
##
Y
.
Proof
.
set_solver
.
Qed
.
Lemma
disjoint_difference_l2
X1
X2
Y
:
X1
##
Y
→
X1
∖
X2
##
Y
.
Proof
.
set_solver
.
Qed
.
Lemma
disjoint_difference_r1
X
Y1
Y2
:
X
⊆
Y2
→
X
##
Y1
∖
Y2
.
Proof
.
set_solver
.
Qed
.
Lemma
disjoint_difference_r2
X
Y1
Y2
:
X
##
Y1
→
X
##
Y1
∖
Y2
.
Proof
.
set_solver
.
Qed
.
Section
leibniz
.
Section
leibniz
.
Context
`{
!
LeibnizEquiv
C
}
.
Context
`{
!
LeibnizEquiv
C
}
.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment