• 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
              • Disambiguator
                • Dimb-exprs/decls/stmts
                • Dimb-make/adjust-expr-cast
                • Dimb-make/adjust-expr-binary
                • Dimb-params-to-names
                • Dimb-fundef
                • Dimb-cast/call-to-call
                • Dimb-transunit
                • Dimb-dirdeclor
                • Dimb-transunit-ensemble
                • Dimb-make/adjust-expr-unary
                • Dimb-expr
                • Dimb-amb-declor/absdeclor
                • Dimb-cast/call-to-cast
                • Dimb-cast/addsub-to-cast
                • Dimb-cast/addsub-to-addsub
                • Dimb-add-ident
                • Dimb-kind
                • Dimb-amb-expr/tyname
                • Dimb-ext-declon-list
                • Dimb-ext-declon
                • Dimb-cast/logand-to-logand
                • Dimb-cast/and-to-cast
                • Dimb-cast/mul-to-cast
                • Dimb-cast/logand-to-cast
                • Dimb-cast/mul-to-mul
                • Dimb-cast/and-to-and
                • Dimb-declor
                • Dimb-kind-option
                • Dimb-type-spec
                • Dimb-add-ident-objfun-file-scope
                • Dimb-make/adjust-expr-label-addr
                  • Dimb-param-declor
                  • Dimb-lookup-ident
                  • Dimb-decl-spec
                  • Dimb-add-idents-objfun
                  • Dimb-add-ident-objfun
                  • Dimb-param-declon
                  • Dimb-amb-declon/stmt
                  • Dimb-table
                  • Dimb-pop-scope
                  • Dimb-init-declor
                  • Dimb-stmt
                  • Dimb-push-scope
                  • Dimb-comp-stmt
                  • Dimb-declor-option
                  • Dimb-enum-spec
                  • Dimb-declon
                  • Dimb-struct-declor
                  • Dimb-scope
                  • Dimb-init-declor-list
                  • Dimb-decl-spec-list
                  • Dimb-absdeclor
                  • Dimb-dirabsdeclor
                  • Dimb-align-spec
                  • Dimb-struni-spec
                  • Dimb-init-table
                  • Dimb-spec/qual-list
                  • Dimb-spec/qual
                  • Irr-dimb-table
                  • Irr-dimb-kind
                  • Dimb-param-declon-list
                  • Dimb-enumer-list
                  • Dimb-enumer
                  • Dimb-dirabsdeclor-option
                  • Dimb-block-item
                  • Dimb-struct-declor-list
                  • Dimb-struct-declon-list
                  • Dimb-struct-declon
                  • Dimb-statassert
                  • Dimb-label
                  • Dimb-desiniter-list
                  • Dimb-desiniter
                  • Dimb-declon-list
                  • Dimb-const-expr-option
                  • Dimb-absdeclor-option
                  • Dimb-member-designor
                  • Dimb-initer-option
                  • Dimb-genassoc-list
                  • Dimb-genassoc
                  • Dimb-expr-option
                  • Dimb-expr-list
                  • Dimb-designor-list
                  • Dimb-designor
                  • Dimb-const-expr
                  • Dimb-block-item-list
                  • Dimb-tyname
                  • Dimb-initer
                • Unambiguity
              • Validation
              • Gcc-builtins
              • 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
    • Disambiguator

    Dimb-make/adjust-expr-label-addr

    Build, and adjust if needed, a label address expression.

    Signature
    (dimb-make/adjust-expr-label-addr arg) → expr
    Arguments
    arg — Guard (exprp arg).
    Returns
    expr — Type (exprp expr).

    This is analogous to dimb-make/adjust-expr-unary, but for label address expression, which are conceptually similar to unary expressions, but have a different AST structure.

    The unary operator && expects an identifier, so we test directly for that. If the argument is not an identifier, it must be a binary expression; the caller takes care of checking this.

    Definitions and Theorems

    Function: dimb-make/adjust-expr-label-addr

    (defun dimb-make/adjust-expr-label-addr (arg)
     (declare (xargs :guard (exprp arg)))
     (declare (xargs :guard (expr-unambp arg)))
     (let ((__function__ 'dimb-make/adjust-expr-label-addr))
      (declare (ignorable __function__))
      (b*
       (((when (expr-case arg :ident))
         (expr-label-addr (expr-ident->ident arg)))
        ((unless (expr-case arg :binary))
         (raise
          "Internal error: ~
                    non-binary expression ~x0 ~
                    used as argument of unary operator &&."
          (expr-fix arg))
         (expr-fix arg)))
       (make-expr-binary
        :op (expr-binary->op arg)
        :arg1 (dimb-make/adjust-expr-label-addr (expr-binary->arg1 arg))
        :arg2 (expr-binary->arg2 arg)
        :info nil))))

    Theorem: exprp-of-dimb-make/adjust-expr-label-addr

    (defthm exprp-of-dimb-make/adjust-expr-label-addr
      (b* ((expr (dimb-make/adjust-expr-label-addr arg)))
        (exprp expr))
      :rule-classes :rewrite)

    Theorem: expr-unambp-of-dimb-make/adjust-expr-label-addr

    (defthm expr-unambp-of-dimb-make/adjust-expr-label-addr
      (implies (expr-unambp arg)
               (b* ((?expr (dimb-make/adjust-expr-label-addr arg)))
                 (expr-unambp expr))))

    Theorem: dimb-make/adjust-expr-label-addr-of-expr-fix-arg

    (defthm dimb-make/adjust-expr-label-addr-of-expr-fix-arg
      (equal (dimb-make/adjust-expr-label-addr (expr-fix arg))
             (dimb-make/adjust-expr-label-addr arg)))

    Theorem: dimb-make/adjust-expr-label-addr-expr-equiv-congruence-on-arg

    (defthm
          dimb-make/adjust-expr-label-addr-expr-equiv-congruence-on-arg
      (implies (expr-equiv arg arg-equiv)
               (equal (dimb-make/adjust-expr-label-addr arg)
                      (dimb-make/adjust-expr-label-addr arg-equiv)))
      :rule-classes :congruence)