• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
        • Deftreeops
        • Defdefparse
        • Defgrammar
        • Tree-utilities
        • Notation
        • Grammar-parser
        • Meta-circular-validation
        • Parsing-primitives-defresult
        • Parsing-primitives-seq
        • Operations
          • In-terminal-set
          • Well-formedness
          • Closure
          • Plugging
          • Ambiguity
          • Renaming
            • Rule-rename-rule
            • Rulelist-rename-rule
            • Element-rename-rule
              • Concatenation-rename-rule
              • Alternation-rename-rule
              • Repetition-rename-rule
            • Numeric-range-retrieval
            • Rule-utilities
            • Removal
            • Character-value-retrieval
          • Examples
          • Differences-with-paper
          • Constructor-utilities
          • Grammar-printer
          • Parsing-tools
        • Vwsim
        • Isar
        • Wp-gen
        • Dimacs-reader
        • Pfcs
        • Legacy-defrstobj
        • Proof-checker-array
        • Soft
        • C
        • Farray
        • Rp-rewriter
        • Instant-runoff-voting
        • Imp-language
        • Sidekick
        • Leftist-trees
        • Java
        • Taspi
        • Bitcoin
        • Riscv
        • 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
        • Bigmems
        • Builtins
        • Execloader
        • Aleo
        • Solidity
        • Paco
        • Concurrent-programs
        • Bls12-377-curves
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • Renaming

    Element-rename-rule

    Rename all the occurrences of a rule name in an element to a new rule name.

    Signature
    (element-rename-rule element oldname newname) → new-element
    Arguments
    element — Guard (elementp element).
    oldname — Guard (rulenamep oldname).
    newname — Guard (rulenamep newname).
    Returns
    new-element — Type (elementp new-element).

    Function: element-rename-rule

    (defun element-rename-rule (element oldname newname)
     (declare (xargs :guard (and (elementp element)
                                 (rulenamep oldname)
                                 (rulenamep newname))))
     (element-case
      element :rulename
      (if (equal element.get oldname)
          (element-rulename newname)
        (element-fix element))
      :group (element-group
                  (alternation-rename-rule element.get oldname newname))
      :option
      (element-option
           (alternation-rename-rule element.get oldname newname))
      :char-val (element-fix element)
      :num-val (element-fix element)
      :prose-val (element-fix element)))