Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stdpp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
46
Issues
46
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Iris
stdpp
Commits
32b2e751
Commit
32b2e751
authored
Jan 16, 2016
by
Robbert Krebbers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pick element from infinite coPset.
parent
36bfee17
Changes
1
Hide whitespace changes
Inline
Sidebyside
Showing
1 changed file
with
31 additions
and
0 deletions
+31
0
theories/co_pset.v
theories/co_pset.v
+31
0
No files found.
theories/co_pset.v
View file @
32b2e751
...
...
@@ 210,6 +210,37 @@ Proof.
refine
(
cast_if
(
decide
(
coPset_finite
(
`
X
))))
;
by
rewrite
coPset_finite_spec
.
Defined
.
(** * Pick element from infitinite sets *)
(* just depthfirst search: using this to pick elements results in very
unbalanced trees. *)
Fixpoint
coPpick_raw
(
t
:
coPset_raw
)
:
option
positive
:
=
match
t
with

coPLeaf
true

coPNode
true
_
_
=>
Some
1

coPLeaf
false
=>
None

coPNode
false
l
r
=>
match
coPpick_raw
l
with

Some
i
=>
Some
(
i
~
0
)

None
=>
(~
1
)
<$>
coPpick_raw
r
end
end
.
Definition
coPpick
(
X
:
coPset
)
:
positive
:
=
from_option
1
(
coPpick_raw
(
`
X
)).
Lemma
coPpick_raw_elem_of
t
i
:
coPpick_raw
t
=
Some
i
→
e_of
i
t
.
Proof
.
revert
i
;
induction
t
as
[[][]
l
?
r
]
;
intros
i
?
;
simplify_equality'
;
auto
.
destruct
(
coPpick_raw
l
)
;
simplify_option_equality
;
auto
.
Qed
.
Lemma
coPpick_raw_None
t
:
coPpick_raw
t
=
None
→
coPset_finite
t
.
Proof
.
induction
t
as
[[][]
l
?
r
]
;
intros
i
;
simplify_equality'
;
auto
.
destruct
(
coPpick_raw
l
)
;
simplify_option_equality
;
auto
.
Qed
.
Lemma
coPpick_elem_of
X
:
¬
set_finite
X
→
coPpick
X
∈
X
.
Proof
.
destruct
X
as
[
t
?]
;
unfold
coPpick
;
destruct
(
coPpick_raw
_
)
as
[
j
]
eqn
:
?.
*
by
intros
;
apply
coPpick_raw_elem_of
.
*
by
intros
[]
;
apply
coPset_finite_spec
,
coPpick_raw_None
.
Qed
.
(** * Conversion to psets *)
Fixpoint
to_Pset_raw
(
t
:
coPset_raw
)
:
Pmap_raw
()
:
=
match
t
with
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment