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
Admin message
Pour rappel, le service sera inaccessible ce lundi 05/05/25 midi pour raison de mise à jour.
Show more breadcrumbs
veriT
Alethe
Commits
cf20e9c7
Commit
cf20e9c7
authored
1 year ago
by
Haniel Barbosa
Browse files
Options
Downloads
Patches
Plain Diff
adding rules for bvult and bvadd
parent
36d8b7f6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#19304
failed
1 year ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
spec/rule_list.tex
+78
-2
78 additions, 2 deletions
spec/rule_list.tex
with
78 additions
and
2 deletions
spec/rule_list.tex
+
78
−
2
View file @
cf20e9c7
...
...
@@ -1535,7 +1535,7 @@ form and the reordering of equalities.
$
i
$
.
&
\ctxsep
&
$
((
\_\ \mathrm
{
extract
}
\
j
\
i
)
\
x
)
\simeq
(
\mathrm
{
bbterm
}
\
x
[
i
]
\ \ldots\
x
[
j
])
$
&
(
\currule
)
\\
\end{AletheX}
Each term
$
x
[
i
]
$
corresponds to whether
$
i
$
-th bit of
$
x
$
is true or not, which
Each term
$
x
[
i
]
$
corresponds to whether
the
$
i
$
-th bit of
$
x
$
is true or not, which
will be represented via an application of the operator ``bit
\_
of'', i.e.,
$
((
\_\
bit
\_
of
\
i
)
\
x
)
$
, which has a Boolean return type.
%
...
...
@@ -1543,13 +1543,89 @@ The ``bbterm'' operator takes $n$ Booleans and yields a bit-vector of size $n$
where the least significant bit is 1 if the first argument 1 is true, 0
otherwise, and so on.
%
Alternatively, we also have:
Alternatively, the rule may also be phrased as a ``short-circuiting'' of the
above when
$
x
$
is a ``bbterm'' application:
\medskip
\begin{AletheX}
$
i
$
.
&
\ctxsep
&
$
((
\_\ \mathrm
{
extract
}
\
j
\
i
)
\
(
\mathrm
{
bbterm
}
\
x
_
0
\ \ldots\
x
_
i
\ \ldots
\
x
_
j
\ \ldots\
x
_
n
))
\simeq
(
\mathrm
{
bbterm
}
\
x
_
i
\ \ldots\
x
_
j
)
$
&
(
\currule
)
\\
\end{AletheX}
This alternative is based on the validity of the equality
$$
(
\mathrm
{
bbterm
}
\
x
_
0
\ \ldots\
x
_
i
\ \ldots
\
x
_
j
\ \ldots\
x
_
n
)[
i
]
\simeq
x
_
i
$$
for any bit-vector
$
x
$
of size
$
n
+
1
$
, where
$
0
\leq
i
\leq
n
$
.
\end{RuleDescription}
\begin{RuleDescription}
{
bitblast
_
ult
}
\begin{AletheX}
$
i
$
.
&
\ctxsep
&
$
(
\mathrm
{
bvult
}
\
x
\
y
)
\simeq
res
_{
n
-
1
}$
&
(
\currule
)
\\
\end{AletheX}
in which both
$
x
$
and
$
y
$
must have the same type
$
(
\_\ \mathrm
{
BitVec
}
\
n
)
$
and, for
$
i
\geq
0
$
:
\[
\begin
{
array
}{
lcl
}
\mathrm
{
res
}_
0
&
=
&
\neg
x
[
0
]
\wedge
y
[
0
]
\\
\mathrm
{
res
}_{
i
+
1
}&
=
&
((
x
[
i
+
1
]
\simeq
y
[
i
+
1
])
\wedge
\mathrm
{
res
}_
i
)
\vee
(
\neg
x
[
i
+
1
]
\wedge
y
[
i
+
1
])
\end
{
array
}
\]
Alternatively, the rule may also be phrased as a ``short-circuiting'' of the
above when
$
x
$
and
$
y
$
are ``bbterm'' applications. So given that
\[
\begin
{
array
}{
lcl
}
x
&
=
&
(
\mathrm
{
bbterm
}
\
x
_
0
\ \ldots\
x
_
i
\ \ldots
\
x
_
j
\ \ldots\
x
_
n
)
\\
y
&
=
&
(
\mathrm
{
bbterm
}
\
y
_
0
\ \ldots\
y
_
i
\ \ldots
\
y
_
j
\ \ldots\
y
_
n
)
\\
\end
{
array
}
\]
then ``res'' can be defined, for
$
i
\geq
0
$
, as
\[
\begin
{
array
}{
lcl
}
\mathrm
{
res
}_
0
&
=
&
\neg
x
_
0
\wedge
y
_
0
\\
\mathrm
{
res
}_{
i
+
1
}&
=
&
((
x
_{
i
+
1
}
\simeq
y
_{
i
+
1
}
)
\wedge
\mathrm
{
res
}_
i
)
\vee
(
\neg
x
_{
i
+
1
}
\wedge
y
_{
i
+
1
}
)
\end
{
array
}
\]
\end{RuleDescription}
\begin{RuleDescription}
{
bitblast
_
add
}
\begin{AletheX}
$
i
$
.
&
\ctxsep
&
$
(
\mathrm
{
bvadd
}
\
x
\
y
)
\simeq
(
\mathrm
{
bbterm
}
\
(
x
[
0
]
\oplus
y
[
0
])
\oplus\mathrm
{
carry
}_
0
\ \ldots\
(
x
[
n
-
1
]
\oplus
y
[
n
-
1
])
\oplus\mathrm
{
carry
}_{
n
-
1
}
)
$
&
(
\currule
)
\\
\end{AletheX}
in which both
$
x
$
and
$
y
$
must have the same type
$
(
\_\ \mathrm
{
BitVec
}
\
n
)
$
and, for
$
i
\geq
0
$
:
\[
\begin
{
array
}{
lcl
}
\mathrm
{
carry
}_
0
&
=
&
\bot\\
\mathrm
{
carry
}_{
i
+
1
}&
=
&
(
x
[
i
]
\wedge
y
[
i
])
\vee
((
x
[
i
]
\oplus
y
[
i
])
\wedge
\mathrm
{
carry
}_
i
)
\end
{
array
}
\]
Alternatively, the rule may also be phrased as a ``short-circuiting'' of the
above when
$
x
$
and
$
y
$
are ``bbterm'' applications. So given that
\[
\begin
{
array
}{
lcl
}
x
&
=
&
(
\mathrm
{
bbterm
}
\
x
_
0
\ \ldots\
x
_
i
\ \ldots
\
x
_
j
\ \ldots\
x
_
n
)
\\
y
&
=
&
(
\mathrm
{
bbterm
}
\
y
_
0
\ \ldots\
y
_
i
\ \ldots
\
y
_
j
\ \ldots\
y
_
n
)
\\
\end
{
array
}
\]
then the rule can be alternatively phrased as
\begin{AletheX}
$
i
$
.
&
\ctxsep
&
$
(
\mathrm
{
bvadd
}
\
x
\
y
)
\simeq
(
\mathrm
{
bbterm
}
\
(
x
_
0
\oplus
y
_
0
)
\oplus\mathrm
{
carry
}_
0
\ \ldots\
(
x
_{
n
-
1
}
\oplus
y
_{
n
-
1
}
)
\oplus\mathrm
{
carry
}_{
n
-
1
}
)
$
&
(
\currule
)
\\
\end{AletheX}
with ``carry'' being defined, for
$
i
\geq
0
$
, as
\[
\begin
{
array
}{
lcl
}
\mathrm
{
carry
}_
0
&
=
&
\bot\\
\mathrm
{
carry
}_{
i
+
1
}&
=
&
(
x
_
i
\wedge
y
_
i
)
\vee
((
x
_
i
\oplus
y
_
i
)
\wedge
\mathrm
{
carry
}_
i
)
\end
{
array
}
\]
\end{RuleDescription}
\clearpage
...
...
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