• 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
          • Syntax-for-tools
          • Atc
          • Language
          • Representation
          • Transformation-tools
            • Simpadd0
            • Deftrans
            • Splitgso
            • Constant-propagation
            • Split-fn
            • Copy-fn
            • Specialize
            • Split-all-gso
            • Rename
            • Utilities
              • Free-vars
              • Call-graphs
              • Fresh-ident-utility
                • Fresh-numbered-string-wrt
                • Fresh-numbered-string-wrt0
                • Transunit-ensemble-fresh-ident
                • Fresh-idents
                • Fresh-string-wrt
                • Fresh-ident
                  • Make-numbered-string
                  • Map-ident->unwrap
                • Collect-idents
            • Insertion-sort
            • Pack
          • Bv
          • Imp-language
          • Event-macros
          • Java
          • Bitcoin
          • Ethereum
          • Yul
          • 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
    • Fresh-ident-utility

    Fresh-ident

    Signature
    (fresh-ident ident 
                 blacklist &key (number-prefix '"_") 
                 (number-suffix '"")) 
     
      → 
    ident$
    Arguments
    ident — Guard (identp ident).
    blacklist — Guard (ident-setp blacklist).
    number-prefix — Guard (stringp number-prefix).
    number-suffix — Guard (stringp number-suffix).
    Returns
    ident$ — Type (identp ident$).

    Definitions and Theorems

    Function: fresh-ident-fn

    (defun fresh-ident-fn (ident blacklist number-prefix number-suffix)
      (declare (xargs :guard (and (identp ident)
                                  (ident-setp blacklist)
                                  (stringp number-prefix)
                                  (stringp number-suffix))))
      (let ((__function__ 'fresh-ident))
        (declare (ignorable __function__))
        (b* ((ident-string (ident->unwrap ident))
             ((unless (stringp ident-string))
              (raise "Identifier ~x0 does not contain a string."
                     ident)
              (c$::irr-ident))
             (string-blacklist (map-ident->unwrap blacklist)))
          (ident (fresh-string-wrt ident-string number-prefix
                                   number-suffix string-blacklist)))))

    Theorem: identp-of-fresh-ident

    (defthm identp-of-fresh-ident
      (b*
       ((ident$ (fresh-ident-fn ident
                                blacklist number-prefix number-suffix)))
       (identp ident$))
      :rule-classes :rewrite)