• 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
        • Soft
        • Bv
        • Imp-language
        • Ethereum
        • Event-macros
        • Java
        • Riscv
        • Bitcoin
        • Zcash
        • Yul
          • Transformations
          • Language
            • Abstract-syntax
            • Dynamic-semantics
            • Concrete-syntax
            • Static-soundness
            • Static-semantics
              • Static-safety-checking
              • Static-shadowing-checking
                • Check-shadow-statements/blocks/cases/fundefs
                  • Check-shadow-statement
                    • Check-shadow-fundef
                    • Check-shadow-block
                    • Check-shadow-statement-list
                    • Check-shadow-block-option
                    • Check-shadow-swcase-list
                    • Check-shadow-swcase
                • Mode-set-result
                • Literal-evaluation
                • Static-identifier-checking
                • Static-safety-checking-evm
                • Mode-set
                • Modes
              • Errors
            • Yul-json
          • 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
    • Check-shadow-statements/blocks/cases/fundefs

    Check-shadow-statement

    Check variable shadowing in a statement.

    Signature
    (check-shadow-statement stmt vars) → new-vars
    Arguments
    stmt — Guard (statementp stmt).
    vars — Guard (identifier-setp vars).
    Returns
    new-vars — Type (identifier-set-resultp new-vars).

    If the check is successful, we return a possibly updated set of visible variables. The set is actually updated only by variable declarations.

    Since the scope of a loop's initialization block extends to the whole loop, we first check the list of statments of the initialization block, obtaining a possibly updated set of visible variables, which is used to check the update and body blocks of the loop.