• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Hons-and-memoization
      • Events
      • History
      • Parallelism
      • Programming
        • Defun
        • Declare
        • System-utilities
        • Stobj
        • State
        • Memoize
        • Mbe
        • Io
        • Defpkg
        • Apply$
        • Mutual-recursion
        • Loop$
        • Programming-with-state
        • Arrays
        • Characters
        • Time$
        • Loop$-primer
        • Fast-alists
        • Defmacro
        • Defconst
        • Evaluation
        • Guard
        • Equality-variants
        • Compilation
        • Hons
        • ACL2-built-ins
        • Developers-guide
        • System-attachments
        • Advanced-features
        • Set-check-invariant-risk
        • Numbers
        • Irrelevant-formals
        • Efficiency
        • Introduction-to-programming-in-ACL2-for-those-who-know-lisp
        • Redefining-programs
        • Lists
        • Invariant-risk
        • Errors
        • Defabbrev
        • Conses
        • Alists
        • Set-register-invariant-risk
        • Strings
        • Program-wrapper
        • Get-internal-time
        • Basics
        • Packages
          • Defpkg
          • *ACL2-exports*
          • *common-lisp-symbols-from-main-lisp-package*
          • Pkg-imports
          • Symbol-package-name
          • Intern
          • Working-with-packages
          • Hidden-death-package
          • Intern-in-package-of-symbol
          • ACL2-user
          • Package-reincarnation-import-restrictions
          • Packages-for-generated-symbols
            • Pkg-witness
            • In-package
            • *ACL2-system-exports*
            • Intern$
            • Sharp-bang-reader
            • Managing-ACL2-packages
            • Hidden-defpkg
          • Defmacro-untouchable
          • Primitive
          • <<
          • Revert-world
          • Set-duplicate-keys-action
          • Unmemoize
          • Symbols
          • Def-list-constructor
          • Easy-simplify-term
          • Defiteration
          • Defopen
          • Sleep
        • Start-here
        • Real
        • Debugging
        • Miscellaneous
        • Output-controls
        • Macros
        • Interfacing-tools
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Packages

    Packages-for-generated-symbols

    Convention for packages of generated symbols

    ACL2 utilities, whether defined in the ACL2 sources or in books, will ideally provide the following default behavior when feasible: generated symbols should be in the current-package. This is the ACL2 version of the general principle enforced by almost all programming languages: names introduced are, by default, in the current namespace. We do not claim that ACL2 currently adheres to this principle in all cases, but our hope that this situation is improved over time. Indeed, the utilities defequiv, defrefinement and defcong have been improved to conform to this principle; see note-8-3. We hope that future utilities, not only in ACL2 but also in the community-books, will respect this principle when feasible. Conforming to this principle requires using make-event in a top level form to determine the current-package from state and then passing this package to functions that generate symbols. The section Symbol generation utilities of ACL2 source file defthm.lisp contains utilities that are useful for generating symbols. The code was adapted from similar code in ACL2s; see the community book acl2s/utilities.lisp which includes even more such utilities. To see an example of a utility that generates symbols in the current package, see books/acl2s/defunc.lisp, which contains the ACL2s::defunc utility. Other examples include defequiv, defrefinement and defcong in defthm.lisp.