155 questions
-1 votes
1 answer
84 views
Strange bitvec behavior in rust when using load_be and load_le
When loading a slice of bitvec as u8 I am not getting the expected result when bitvec order does not match big/little endian. Here's example code showing the issue: use bitvec::prelude::*; use rand::...
2 votes
3 answers
116 views
Empty `vec()` is not False
Consider this example: #!/usr/bin/env perl my $vec0; # set the first bit of vec0 to false vec($vec0, 0, 1) = 0; print "vec0 is " . length($vec0) . " bytes long\n"; if ($vec0) { ...
1 vote
0 answers
59 views
How can i manage bitvector in C?
I have a generated program in c (it is used in cbmc) that contain that declarations: unsigned __CPROVER_bitvector[1] __cs_active_thread[3] = {}; unsigned __CPROVER_bitvector[7] __cs_pc[3]; unsigned ...
1 vote
0 answers
52 views
Z3 returns unknown with HORN logic if I use a specific operation
I am using HORN logic in order to solve a problem with Z3. The code works until I put in one assert the following operation: ip_dst *namevar* or ip_src *namevar* where ip_dst and ip_src are defined as ...
-2 votes
1 answer
47 views
My code is not leaving the loop that starts at line 228 (called ciclo), it seems like it's not reading the mouse
; multi-segment executable file template. data segment ; add your data here! ; Escolhas inícias stringjogar db "JOGAR$",0 stringtop5 db "TOP 5$",0 ...
1 vote
1 answer
135 views
In bitvec, how does storage size affect loading?
How does the storage size affect how loading works?. As an example, in the below snippet, a 22 bit vector is separated into two groups of 11 bits. Each of these groups has the same pattern, storing ...
0 votes
1 answer
686 views
Calculating integer exponents in dafny
I'm new to dafny and I am having trouble with getting exponents for integers invariant x >= 0 && y >= 0 && ((x + y) * (2^(u-1)) + result == i1 + i2); for the part that says "...
1 vote
1 answer
401 views
Am I using Rust's bitvec_simd in the most efficient way?
I'm using bitvec_simd = "0.20" for bitvector operations in rust. I have two instances of a struct, call them clique_into and clique_from. The relevant fields of the struct are two bitvectors ...
1 vote
1 answer
69 views
List all possible combinations of enabled utilities with dependencies?
I have a list of 23 utilities that can be in a state of either enabled or disabled. I've ordered them from 0-22. Some of these utilities are dependent on others, meaning they cannot be enabled without ...
0 votes
0 answers
128 views
how to fast set the bitset by using multiple position once
how to fast set the bitset by using multiple position, eg: the position : 1,4,5,6,9,3. the bitset is 0101111001....,whether can use SIMD instruction? I know the simple method, eg: assume the word_t is ...
0 votes
0 answers
431 views
What are the advantages and disadvantages of using bitvectors/bit manipulation?
This question came up while I was working with bitvectors in C. From what I understand, they're good to use since they allow you to store the same data but with less memory, although I could be wrong. ...
0 votes
1 answer
1k views
convert an integer to a minimally-padded vector of bits (probably using BitVec)
cross posting from https://github.com/bitvecto-rs/bitvec/issues/163 I'm trying to create compact binary representations of integers, with minimal padding. I'm currently reaching for BitVec, but that's ...
0 votes
1 answer
128 views
SMTlib non overlapping but complementary Bitvectors
I am struggling with the attempt to generate a correct assertion in SMTlib. The QV_BV (Bitvectors) theory is used. I use Python to generate the temp.smt2 file and then run it using z3. The goal is to ...
0 votes
1 answer
658 views
What are bit vectors and how do I use them to convert chars to ints?
Here's the explanation for our task when implementing a set data structure in C "The set is constructed as a Bit vector, which in turn is implemented as an array of the data type char." My ...
2 votes
1 answer
404 views
Templating input and output type in rust with bitvec
Here I have two functions in rust which convert a bitvec into an integer. They are identical except for their types, so I'd like to template over both: the input types BitVec and BitSlice the return ...