• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • 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
            • Atj-implementation
              • Atj-types
              • Atj-java-primitive-array-model
              • Atj-java-abstract-syntax
              • Atj-input-processing
              • Atj-java-pretty-printer
              • Atj-code-generation
                • Atj-gen-test-method
                • Atj-shallow-code-generation
                • Atj-common-code-generation
                • Atj-shallow-quoted-constant-generation
                  • Atj-qconstants-p
                  • Atj-gen-shallow-symbol
                  • Atj-gen-shallow-cons-field-name
                  • Atj-gen-shallow-symbol-field-name
                  • Atj-add-qconstant
                  • Atj-add-qconstants-in-term
                  • Atj-gen-shallow-symbol-field
                  • Atj-gen-shallow-rational-id-part
                  • Atj-gen-shallow-number-id-part
                  • Atj-gen-shallow-number-field
                  • Atj-gen-shallow-value
                  • Atj-gen-shallow-cons-fields
                  • Atj-gen-shallow-cons-field
                  • Atj-gen-shallow-string
                  • Atj-gen-shallow-integer-id-part
                  • Atj-gen-shallow-string-field
                  • Atj-gen-shallow-number-field-name
                  • Atj-gen-shallow-char-field
                  • Atj-gen-shallow-char
                  • Atj-gen-shallow-string-field-name
                  • Atj-gen-shallow-cons
                  • Atj-gen-shallow-char-field-name
                  • Atj-gen-shallow-symbol-fields
                  • Atj-gen-shallow-string-fields
                  • Atj-gen-shallow-number-fields
                  • Atj-gen-shallow-number
                  • Atj-gen-shallow-char-fields
                • Atj-pre-translation
                • Atj-gen-everything
                • Atj-name-translation
                • Atj-gen-test-cunit
                • Atj-gen-test-class
                • Atj-gen-main-file
                • Atj-post-translation
                • Atj-deep-code-generation
                • Atj-gen-test-methods
                • Atj-gen-test-file
                • Atj-gen-env-file
                • Atj-gen-output-subdir
              • Atj-java-primitives
              • Atj-java-primitive-arrays
              • Atj-type-macros
              • Atj-java-syntax-operations
              • Atj-fn
              • Atj-library-extensions
              • Atj-java-input-types
              • Atj-test-structures
              • Aij-notions
              • Atj-macro-definition
            • Atj-tutorial
          • Aij
          • Language
        • 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
  • Atj-code-generation

Atj-shallow-quoted-constant-generation

Representation of quoted constants in the shallow embedding.

In the shallow embedding approach, each quoted constant in the ACL2 code is translated to a Java static final field that is calculated once at class initialization time and then just referenced in the Java code. Since ACL2 values are objects, this avoids recalculating the object (whether it is created or reused, e.g. when interned) every time the shallowly embedded quoted constant is executed in the Java code.

We extract all the quoted constants from the pre-translated bodies of the ACL2 functions, and we create a static final field for each. The fields for these quoted constants are declared in the generated main class; they are named in a way that describes their value, e.g. see atj-gen-shallow-number-field-name.

Subtopics

Atj-qconstants-p
Recognize a structured collection of quoted constants.
Atj-gen-shallow-symbol
Generate a shallowly embedded ACL2 quoted symbol.
Atj-gen-shallow-cons-field-name
Generate the name of the Java field for an ACL2 quoted cons pair.
Atj-gen-shallow-symbol-field-name
Generate the name of the Java field for an ACL2 quoted symbol.
Atj-add-qconstant
Add (the value of) a quoted constant to a structured collection.
Atj-add-qconstants-in-term
Collect all the quoted constants in a term.
Atj-gen-shallow-symbol-field
Generate a Java field for an ACL2 quoted symbol.
Atj-gen-shallow-rational-id-part
Turn an ACL2 rational into a Java identifier part.
Atj-gen-shallow-number-id-part
Turn an ACL2 number into a Java identifier part.
Atj-gen-shallow-number-field
Generate a Java field for an ACL2 quoted number.
Atj-gen-shallow-value
Generate a shallowly embedded ACL2 value.
Atj-gen-shallow-cons-fields
Lift atj-gen-shallow-cons-field to lists.
Atj-gen-shallow-cons-field
Generate a Java field for an ACL2 quoted cons pair.
Atj-gen-shallow-string
Generate a shallowly embedded ACL2 quoted string.
Atj-gen-shallow-integer-id-part
Turn an ACL2 integer into a Java identifier part.
Atj-gen-shallow-string-field
Generate a Java field for an ACL2 quoted string.
Atj-gen-shallow-number-field-name
Generate the name of the Java field for an ACL2 quoted number.
Atj-gen-shallow-char-field
Generate a Java field for an ACL2 quoted character.
Atj-gen-shallow-char
Generate a shallowly embedded ACL2 quoted character.
Atj-gen-shallow-string-field-name
Generate the name of the Java field for an ACL2 quoted string.
Atj-gen-shallow-cons
Generate a shallowly embedded ACL2 quoted cons pair.
Atj-gen-shallow-char-field-name
Generate the name of the Java field for an ACL2 quoted character.
Atj-gen-shallow-symbol-fields
Lift atj-gen-shallow-symbol-field to lists.
Atj-gen-shallow-string-fields
Lift atj-gen-shallow-string-field to lists.
Atj-gen-shallow-number-fields
Lift atj-gen-shallow-number-field to lists.
Atj-gen-shallow-number
Generate a shallowly embedded ACL2 quoted number.
Atj-gen-shallow-char-fields
Lift atj-gen-shallow-char-field to lists.