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
Model registry
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
Iris
stdpp
Commits
08fecbf6
Commit
08fecbf6
authored
3 years ago
by
Michael Sammler
Browse files
Options
Downloads
Patches
Plain Diff
Add bool_to_Z
parent
18dd6ca9
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!341
Add bool_to_Z
Pipeline
#58173
passed
3 years ago
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGELOG.md
+2
-1
2 additions, 1 deletion
CHANGELOG.md
theories/numbers.v
+15
-0
15 additions, 0 deletions
theories/numbers.v
with
17 additions
and
1 deletion
CHANGELOG.md
+
2
−
1
View file @
08fecbf6
...
...
@@ -3,7 +3,8 @@ API-breaking change is listed.
## std++ master
-
Add lemmas for lookup on
`mjoin`
for lists (by Michael Sammler).
-
Add
`bool_to_Z`
that converts true to 1 and false to 0. (by Michael Sammler)
-
Add lemmas for lookup on
`mjoin`
for lists. (by Michael Sammler)
-
Rename
`Is_true_false`
→
`Is_true_false_2`
and
`eq_None_ne_Some`
→
`eq_None_ne_Some_1`
.
The following
`sed`
script should perform most of the renaming
...
...
This diff is collapsed.
Click to expand it.
theories/numbers.v
+
15
−
0
View file @
08fecbf6
...
...
@@ -543,6 +543,21 @@ Proof. intros ?. rewrite <-Z.lxor_lor by done. by rewrite Z.add_nocarry_lxor. Qe
Lemma
Z_opp_lnot
a
:
-
a
-
1
=
Z
.
lnot
a
.
Proof
.
pose
proof
(
Z
.
add_lnot_diag
a
)
.
lia
.
Qed
.
(** ** [bool_to_Z] *)
Definition
bool_to_Z
(
b
:
bool
)
:
Z
:=
if
b
then
1
else
0
.
Lemma
bool_to_Z_bound
b
:
0
≤
bool_to_Z
b
<
2
.
Proof
.
destruct
b
;
simpl
;
lia
.
Qed
.
Lemma
bool_to_Z_eq_0
b
:
bool_to_Z
b
=
0
↔
b
=
false
.
Proof
.
destruct
b
;
naive_solver
.
Qed
.
Lemma
bool_to_Z_neq_0
b
:
bool_to_Z
b
≠
0
↔
b
=
true
.
Proof
.
destruct
b
;
naive_solver
.
Qed
.
Lemma
bool_to_Z_spec
b
n
:
Z
.
testbit
(
bool_to_Z
b
)
n
=
bool_decide
(
n
=
0
)
&&
b
.
Proof
.
by
destruct
b
,
n
.
Qed
.
Local
Close
Scope
Z_scope
.
(** * Injectivity of casts *)
...
...
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