• 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
            • 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
    • Transformations

    Disambiguator

    The Disambiguator transformation.

    The Disambiguator transformation described in [Solidity: Internals: The Optimizer: Yul-Based Optimizer Module: Preprocessing: Disambiguator], makes all the variable and function names globally unique by renaming them.

    Conceptually, this transformation could be split into two: one that disambiguates variables, and one that disambiguates functions; the two are independent, and can be applied in any order. We follow this approach, by formalizing the disambiguation of variables and functions separately, and by defining Disambiguator as their combination.

    There are many possible ways to rename variables or functions so that they are globally unique. To avoid committing to a specific renaming approach, we characterize these transformations relationally instead of functionally: instead of defining a function that turns the original code into the transformed code, we define a predicate over original and transformed code that holds when the two have the same structure except for possibly the variable or function names.

    This relational formulation of the disambiguation of variables and functions opens the door to defining each as the combination of a renaming relation that may or may not yield globally unique names, and an additional uniqueness requirement on the transformed code. Thus, the Disambiguator transformation is characterized relationally as the combination of variable renaming, function renaming, variable uniqueness, and function uniqueness.