• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
      • Gl
        • Term-level-reasoning
        • Glmc
        • Other-resources
        • Optimization
        • Reference
          • Def-gl-thm
          • Shape-specs
          • Symbolic-objects
          • Gl-aside
          • Def-gl-param-thm
          • Symbolic-arithmetic
          • Bfr
          • Def-gl-boolean-constraint
          • Gl-mbe
          • Bvec
            • Scdr
            • Bfr-list->s
            • Bfr-eval-list
            • Bfr-scons
            • Bfr-ucons
            • Bfr-list->u
            • Bfr-sterm
            • Bfr-snorm
            • Pbfr-list-depends-on
            • V2i
            • N2v
            • V2n
            • S-endp
            • I2v
            • First/rest/end
            • Bool->sign
          • Flex-bindings
          • Auto-bindings
          • Gl-interp
          • Gl-set-uninterpreted
          • Def-gl-clause-processor
          • Def-glcp-ctrex-rewrite
          • ACL2::always-equal
          • Gl-hint
          • Def-gl-rewrite
          • Def-gl-branch-merge
          • Gl-force-check
          • Gl-concretize
          • Gl-assert
          • Gl-param-thm
          • Gl-simplify-satlink-mode
          • Gl-satlink-mode
          • Gl-bdd-mode
          • Gl-aig-bddify-mode
          • Gl-fraig-satlink-mode
        • Debugging
        • Basic-tutorial
      • Witness-cp
      • Ccg
      • Install-not-normalized
      • Rewrite$
      • Fgl
      • Removable-runes
      • Efficiency
      • Rewrite-bounds
      • Bash
      • Def-dag-measure
      • Bdd
      • Remove-hyps
      • Contextual-rewriting
      • Simp
      • Rewrite$-hyps
      • Bash-term-to-dnf
      • Use-trivial-ancestors-check
      • Minimal-runes
      • Clause-processor-tools
      • Fn-is-body
      • Without-subsumption
      • Rewrite-equiv-hint
      • Def-bounds
      • Rewrite$-context
      • Try-gl-concls
      • Hint-utils
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Reference

Bvec

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 integers.

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.

Subtopics

Scdr
Like logcdr for signed bvecs.
Bfr-list->s
Signed interpretation of a BFR list under some environment.
Bfr-eval-list
Evaluate a list of BFRs, return the list of the (Boolean) results.
Bfr-scons
Like logcons for signed bvecs.
Bfr-ucons
Like logcons for unsigned bvecs.
Bfr-list->u
Unsigned interpretation of a BFR list under some environment.
Bfr-sterm
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 environment.
Bfr-snorm
Pbfr-list-depends-on
V2i
Convert a (pure constant) signed bvec into an integer.
N2v
Convert a natural into a corresponding unsigned bvec (with constant bits).
V2n
Convert an unsigned bvec into the corresponding natural.
S-endp
Are we at the end of a signed bit vector?
I2v
Convert an integer into a corresponding signed bvec (with constant bits).
First/rest/end
Deconstruct a signed bit vector.
Bool->sign
Interpret a sign bit as an integer: true → -1, false → 0.