• 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-shallow-quoted-constant-generation

    Atj-gen-shallow-symbol

    Generate a shallowly embedded ACL2 quoted symbol.

    Signature
    (atj-gen-shallow-symbol symbol pkg-class-names curr-pkg guards$) 
      → 
    expr
    Arguments
    symbol — Guard (symbolp symbol).
    pkg-class-names — Guard (string-string-alistp pkg-class-names).
    curr-pkg — Guard (stringp curr-pkg).
    guards$ — Guard (booleanp guards$).
    Returns
    expr — Type (jexprp expr).

    If guards are assumed and the symbol is an ACL2 boolean, we generate the corresponding Java boolean literal.

    In all other cases, the generated expression depends on the current package, i.e. the package of the function where the quoted symbol occurs. If the current package is the same as the symbol's package, or if the current package imports the symbol, then we just generate the simple name of the field, because the field will be declared in the class for the current package. Otherwise, we generate a qualified name, preceded by the name of the class for the symbol's package. This mirrors the rules for symbol references in ACL2.

    Definitions and Theorems

    Function: atj-gen-shallow-symbol

    (defun atj-gen-shallow-symbol
           (symbol pkg-class-names curr-pkg guards$)
     (declare (xargs :guard (and (symbolp symbol)
                                 (string-string-alistp pkg-class-names)
                                 (stringp curr-pkg)
                                 (booleanp guards$))))
     (let ((__function__ 'atj-gen-shallow-symbol))
       (declare (ignorable __function__))
       (b*
         (((when (and guards$ (booleanp symbol)))
           (if symbol (jexpr-literal-true)
             (jexpr-literal-false)))
          (sym-pkg (symbol-package-name symbol))
          (simple-name (atj-gen-shallow-symbol-field-name symbol))
          ((when (or (equal sym-pkg curr-pkg)
                     (member-eq symbol (pkg-imports curr-pkg))))
           (jexpr-name simple-name))
          (class-name (atj-get-pkg-class-name sym-pkg pkg-class-names)))
         (jexpr-name (str::cat class-name "." simple-name)))))

    Theorem: jexprp-of-atj-gen-shallow-symbol

    (defthm jexprp-of-atj-gen-shallow-symbol
     (b*
      ((expr (atj-gen-shallow-symbol symbol
                                     pkg-class-names curr-pkg guards$)))
      (jexprp expr))
     :rule-classes :rewrite)