• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Apt
        • Error-checking
        • Fty-extensions
        • Isar
        • Kestrel-utilities
        • Set
        • C
          • Syntax-for-tools
          • Atc
          • Transformation-tools
          • Language
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
              • Integer-format-templates
              • Ienv
              • Integer-formats
              • Ienv-ushort-rangep
              • Ienv-ulong-rangep
              • Ienv-ullong-rangep
              • Ienv-uint-rangep
              • Ienv-uchar-rangep
              • Ienv-sshort-rangep
              • Ienv-slong-rangep
              • Ienv-sllong-rangep
              • Ienv-sint-rangep
              • Ienv-schar-rangep
              • Ienv-char-rangep
              • Ienv->schar-min
              • Ienv->schar-max
              • Ienv->char-size
              • Ienv->char-min
              • Ienv->char-max
              • Ienv->uchar-max
              • Ienv->short-bit-size
              • Ienv->long-bit-size
              • Ienv->llong-bit-size
              • Ienv->int-bit-size
              • Ienv->short-byte-size
              • Ienv->long-byte-size
              • Ienv->llong-byte-size
              • Ienv->int-byte-size
              • Versions
              • Ienv->ushort-max
              • Ienv->ullong-max
              • Ienv->sshort-min
              • Ienv->sllong-min
              • Ienv->sllong-max
              • Ienv->bool-byte-size
              • Ienv->bool-bit-size
              • Ienv->ulong-max
              • Ienv->uint-max
              • Ienv->sshort-max
              • Ienv->slong-min
              • Ienv->slong-max
              • Ienv->sint-min
              • Ienv->sint-max
              • Schar-formats
              • Char-formats
              • Uchar-formats
              • Signed-formats
              • Bool-formats
                • Bool-format
                  • Bool-format-fix
                  • Bool-format-equiv
                  • Make-bool-format
                  • Change-bool-format
                  • Bool-format->value-index
                  • Bool-format->byte-size
                  • Bool-format->trap
                  • Bool-formatp
                • Bool-format-wfp
                • Bool-format-lsb
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Types
            • Integer-formats-definitions
            • Computation-states
            • Portable-ascii-identifiers
            • Values
            • Integer-operations
            • Object-designators
            • Operations
            • Errors
            • Tag-environments
            • Function-environments
            • Character-sets
            • Flexible-array-member-removal
            • Arithmetic-operations
            • Pointer-operations
            • Real-operations
            • Array-operations
            • Scalar-operations
            • Structure-operations
          • Representation
          • Insertion-sort
          • Pack
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
        • Riscv
        • Bitcoin
        • Zcash
        • Yul
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
        • File-io-light
        • Cryptography
        • Number-theory
        • Axe
        • Lists-light
        • Builtins
        • Solidity
        • Helpers
        • Htclient
        • Typed-lists-light
        • Arithmetic-light
      • X86isa
      • Axe
      • Execloader
    • Math
    • Testing-utilities
  • Bool-formats

Bool-format

Fixtype of formats of _Bool objects.

This is a product type introduced by fty::defprod.

Fields
byte-size — posp
value-index — natp
trap — ACL2::any-p

[C17:6.2.5/2] says that _Bool is large enough to store 0 and 1. [C17:6.2.5/6] classifies _Bool as an unsigned integer type; as such, [C17:6.2.6.2/1] implies that _Bool object must consist of value bits and padding bits. Since only the values 0 and 1 are needed, it seems reasonable to infer that _Bool objects have exactly one value bit; but since they must consist of an integral number of bytes [C17:6.2.6.1/2], the rest must be all padding bits. Although it does not seem reasonable to use more than one byte, nothing seems to prevent _Bool object to take two or more bytes.

Thus, to capture the possible formats of _Bool objects, we need the number of bytes (normally 1), and the index of the value bit, where the significance of the index is the same as in the lists of bit roles in uinteger-format. We also include information (for now unconstrained) about possible trap representations [C17:6.2.6.1/5].

Subtopics

Bool-format-fix
Fixing function for bool-format structures.
Bool-format-equiv
Basic equivalence relation for bool-format structures.
Make-bool-format
Basic constructor macro for bool-format structures.
Change-bool-format
Modifying constructor for bool-format structures.
Bool-format->value-index
Get the value-index field from a bool-format.
Bool-format->byte-size
Get the byte-size field from a bool-format.
Bool-format->trap
Get the trap field from a bool-format.
Bool-formatp
Recognizer for bool-format structures.