• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
      • Apt
      • Zfc
      • Acre
      • Milawa
      • Smtlink
      • Abnf
        • Deftreeops
        • Defdefparse
        • Defgrammar
        • Tree-utilities
        • Notation
          • Syntax-abstraction
          • Semantics
          • Abstract-syntax
            • Convenience-constructors
              • /_
              • %x-
              • %d-
              • %b-
              • =_
              • =/_
              • Def-rule-const
                • =_-fn
                • =/_-fn
                • Repetition/element/rulename/charstring-p
                • <>
                • %x.
                • %d.
                • %b.
                • Repetition/element/rulename/charstring-listp
                • ?_
                • !_
                • Def-rule-const-fn
                • *_
                • 1*_
                • ?_-fn
                • /_-fn
                • !_-fn
                • Element/rulename-p
                • %x.-fn
                • %d.-fn
                • %b.-fn
              • Num-val
              • Char-val
              • Repeat-range
              • Rulename
              • Rule
              • Rulename-option
              • Num-base
              • Rule-option
              • Prose-val
              • Rulelist
              • Char-val-set
              • Rulename-set
              • Rulename-list
              • Grammar
              • Alt/conc/rep/elem
            • Core-rules
            • Concrete-syntax
          • Grammar-parser
          • Meta-circular-validation
          • Parsing-primitives-defresult
          • Parsing-primitives-seq
          • Operations
          • 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
    • Convenience-constructors

    Def-rule-const

    Introduce an ACL2 constant for a (non-incremental) rule.

    The name argument must be a valid constant name. The name argument is followed by a variable number of forms that must evaluate to concatenations, whose list is the alternation that is the definiens of the rule. The name of the constant that defines the rule is obtained from name by inserting rule_ just after the starting *.

    Macro: def-rule-const

    (defmacro def-rule-const (name &rest concatenation-forms)
     (cons
          'make-event
          (cons (cons 'def-rule-const-fn
                      (cons (cons 'quote (cons name 'nil))
                            (cons (cons 'quote
                                        (cons concatenation-forms 'nil))
                                  'nil)))
                'nil)))

    Definitions and Theorems

    Function: def-rule-const-fn

    (defun def-rule-const-fn (name concatenation-forms)
     (declare
       (xargs
            :guard (and (legal-constantp name)
                        (pseudo-event-form-listp concatenation-forms))))
     (b*
       ((name-string (symbol-name name))
        (name-chars (explode name-string))
        (name-chars-without-1st-* (cdr name-chars))
        (name-string-without-1st-* (implode name-chars-without-1st-*))
        (const-string (concatenate 'common-lisp::string
                                   "*RULE_" name-string-without-1st-*))
        (const-name (intern-in-package-of-symbol const-string name)))
       (cons 'defval
             (cons const-name
                   (cons (cons '=_
                               (cons name concatenation-forms))
                         'nil)))))

    Theorem: pseudo-event-formp-of-def-rule-const-fn

    (defthm pseudo-event-formp-of-def-rule-const-fn
      (b* ((const-event (def-rule-const-fn name concatenation-forms)))
        (pseudo-event-formp const-event))
      :rule-classes :rewrite)