• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
      • Vwsim
      • Isar
      • Wp-gen
      • Dimacs-reader
      • Pfcs
      • Legacy-defrstobj
      • Proof-checker-array
      • Soft
      • C
        • Syntax-for-tools
        • Atc
        • Language
        • Representation
        • Transformation-tools
          • Simpadd0
          • Splitgso
          • Constant-propagation
          • Split-fn
          • Specialize
          • Split-all-gso
          • Copy-fn
          • 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
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Riscv
        • Bitcoin
        • Des
        • Ethereum
        • X86isa
        • Sha-2
        • Yul
        • Zcash
        • Proof-checker-itp13
        • Regex
        • ACL2-programming-language
        • Json
        • Jfkr
        • Equational
        • Cryptography
        • Poseidon
        • Where-do-i-place-my-book
        • Axe
        • Aleo
        • Bigmems
        • Builtins
        • Execloader
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Community
      • Proof-automation
      • ACL2
      • Macro-libraries
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • 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)