• 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
        • Bv
        • Imp-language
        • Event-macros
        • Java
          • Atj
          • Aij
          • Language
            • Syntax
            • Semantics
              • Primitive-function-macros
                • Def-primitive-binary
                • Def-primitive-unary
                • Primitive-type-destructor
                • Primitive-type-predicate
                • Primitive-type-constructor
                • Def-long=>boolean-binary
                • Def-int=>boolean-binary
                • Def-int-binary
                • Def-float=>boolean-binary
                • Def-double=>boolean-binary
                • Def-long-binary
                • Def-float-binary
                • Def-double-binary
                • Def-boolean-binary
                • Def-long-unary
                • Def-int-unary
                • Def-float-unary
                • Def-double-unary
                • Def-boolean-unary
              • Primitive-values
              • Floating-point-placeholders
              • Pointers
              • Floating-point-value-set-parameters
              • Values
              • Primitive-operations
              • Primitive-conversions
              • Reference-values
        • 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
  • Semantics

Primitive-function-macros

Macros to formalize more concisely ACL2 functions over the Java primitive values.

The ACL2 functions that formalize Java primitive operations and conversions have the following structure: they take one (if unary) or two (if binary) primitive values as arguments; they use primitive value destructors (e.g. int-value->int) to obtain the ``core'' values to operate upon with existing ACL2 functions; they use existing ACL2 functions to generate the ``core'' result; they uses primitive value constructors (e.g. int-value) to return the result primitive value.

The only ``interesting'' part is how the core result is calculated from the core arguments via existing ACL2 functions. The rest is boilerplate that can be automatically generated, which we do via macros.

We introduce two general macros: one for unary functions, and one for binary functions. These can generate functions over primitive values of any combination of operand and result types, which are all explicitly specified. Since certain combinations of operand and result types are shared by certain collections of primitive operations, we also introduce more specialized macros for these combinations.

These macros also provide options to generate certain kinds of theorems about the operations, e.g. commutativity theorems.

Subtopics

Def-primitive-binary
Macro to formalize a binary ACL2 function over Java primitive values.
Def-primitive-unary
Macro to formalize a unary ACL2 function over Java primitive values.
Primitive-type-destructor
The destructor of the fixtype of the values of a primitive type.
Primitive-type-predicate
The recognizer of the fixtype of the values of a primitive type.
Primitive-type-constructor
The constructor of the fixtype of the values of a primitive type.
Def-long=>boolean-binary
Specialization of def-primitive-binary to the case in which the input types are long and the output type is boolean.
Def-int=>boolean-binary
Specialization of def-primitive-binary to the case in which the input types are int and the output type is boolean.
Def-int-binary
Specialization of def-primitive-binary to the case in which input and output types are int.
Def-float=>boolean-binary
Specialization of def-primitive-binary to the case in which the input types are float and the output type is boolean.
Def-double=>boolean-binary
Specialization of def-primitive-binary to the case in which the input types are double and the output type is boolean.
Def-long-binary
Specialization of def-primitive-binary to the case in which input and output types are long.
Def-float-binary
Specialization of def-primitive-binary to the case in which input and output types are float.
Def-double-binary
Specialization of def-primitive-binary to the case in which input and output types are double.
Def-boolean-binary
Specialization of def-primitive-binary to the case in which input and output types are boolean.
Def-long-unary
Specialization of def-primitive-unary to the case in which input and output types are long.
Def-int-unary
Specialization of def-primitive-unary to the case in which input and output types are int.
Def-float-unary
Specialization of def-primitive-unary to the case in which input and output types are float.
Def-double-unary
Specialization of def-primitive-unary to the case in which input and output types are double.
Def-boolean-unary
Specialization of def-primitive-unary to the case in which input and output types are boolean.