• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • 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
        • Soft
        • C
          • Syntax-for-tools
          • Atc
          • Language
            • Abstract-syntax
            • Integer-ranges
            • Implementation-environments
            • Dynamic-semantics
            • Static-semantics
            • Grammar
            • Integer-formats
            • Types
            • Portable-ascii-identifiers
            • Values
              • Pointer
              • Member-types-of-member-values
              • Member-value-list->value-list
              • Member-value-list->name-list
              • Expr-value
              • Type-list-of-value-list
              • Type-of-value
              • Value-option
              • Init-value
              • Value-result
              • Type-of-value-option
              • Value-list-result
              • Member-value-list-result
              • Init-value-result
              • Expr-value-result
              • Value-option-result
              • Signed/unsigned-byte-p-of-integer-values
              • Member-type-of-member-value
              • Bounds-of-integer-values
              • Value-promoted-arithmeticp
              • Init-type-of-init-value
              • Value-unsigned-integerp
              • Value-signed-integerp
              • Value-integerp
              • Value-arithmeticp
              • Value-scalarp
              • Value-realp
              • Values/membervalues
                • Value
                  • Valuep
                  • Value-case
                  • Value-struct
                  • Value-kind
                  • Value-equiv
                  • Value-array
                  • Value-pointer
                  • Value-ushort
                  • Value-ulong
                  • Value-ullong
                  • Value-uint
                  • Value-uchar
                  • Value-sshort
                  • Value-slong
                  • Value-sllong
                  • Value-sint
                  • Value-schar
                  • Value-fix
                  • Value-count
                • Member-value
                • Value-list
                • Member-value-list
            • Integer-operations
            • Computation-states
            • Object-designators
            • Operations
            • Errors
            • Tag-environments
            • Function-environments
            • Character-sets
            • Flexible-array-member-removal
            • Arithmetic-operations
            • Pointer-operations
            • Bytes
            • Keywords
            • Real-operations
            • Array-operations
            • Scalar-operations
            • Structure-operations
          • Representation
          • Transformation-tools
          • Insertion-sort
          • Pack
        • Bv
        • Imp-language
        • Event-macros
        • Java
        • Bitcoin
        • Ethereum
        • Yul
        • Zcash
        • ACL2-programming-language
        • Prime-fields
        • Json
        • Syntheto
        • File-io-light
        • Cryptography
        • Number-theory
        • Lists-light
        • Axe
        • Builtins
        • Solidity
        • Helpers
        • Htclient
        • Typed-lists-light
        • Arithmetic-light
      • X86isa
      • Axe
      • Execloader
    • Math
    • Testing-utilities
  • Values/membervalues

Value

Fixtype of values.

This is a tagged union type, introduced by fty::deftagsum.

Member Tags → Types
:uchar → value-uchar
:schar → value-schar
:ushort → value-ushort
:sshort → value-sshort
:uint → value-uint
:sint → value-sint
:ulong → value-ulong
:slong → value-slong
:ullong → value-ullong
:sllong → value-sllong
:pointer → value-pointer
:array → value-array
:struct → value-struct

For now we only support the standard unsigned and signed integer values (except _Bool values), pointer values with any referenced type, arrays of values of any type, and structures of member values of any type. Note that plain char values are not standard unsigned or signed integer values [C17:6.2.5/7]; currently we do not cover plain char values.

As mentioned in pointer, we define a pointer value as consisting of a pointer (as defined there) and a type. Note that [C17] does not prescribe 0 to represent a null pointer, even though 0 is used in null pointer constants [C17:6.3.2.3/3]. The type is not the pointer type, but the referenced type; this way, we avoid having to constrain the type to be a pointer type.

Array values are modeled as consisting of the element type and a non-empty list of values. [C17:6.2.5/20] requires arrays to be non-empty.

Arrays are indexed via integers [C17] only provides minimum requirements for the sizes of integer types, not maximum requirements. Other than practical considerations, nothing, mathematically, prevents some integer types to consists of thousands or millions of bits. So our model of arrays requires them to be non-empty, but puts no maximum limits on their length.

This definition of arrays alone does not prevent arrays from having values of different types. That all the values have the element type can and will be enforced in separate predicates.

Structures are modeled as consisting of a tag (identifier), a non-empty list of member values, and a flag saying whether the structure has a flexible array member [C17:6.7.2.1/18]. The tag is the one that identifies the structure type; we only model structures with non-anonymous types. [C17:6.2.5/20] requires at least one member, which we capture with an invariant. If the flexible array member flag is set, there must be at least two members (i.e. one besides the flexible array member), and the last member must be an array; we do not capture these requirements here, but we may in the future. The member values must have distinct names; we do not capture this requirement here, but we may in the future.

The requirement that the member values match the members of the structure type requires contextual information about the structure type. So this requirement cannot be captured in this definition of values.

Subtopics

Valuep
Recognizer for value structures.
Value-case
Case macro for the different kinds of value structures.
Value-struct
Value-kind
Get the kind (tag) of a value structure.
Value-equiv
Basic equivalence relation for value structures.
Value-array
Value-pointer
Value-ushort
Value-ulong
Value-ullong
Value-uint
Value-uchar
Value-sshort
Value-slong
Value-sllong
Value-sint
Value-schar
Value-fix
Fixing function for value structures.
Value-count
Measure for recurring over value structures.