• 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
            • Formalized-subset
            • Mapping-to-language-definition
            • Input-files
            • Compilation-database
            • Printer
            • Output-files
            • Abstract-syntax-operations
            • Implementation-environments
            • Abstract-syntax
            • Concrete-syntax
            • Disambiguation
            • Validation
            • Gcc-builtins
            • Preprocessing
              • Preprocessor
                • Preprocessor-states
                  • Plexeme
                  • Ppstate
                  • Pnumber
                  • Macro-info
                    • Macro-info-fix
                    • Macro-info-case
                    • Macro-info-function
                    • Macro-info-equiv
                    • Macro-infop
                    • Macro-info-object
                      • Macro-info-object->replace
                        • Make-macro-info-object
                        • Change-macro-info-object
                      • Macro-info-kind
                    • Macro-add
                    • Init-ppstate
                    • Plexeme-token/newline-p
                    • Newline
                    • Plexeme-option
                    • Macro-info-option
                    • Macro-table
                    • Plexeme+span
                    • Update-ppstate->lexemes-unread
                    • Update-ppstate->lexemes-read
                    • Update-ppstate->lexemes-length
                    • Update-ppstate->chars-unread
                    • Update-ppstate->chars-read
                    • Update-ppstate->version
                    • Update-ppstate->position
                    • Update-ppstate->macros
                    • Update-ppstate->chars-length
                    • Macro-lookup
                    • Update-ppstate->bytes
                    • Update-ppstate->size
                    • Plexeme-token/space-p
                    • Plexeme-tokenp
                    • Ppstate->gcc
                    • Plexeme-list-token/space-p
                    • Ppstate->size
                    • Ppstate->lexemes-unread
                    • Ppstate->lexemes-read
                    • Ppstate->lexemes-length
                    • Ppstate->chars-unread
                    • Ppstate->bytes
                    • Plexeme-list-token/newline-p
                    • Plexeme-list-not-token/newline-p
                    • Ident-macroinfo-alist
                    • Update-ppstate->lexeme
                    • Update-ppstate->char
                    • Ppstate->version
                    • Ppstate->macros
                    • Ppstate->chars-read
                    • Ppstate->chars-length
                    • Plexeme-list-tokenp
                    • Plexeme-list-not-tokenp
                    • Macro-table-init
                    • Ppstate->lexeme
                    • Ppstate->char
                    • Ppstate-fix
                    • Plexeme+span-list
                    • Plexeme-list
                    • Irr-pnumber
                    • Irr-plexeme
                    • Irr-macro-table
                    • Ppstate->position
                  • Preprocessor-printer
                  • Pread-token/newline
                  • Pread-token
                  • Preprocessor-lexer
                  • Pproc-files
                  • Pproc-file
                  • Filepath-plexeme-list-alist-to-filepath-filedata-map
                  • Filepath-plexeme-list-alist
                  • Preprocessor-reader
                  • Preprocessor-messages
                • External-preprocessing
              • Parsing
            • Atc
            • Transformation-tools
            • Language
            • 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
    • Macro-info-object

    Macro-info-object->replace

    Get the replace field from a macro-info-object.

    Signature
    (macro-info-object->replace x) → replace
    Arguments
    x — Guard (macro-infop x).
    Returns
    replace — Type (plexeme-listp replace).

    This is an ordinary field accessor created by fty::defprod.

    Definitions and Theorems

    Function: macro-info-object->replace$inline

    (defun macro-info-object->replace$inline (x)
      (declare (xargs :guard (macro-infop x)))
      (declare (xargs :guard (equal (macro-info-kind x) :object)))
      (mbe :logic
           (b* ((x (and (equal (macro-info-kind x) :object)
                        x))
                (replace (plexeme-list-fix (std::da-nth 0 (cdr x)))))
             (if (plexeme-list-token/space-p replace)
                 replace
               nil))
           :exec (std::da-nth 0 (cdr x))))

    Theorem: plexeme-listp-of-macro-info-object->replace

    (defthm plexeme-listp-of-macro-info-object->replace
      (b* ((replace (macro-info-object->replace$inline x)))
        (plexeme-listp replace))
      :rule-classes :rewrite)

    Theorem: macro-info-object->replace$inline-of-macro-info-fix-x

    (defthm macro-info-object->replace$inline-of-macro-info-fix-x
      (equal (macro-info-object->replace$inline (macro-info-fix x))
             (macro-info-object->replace$inline x)))

    Theorem: macro-info-object->replace$inline-macro-info-equiv-congruence-on-x

    (defthm
     macro-info-object->replace$inline-macro-info-equiv-congruence-on-x
     (implies (macro-info-equiv x x-equiv)
              (equal (macro-info-object->replace$inline x)
                     (macro-info-object->replace$inline x-equiv)))
     :rule-classes :congruence)

    Theorem: macro-info-object->replace-when-wrong-kind

    (defthm macro-info-object->replace-when-wrong-kind
     (implies
       (not (equal (macro-info-kind x) :object))
       (equal (macro-info-object->replace x)
              (b* ((x nil)
                   (replace (plexeme-list-fix (std::da-nth 0 (cdr x)))))
                (if (plexeme-list-token/space-p replace)
                    replace
                  nil)))))