Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
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
Simcha van Collem
Iris
Commits
97e8a9de
Commit
97e8a9de
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
More documentation of [coPset].
parent
b198ab3a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
prelude/coPset.v
+14
-5
14 additions, 5 deletions
prelude/coPset.v
with
14 additions
and
5 deletions
prelude/coPset.v
+
14
−
5
View file @
97e8a9de
(* Copyright (c) 2012-2015, Robbert Krebbers. *)
(* This file is distributed under the terms of the BSD license. *)
(** This files implements an efficient implementation of finite/cofinite sets
of positive binary naturals [positive]. *)
(** This files implements the type [coPset] of efficient finite/cofinite sets
of positive binary naturals [positive]. These sets are:
- Closed under union, intersection and set complement.
- Closed under splitting of cofinite sets.
Also, they enjoy various nice properties, such as decidable equality and set
membership, as well as extensional equality (i.e. [X = Y ↔ ∀ x, x ∈ X ↔ x ∈ Y]).
Since [positive]s are bitstrings, we encode [coPset]s as trees that correspond
to the decision function that map bitstrings to bools. *)
From
iris
.
prelude
Require
Export
collections
.
From
iris
.
prelude
Require
Import
pmap
gmap
mapset
.
Local
Open
Scope
positive_scope
.
...
...
@@ -228,9 +237,9 @@ Proof.
refine
(
cast_if
(
decide
(
coPset_finite
(
`
X
))));
by
rewrite
coPset_finite_spec
.
Defined
.
(** * Pick element from infi
ti
nite sets *)
(*
just
depth-first search
: using this to pick elements
results in very
unbalanced
trees. *)
(** * Pick element from infinite sets *)
(*
Implemented using
depth-first search
, which
results in very
unbalanced
trees. *)
Fixpoint
coPpick_raw
(
t
:
coPset_raw
)
:
option
positive
:=
match
t
with
|
coPLeaf
true
|
coPNode
true
_
_
=>
Some
1
...
...
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