Documentation
Batteries
.
Data
.
BitVec
.
Lemmas
Search
return to top
source
Imports
Init
Batteries.Data.Int
Batteries.Data.BitVec.Basic
Batteries.Data.Fin.OfBits
Batteries.Data.Nat.Lemmas
Imported by
BitVec
.
toNat_ofFnLEAux
BitVec
.
toFin_ofFnLEAux
BitVec
.
toNat_ofFnLE
BitVec
.
toFin_ofFnLE
BitVec
.
toInt_ofFnLE
BitVec
.
getElem_ofFnLEAux
BitVec
.
getElem_ofFnLE
BitVec
.
getLsb'_ofFnLE
BitVec
.
getLsbD_ofFnLE
BitVec
.
getMsb'_ofFnLE
BitVec
.
getMsbD_ofFnLE
BitVec
.
msb_ofFnLE
BitVec
.
toNat_ofFnBE
BitVec
.
toFin_ofFnBE
BitVec
.
toInt_ofFnBE
BitVec
.
getElem_ofFnBE
BitVec
.
getLsb'_ofFnBE
BitVec
.
getLsbD_ofFnBE
BitVec
.
getMsb'_ofFnBE
BitVec
.
getMsbD_ofFnBE
BitVec
.
msb_ofFnBE
source
@[simp]
theorem
BitVec
.
toNat_ofFnLEAux
{
n
:
Nat
}
(
m
:
Nat
)
(
f
:
Fin
n
→
Bool
)
:
(
ofFnLEAux
m
f
)
.
toNat
=
Nat.ofBits
f
%
2
^
m
source
@[simp]
theorem
BitVec
.
toFin_ofFnLEAux
{
n
:
Nat
}
(
m
:
Nat
)
(
f
:
Fin
n
→
Bool
)
:
(
ofFnLEAux
m
f
)
.
toFin
=
Fin.ofNat'
(
2
^
m
)
(
Nat.ofBits
f
)
source
@[simp]
theorem
BitVec
.
toNat_ofFnLE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
:
(
ofFnLE
f
)
.
toNat
=
Nat.ofBits
f
source
@[simp]
theorem
BitVec
.
toFin_ofFnLE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
:
(
ofFnLE
f
)
.
toFin
=
Fin.ofBits
f
source
@[simp]
theorem
BitVec
.
toInt_ofFnLE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
:
(
ofFnLE
f
)
.
toInt
=
Int.ofBits
f
source
theorem
BitVec
.
getElem_ofFnLEAux
{
n
m
:
Nat
}
(
f
:
Fin
n
→
Bool
)
(
i
:
Nat
)
(
h
:
i
<
n
)
(
h'
:
i
<
m
)
:
(
ofFnLEAux
m
f
)
[
i
]
=
f
⟨
i
,
h
⟩
source
@[simp]
theorem
BitVec
.
getElem_ofFnLE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
(
i
:
Nat
)
(
h
:
i
<
n
)
:
(
ofFnLE
f
)
[
i
]
=
f
⟨
i
,
h
⟩
source
theorem
BitVec
.
getLsb'_ofFnLE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
(
i
:
Fin
n
)
:
(
ofFnLE
f
)
.
getLsb'
i
=
f
i
source
theorem
BitVec
.
getLsbD_ofFnLE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
(
i
:
Nat
)
:
(
ofFnLE
f
)
.
getLsbD
i
=
if h :
i
<
n
then
f
⟨
i
,
h
⟩
else
false
source
@[simp]
theorem
BitVec
.
getMsb'_ofFnLE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
(
i
:
Fin
n
)
:
(
ofFnLE
f
)
.
getMsb'
i
=
f
i
.
rev
source
theorem
BitVec
.
getMsbD_ofFnLE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
(
i
:
Nat
)
:
(
ofFnLE
f
)
.
getMsbD
i
=
if h :
i
<
n
then
f
⟨
i
,
h
⟩
.
rev
else
false
source
theorem
BitVec
.
msb_ofFnLE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
:
(
ofFnLE
f
)
.
msb
=
if h :
n
≠
0
then
f
⟨
n
-
1
,
⋯
⟩
else
false
source
@[simp]
theorem
BitVec
.
toNat_ofFnBE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
:
(
ofFnBE
f
)
.
toNat
=
Nat.ofBits
(
f
∘
Fin.rev
)
source
@[simp]
theorem
BitVec
.
toFin_ofFnBE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
:
(
ofFnBE
f
)
.
toFin
=
Fin.ofBits
(
f
∘
Fin.rev
)
source
@[simp]
theorem
BitVec
.
toInt_ofFnBE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
:
(
ofFnBE
f
)
.
toInt
=
Int.ofBits
(
f
∘
Fin.rev
)
source
@[simp]
theorem
BitVec
.
getElem_ofFnBE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
(
i
:
Nat
)
(
h
:
i
<
n
)
:
(
ofFnBE
f
)
[
i
]
=
f
⟨
i
,
h
⟩
.
rev
source
theorem
BitVec
.
getLsb'_ofFnBE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
(
i
:
Fin
n
)
:
(
ofFnBE
f
)
.
getLsb'
i
=
f
i
.
rev
source
theorem
BitVec
.
getLsbD_ofFnBE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
(
i
:
Nat
)
:
(
ofFnBE
f
)
.
getLsbD
i
=
if h :
i
<
n
then
f
⟨
i
,
h
⟩
.
rev
else
false
source
@[simp]
theorem
BitVec
.
getMsb'_ofFnBE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
(
i
:
Fin
n
)
:
(
ofFnBE
f
)
.
getMsb'
i
=
f
i
source
theorem
BitVec
.
getMsbD_ofFnBE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
(
i
:
Nat
)
:
(
ofFnBE
f
)
.
getMsbD
i
=
if h :
i
<
n
then
f
⟨
i
,
h
⟩
else
false
source
theorem
BitVec
.
msb_ofFnBE
{
n
:
Nat
}
(
f
:
Fin
n
→
Bool
)
:
(
ofFnBE
f
)
.
msb
=
if h :
n
≠
0
then
f
⟨
0
,
⋯
⟩
else
false