• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
          • Vl-lint
          • Vl-server
            • Vls-scannedalist-p
            • Vls-loadedalist-p
            • Vls-commands
              • Vls-command-args-to-eformals
              • Vls-commandinfo-p
              • Vls-success
              • Vls-commandinfolist-p
              • Commands-table
              • Define-vls-command-fn
                • Vls-fail-fn
                • Vls-fail
                • Vls-command-arg-to-eformal
                • Vls-commandtype-p
                • Get-vls-commands
              • Vls-data-p
              • Vl-server-opts-p
              • Vl-descriptionlist-summaries
              • Vls-transdb
              • Vl-describe
              • Ts-queue
              • Vls-get-plainsrc
              • Vl-description->warnings
              • Vls-showloc
              • File-layout
              • Vls-remove-from-scannedalist
              • Vls-describe
              • Vl-server-top
              • Vls-port-table
              • Vl-find-description-insensitive
              • Vls-get-warnings
              • Vls-get-summary
              • Vls-get-origsrc
              • Vl-ppc-description
              • Vls-get-parents
              • Vls-get-children
              • Vls-data-origname-reportcard
              • Vls-data-from-zip
              • Start
              • Vls-make-scannedalist
              • Vls-get-summaries
              • Vls-get-unloaded-json
              • Vls-get-desctypes
              • Vls-scannedalist-to-json
              • Vls-loadedalist-to-json
              • Vl-description-summary
              • *vl-server-help*
              • Vl-descalist->descriptions/types
              • Stop
            • Vl-gather
            • Vl-zip
            • Vl-main
            • Split-plusargs
            • Vl-shell
            • Vl-json
          • Mlib
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vls-commands

    Define-vls-command-fn

    Signature
    (define-vls-command-fn name args type rest) → *

    Definitions and Theorems

    Function: define-vls-command-fn

    (defun define-vls-command-fn (name args type rest)
     (declare (xargs :guard t))
     (let ((__function__ 'define-vls-command-fn))
      (declare (ignorable __function__))
      (b*
       (((unless (symbolp name))
         (raise "Name must be a symbol, but got ~x0."
                name))
        ((unless (and (symbol-listp args)
                      (uniquep args)))
         (raise "Arguments to ~x0 must be unique symbols."
                name))
        ((unless
             (uniquep
                  (str::downcase-string-list (symbol-list-names args))))
         (raise "Arguments to ~x0 do not have unique symbol names."
                name))
        ((unless (member 'data args))
         (raise "Arguments to ~x0 do not include data."
                name))
        (reserved-names
             (intersection-equal '("BASE" "MODEL")
                                 (str::symbol-list-names args)))
        ((when reserved-names)
         (raise "Arguments to ~x0 use reserved names ~&1."
                reserved-names))
        ((unless (vls-commandtype-p type))
         (raise "Unrecognized command type for ~x0."
                name))
        (info (make-vls-commandinfo :fn name
                                    :args args
                                    :type type))
        (eargs (vls-command-args-to-eformals args)))
       (cons
        'progn
        (cons
         (cons
          'define
          (cons
               name
               (cons eargs
                     (cons ':returns
                           (cons '(ans stringp
                                       :rule-classes :type-prescription)
                                 rest)))))
         (cons
          (cons
            'table
            (cons 'vl-server
                  (cons ''commands
                        (cons (cons 'cons
                                    (cons (cons 'quote (cons info 'nil))
                                          '((get-vls-commands world))))
                              'nil))))
          'nil))))))