• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
    • Software-verification
      • Kestrel-books
        • Crypto-hdwallet
        • Error-checking
        • Apt
        • Abnf
        • Fty-extensions
        • Isar
        • Kestrel-utilities
          • Omaps
          • Directed-untranslate
          • Include-book-paths
          • Ubi
          • Digits-any-base
          • Context-message-pair
          • Numbered-names
          • With-auto-termination
          • Make-termination-theorem
          • Theorems-about-true-list-lists
          • Checkpoint-list
          • Sublis-expr+
          • Prove$
          • Defthm<w
          • System-utilities-non-built-in
          • Integer-range-fix
          • Add-const-to-untranslate-preprocess
          • Minimize-ruler-extenders
          • Integers-from-to
          • Unsigned-byte-fix
          • Signed-byte-fix
          • Defthmr
          • Paired-names
          • Unsigned-byte-list-fix
          • Signed-byte-list-fix
          • Show-books
          • List-utilities
          • Skip-in-book
          • Typed-tuplep
          • 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
            • Book-runes-alist
            • User-interface
            • Bits/ubyte11s-digit-grouping
            • Bits/bytes-digit-grouping
            • Message-utilities
            • Subsetp-eq-linear
            • Strict-merge-sort-<
            • Miscellaneous-enumerations
            • Maybe-unquote
            • Oset-utilities
            • Thm<w
            • Defthmd<w
            • Io-utilities
          • Prime-field-constraint-systems
          • Soft
          • Bv
          • Imp-language
          • Event-macros
          • Bitcoin
          • Ethereum
          • Yul
          • Zcash
          • ACL2-programming-language
          • Prime-fields
          • Java
          • C
          • Syntheto
          • Number-theory
          • Cryptography
          • Lists-light
          • File-io-light
          • Json
          • Built-ins
          • Axe
          • Solidity
          • Std-extensions
          • Htclient
          • Typed-lists-light
          • Arithmetic-light
        • X86isa
        • Axe
        • Execloader
      • Testing-utilities
      • Math
    • 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))))