• 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
        • Bitcoin
        • Ethereum
        • Yul
          • Transformations
            • Renaming-variables
              • Statements/blocks/cases/fundefs-renamevar
              • Renaming-variables-execution
              • Expressions-renamevar
              • Add-var-to-var-renaming
              • Add-vars-to-var-renaming
              • Renaming-variables-safety
              • Fundef-list-renamevar
              • Expression-option-renamevar
              • Funcall-option-renamevar
              • Path-list-renamevar
              • Var-list-renamevar
              • Var-renamevar
              • Path-renamevar
              • Dead-code-eliminator
              • Renamings
              • Disambiguator
              • Unique-variables
              • Dead-code-eliminator-static-safety
              • No-function-definitions
              • Unique-functions
              • Renaming-functions
              • Dead-code-eliminator-no-loop-initializers
              • Dead-code-eliminator-no-function-definitions
              • No-loop-initializers
              • For-loop-init-rewriter
            • Language
            • Yul-json
          • 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
    • Renaming-variables

    Path-renamevar

    Check if two paths are related by variable renaming.

    Signature
    (path-renamevar old new ren) → _
    Arguments
    old — Guard (pathp old).
    new — Guard (pathp new).
    ren — Guard (renamingp ren).
    Returns
    _ — Type (reserr-optionp _).

    The two paths must be both singletons, whose identifiers must be related.

    Definitions and Theorems

    Function: path-renamevar

    (defun path-renamevar (old new ren)
      (declare (xargs :guard (and (pathp old)
                                  (pathp new)
                                  (renamingp ren))))
      (let ((__function__ 'path-renamevar))
        (declare (ignorable __function__))
        (b* ((old-ids (path->get old))
             ((unless (and (consp old-ids)
                           (endp (cdr old-ids))))
              (reserrf (list :non-singleton-old-path (path-fix old))))
             (old-id (car old-ids))
             (new-ids (path->get new))
             ((unless (and (consp new-ids)
                           (endp (cdr new-ids))))
              (reserrf (list :non-singleton-old-path (path-fix new))))
             (new-id (car new-ids)))
          (var-renamevar old-id new-id ren))))

    Theorem: reserr-optionp-of-path-renamevar

    (defthm reserr-optionp-of-path-renamevar
      (b* ((_ (path-renamevar old new ren)))
        (reserr-optionp _))
      :rule-classes :rewrite)

    Theorem: path-renamevar-of-path-fix-old

    (defthm path-renamevar-of-path-fix-old
      (equal (path-renamevar (path-fix old) new ren)
             (path-renamevar old new ren)))

    Theorem: path-renamevar-path-equiv-congruence-on-old

    (defthm path-renamevar-path-equiv-congruence-on-old
      (implies (path-equiv old old-equiv)
               (equal (path-renamevar old new ren)
                      (path-renamevar old-equiv new ren)))
      :rule-classes :congruence)

    Theorem: path-renamevar-of-path-fix-new

    (defthm path-renamevar-of-path-fix-new
      (equal (path-renamevar old (path-fix new) ren)
             (path-renamevar old new ren)))

    Theorem: path-renamevar-path-equiv-congruence-on-new

    (defthm path-renamevar-path-equiv-congruence-on-new
      (implies (path-equiv new new-equiv)
               (equal (path-renamevar old new ren)
                      (path-renamevar old new-equiv ren)))
      :rule-classes :congruence)

    Theorem: path-renamevar-of-renaming-fix-ren

    (defthm path-renamevar-of-renaming-fix-ren
      (equal (path-renamevar old new (renaming-fix ren))
             (path-renamevar old new ren)))

    Theorem: path-renamevar-renaming-equiv-congruence-on-ren

    (defthm path-renamevar-renaming-equiv-congruence-on-ren
      (implies (renaming-equiv ren ren-equiv)
               (equal (path-renamevar old new ren)
                      (path-renamevar old new ren-equiv)))
      :rule-classes :congruence)