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
Merge requests
!543
Cleanup bitblast_mod after dropping support for Coq 8.13
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Cleanup bitblast_mod after dropping support for Coq 8.13
msammler/cleanup_bitblast_mod
into
master
Overview
0
Commits
1
Pipelines
1
Changes
1
Merged
Michael Sammler
requested to merge
msammler/cleanup_bitblast_mod
into
master
1 year ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
294b7b57
1 commit,
1 year ago
1 file
+
2
−
9
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
stdpp_unstable/bitblast.v
+
2
−
9
Options
@@ -372,17 +372,10 @@ Global Hint Resolve bitblast_setbit | 10 : bitblast.
@@ -372,17 +372,10 @@ Global Hint Resolve bitblast_setbit | 10 : bitblast.
Lemma
bitblast_mod
z1
z2
z2'
n
b1
:
Lemma
bitblast_mod
z1
z2
z2'
n
b1
:
IsPowerOfTwo
z2
z2'
→
IsPowerOfTwo
z2
z2'
→
Bitblast
z1
n
b1
→
Bitblast
z1
n
b1
→
(* Coq 8.14 changed the definition of [x `mod` 0] from [0] to [x],
Bitblast
(
z1
`
mod
`
z2
)
n
((
bool_decide
(
z2'
<
0
∧
0
≤
n
)
||
bool_decide
(
n
<
z2'
))
&&
b1
)
.
so we have to use the following definition to be compatible with
both Coq 8.12 and Coq 8.14. The [z2' < 0] case is hopefully not
common in practice. *)
(* TODO: After dropping support for Coq 8.14, switch to the following definition: *)
(* Bitblast (z1 `mod` z2) n ((bool_decide (z2' < 0 ∧ 0 ≤ n) || bool_decide (n < z2')) && b1). *)
Bitblast
(
z1
`
mod
`
z2
)
n
((
bool_decide
(
z2'
<
0
∧
0
≤
n
)
&&
Z
.
testbit
(
z1
`
mod
`
0
)
n
)
||
(
bool_decide
(
n
<
z2'
)
&&
b1
))
.
Proof
.
Proof
.
move
=>
[
->
]
[
<-
]
.
constructor
.
move
=>
[
->
]
[
<-
]
.
constructor
.
case_bool_decide
=>
/=.
{
rewrite
Z
.
pow_neg_r
?
bool_decide_false
/=
?orb_false
_r
;
[
done
|
lia
..
]
.
}
case_bool_decide
=>
/=.
{
rewrite
Z
.
pow_neg_r
?
Zmod_0
_r
;
[
done
|
lia
]
.
}
destruct
(
decide
(
0
≤
n
))
.
2
:
{
rewrite
!
Z
.
testbit_neg_r
?andb_false_r
//
;
lia
.
}
destruct
(
decide
(
0
≤
n
))
.
2
:
{
rewrite
!
Z
.
testbit_neg_r
?andb_false_r
//
;
lia
.
}
rewrite
-
Z
.
land_ones
;
[|
lia
]
.
rewrite
Z
.
land_spec
Z
.
ones_spec
;
[|
lia
..]
.
rewrite
-
Z
.
land_ones
;
[|
lia
]
.
rewrite
Z
.
land_spec
Z
.
ones_spec
;
[|
lia
..]
.
by
rewrite
andb_comm
.
by
rewrite
andb_comm
.
Loading