Internal representations of symbolic bit vectors.
GL's core symbolic arithmetic functions operate on lists of bfrs, which may be interpreted either as signed or unsigned symbolic
For unsigned bit vectors this is entirely straightforward. We use an
LSB-first encoding of the bits, so the car of a BFR list represents the
least significant bit of the natural number, a la logcar, whereas the
cdr of the BFR represents its more significant bits, a la logcdr.
For signed bit vectors, we use a similar encoding except that we interpret
the final bit of the number as the sign bit. So, when working on a signed bit
vector, we generally use scdr instead of just cdr.
- Like logcdr for signed bvecs.
- Signed interpretation of a BFR list under some environment.
- Evaluate a list of BFRs, return the list of the (Boolean) results.
- Like logcons for signed bvecs.
- Unsigned interpretation of a BFR list under some environment.
- Like logcons for unsigned bvecs.
- Promote a single BFR into a signed, one-bit bvec, i.e., the resulting
value under bfr-list->s is either 0 or -1, depending on the
- Convert a (pure constant) signed bvec into an integer.
- Convert a natural into a corresponding unsigned bvec (with constant bits).
- Convert an integer into a corresponding signed bvec (with constant bits).
- Convert an unsigned bvec into the corresponding natural.
- Are we at the end of a signed bit vector?
- Deconstruct a signed bit vector.
- Interpret a sign bit as an integer: true → -1, false → 0.