Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Alethe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
veriT
Alethe
Merge requests
!4
Add some bitvector rules
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add some bitvector rules
devel/bb2024
into
master
Overview
0
Commits
9
Pipelines
2
Changes
1
Merged
Hans-Jörg
requested to merge
devel/bb2024
into
master
1 year ago
Overview
0
Commits
9
Pipelines
2
Changes
1
Expand
This moves
#31
forward!
Merge request reports
Viewing commit
a8bff734
Prev
Next
Show latest version
1 file
+
45
−
24
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
a8bff734
Update and expand the bit blasting section
· a8bff734
Hans-Jörg
authored
1 year ago
spec/doc.tex
+
45
−
24
Options
@@ -1689,41 +1689,62 @@ is functional congruence, and \proofRule{sko_forall} works like
\end{AletheS}
\end{example}
\paragraph
{
Bitblasting
}
% Note: we could also use an equality wih bvexplode (maybe called bvpack then)
% TODO: Add example
Bitblasting
\index
{
bitblasting
}
is the translation of
bit-vector
\index
{
bit-vector
}
functions to propositional formulas. To express
this in the Alethe proof rules, the format uses a family of helper predicates
$
\lsymb
{
bvexplode
}$
, one for each bit-vector sort
$
(
\lsymb
{
BitVec
}
\;
n
)
$
.
\subsection
{
Bitvector Reasoning with Bitblasting
}
A standard approach to handle bitvector reasoning in SMT solvers is bitblasting.
Bitblasting
\index
{
bitblasting
}
is the translation of bit-vector
\index
{
bit-vector
}
functions to propositional formulas.
To express bitplasting in the Alethe proof rules, the format uses multiple families
helper functions:
$
\lsymb
{
bbT
}$
,
$
\lsymb
{
bitOf
}$
,
$
\lsymb
{
bvsize
}$
, and
$
\lsymb
{
bv
}$
.
To avoid name clashes with user defined functions,
$
\lsymb
{
bbT
}$
is written as
\inlineAlethe
{
@bbT
}
,
$
\lsymb
{
bitOf
}$
as
\inlineAlethe
{
@bitOf
}
,
$
\lsymb
{
bvsize
}$
as
\inlineAlethe
{
@bvsize
}
, and
$
\lsymb
{
bv
}$
as
\inlineAlethe
{
@bv
}
.
The SMT-LIB standard specifies
that simple symbols starting with ``
\inlineAlethe
{
@
}
'' are reserved for
solver generated functions.
The family
$
\lsymb
{
bbT
}$
consists of one function for each bit-vector sort
$
(
\lsymb
{
BitVec
}
\;
n
)
$
.
\[
\lsymb
{
b
vexplode
}
:
(
\lsymb
{
BitVec
}
\;
n
)
\,
\underbrace
{
\lsymb
{
Bool
}
\dots
\lsymb
{
Bool
}}_
n
\
,
\lsymb
{
B
ool
}
.
\lsymb
{
b
bT
}
:
\underbrace
{
\lsymb
{
Bool
}
\dots
\lsymb
{
Bool
}}_
n
\
;
(
\lsymb
{
B
itVec
}
\;
n
)
.
\]
Intuitively, the predicate
$
\lsymb
{
bvexplode
}$
is true if the boolean arguments
correspond to the bits in the first argument.
Let
${
<
}
u
_
1
,
\dots
, u
_
n
{
>
}$
denote a bit-vector of sort
$
(
\lsymb
{
BitVec
}
\;
n
)
$
\noindent
Intuitively, the predicate
$
\lsymb
{
bbT
}$
takes a list of boolean arguments and
packs them into a bitvector.
Let
$
\langle
u
_
1
,
\dots
, u
_
n
\rangle
$
denote a bit-vector of sort
$
(
\lsymb
{
BitVec
}
\;
n
)
$
where
$
u
_
i
=
\top
$
if the bit at position
$
i
$
is
$
1
$
, and
$
u
_
i
=
\bot
$
otherwise.
The bit
$
u
_
n
$
is the least significant bit. Then
\[
\lsymb
{
b
vexplode
}
\;
{
<
}
u
_
1
,
\dots
, u
_
n
{
>
}
\,
v
_
1
\dots
v
_
n
=
\top
.
\lsymb
{
b
bT
}
\;
v
_
1
\dots
v
_
n
=
\langle
v
_
1
,
\dots
,
v
_
n
\rangle
.
\]
iff
$
u
_
i
=
v
_
i
$
for all
$
1
≤ i ≤ n
$
.
The addition of the
$
\lsymb
{
bvexplode
}$
predicates is a conservative extension.
\noindent
The addition of the
$
\lsymb
{
bbT
}$
predicates is a conservative extension.
They could be defined in terms of standard SMT-LIB functions.
\begin{align*}
\lsymb
{
bvexplode
}
\;
{
<
}
u
_
1,
\dots
, u
_
n
{
>
}
\,
v
_
1
\dots
v
_
n :=
\;
&
(
\lsymb
{
extract
}
\;
1
\;
1) ≈ (
\lsymb
{
ite
}
\,
v
_
1
\,
{
<
}
\top
{
>
}
\,
{
<
}
\bot
{
>
}
)
\,\land\\
&
(
\lsymb
{
extract
}
\;
2
\;
2) ≈ (
\lsymb
{
ite
}
\,
v
_
2
\,
{
<
}
\top
{
>
}
\,
{
<
}
\bot
{
>
}
)
\,\land\\
&
\cdots
\\
&
(
\lsymb
{
extract
}
\;
n
\;
n) ≈ (
\lsymb
{
ite
}
\,
v
_
n
\,
{
<
}
\top
{
>
}
\,
{
<
}
\bot
{
>
}
)
\lsymb
{
bbT
}
\;
v
_
1
\dots
v
_
n :=
\;
&
\lsymb
{
concat
}
\,
(
\lsymb
{
concat
}
\,
(
\dots
\\
&
(
\lsymb
{
concat
}
\,
(
\lsymb
{
ite
}
\,
v
_
1
\,\langle\top\rangle\,\langle\bot\rangle
)
\,
(
\lsymb
{
ite
}
\,
v
_
2
\,\langle\top\rangle\,\langle\bot\rangle
))
\\
&
\dots
\\
&
(
\lsymb
{
ite
}
\,
v
_{
n-1
}
\,\langle\top\rangle\,\langle\bot\rangle
))
\\
&
(
\lsymb
{
ite
}
\,
v
_
n
\,\langle\top\rangle\,\langle\bot\rangle
))
\\
\end{align*}
To avoid name clashes with user defined functions,
$
\lsymb
{
bvexplode
}$
is written as
\inlineAlethe
{
.bvexplode
}
. The SMT-LIB standard specifies
that simple symbols starting with ``
\inlineAlethe
{
.
}
'' are reserved for
solver generated functions.
\noindent
The functions
$
\lsymb
{
bitOf
}$
are the inverse of
$
\lsymb
{
bbT
}$
. They extract
a bit of a bitvector as a boolean. Just as the built in
$
\lsymb
{
extract
}$
symbol,
$
\lsymb
{
bitOf
}$
is used as an indexed symbol. Hence, for
$
n
\leq
m
$
, we
write
\inlineAlethe
{
(
_
@bitOf
}
$
n
$
\inlineAlethe
{
)
}
, to denote functions
\[
\lsymb
{
bitOf
}_
n :
(
\lsymb
{
BitVec
}
\;
m
)
\to
\lsymb
{
Bool
}
.
\]
These functions are defined as
\[
\lsymb
{
bitOf
}_
n
\langle
u
_
1
,
\dots
, u
_
m
\rangle
:
=
u
_
n.
\]
\section
{
The Alethe Rules
}
\label
{
apx:rules
}
Loading