• 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
          • Directed-untranslate
          • Include-book-paths
          • Ubi
          • Numbered-names
          • Digits-any-base
          • Context-message-pair
          • With-auto-termination
          • Make-termination-theorem
          • Theorems-about-true-list-lists
          • Checkpoint-list
          • Sublis-expr+
          • Integers-from-to
          • Prove$
          • Defthm<w
          • System-utilities-non-built-in
            • Pseudo-event-formp
            • Pseudo-event-form-listp
            • Directed-untranslate
            • Irrelevant-formals-info
            • Numbered-names
            • Context-message-pair
            • Prove$
            • Minimize-ruler-extenders
            • Paired-names
            • Orelse
            • Fresh-name-in-world-with-$s
            • Encapsulate-report-errors
            • On-failure
            • Chk-irrelevant-formals-ok
            • Named-formulas
              • Named-formulas-to-thm-events
              • Named-formula-to-thm-event
                • Prove-named-formulas
                • Prove-named-formula
                • Ensure-named-formulas
              • Pseudo-event-landmarkp
              • All-program-fns
              • All-logic-fns
              • Trans-eval-error-triple
              • Trans-eval-state
              • Pseudo-tests-and-callsp
              • User-interface
              • Pseudo-command-landmarkp
              • Pseudo-tests-and-calls-listp
              • Pseudo-command-formp
              • Orelse*
              • Identity-macro
            • Integer-range-fix
            • Minimize-ruler-extenders
            • Add-const-to-untranslate-preprocess
            • Unsigned-byte-fix
            • Signed-byte-fix
            • Defthmr
            • Paired-names
            • Unsigned-byte-list-fix
            • Signed-byte-list-fix
            • Show-books
            • Skip-in-book
            • Typed-tuplep
            • List-utilities
            • Checkpoint-list-pretty
            • Defunt
            • Keyword-value-list-to-alist
            • Magic-macroexpand
            • Top-command-number-fn
            • Bits-as-digits-in-base-2
            • Show-checkpoint-list
            • Ubyte11s-as-digits-in-base-2048
            • Named-formulas
              • Named-formulas-to-thm-events
              • Named-formula-to-thm-event
                • Prove-named-formulas
                • Prove-named-formula
                • Ensure-named-formulas
              • Bytes-as-digits-in-base-256
              • String-utilities
              • Make-keyword-value-list-from-keys-and-value
              • Defmacroq
              • Integer-range-listp
              • Apply-fn-if-known
              • Trans-eval-error-triple
              • Checkpoint-info-list
              • Previous-subsumer-hints
              • Fms!-lst
              • Zp-listp
              • Trans-eval-state
              • Injections
              • Doublets-to-alist
              • Theorems-about-osets
              • Typed-list-utilities
              • Message-utilities
              • Book-runes-alist
              • User-interface
              • Bits/ubyte11s-digit-grouping
              • Bits/bytes-digit-grouping
              • Subsetp-eq-linear
              • Oset-utilities
              • Strict-merge-sort-<
              • Miscellaneous-enumerations
              • Maybe-unquote
              • Thm<w
              • Defthmd<w
              • Io-utilities
            • Set
            • C
            • Soft
            • Bv
            • Imp-language
            • Ethereum
            • Event-macros
            • Java
            • Riscv
            • Bitcoin
            • Zcash
            • Yul
            • 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
      • Named-formulas

      Named-formula-to-thm-event

      Turn a named formula into a theorem event.

      Signature
      (named-formula-to-thm-event name formula hints rule-classes 
                                  enabled local names-to-avoid wrld) 
       
        → 
      (mv thm-event thm-name)
      Arguments
      name — Name of the formula to turn into a theorem event.
          Guard (symbolp name).
      formula — Formula for the theorem event (an untranslated term).
      hints — Hints for the theorem event.
          Guard (true-listp hints).
      rule-classes — Rule classes for the theorem event.
      enabled — Make the theorem event enabled or not.
          Guard (booleanp enabled).
      local — Make the theorem event local or not.
          Guard (booleanp local).
      names-to-avoid — Avoid these as theorem name.
          Guard (symbol-listp names-to-avoid).
      wrld — Guard (plist-worldp wrld).
      Returns
      thm-event — Theorem event (a pseudo-event-formp).
      thm-name — Name of the theorem event (a symbolp).

      If the name of the formula is not in use and not among the names to avoid, it is used as the name of the theorem event. Otherwise, it is made fresh by appending $ signs. If the initial name is a keyword, it is interned into the "ACL2" package before calling fresh-logical-name-with-$s-suffix, whose guard forbids keywords.

      Definitions and Theorems

      Function: named-formula-to-thm-event

      (defun named-formula-to-thm-event
             (name formula hints rule-classes
                   enabled local names-to-avoid wrld)
       (declare (xargs :guard (and (symbolp name)
                                   (true-listp hints)
                                   (booleanp enabled)
                                   (booleanp local)
                                   (symbol-listp names-to-avoid)
                                   (plist-worldp wrld))))
       (let ((__function__ 'named-formula-to-thm-event))
        (declare (ignorable __function__))
        (b*
         ((defthm/defthmd (theorem-intro-macro enabled))
          (name (if (keywordp name)
                    (intern (symbol-name name) "ACL2")
                  name))
          ((mv thm-name &)
           (fresh-logical-name-with-$s-suffix
                name nil names-to-avoid wrld))
          (thm-event
           (cons
             defthm/defthmd
             (cons thm-name
                   (cons formula
                         (cons ':hints
                               (cons hints
                                     (cons ':rule-classes
                                           (cons rule-classes 'nil))))))))
          (thm-event (if local (cons 'local (cons thm-event 'nil))
                       thm-event)))
         (mv thm-event thm-name))))