• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
        • Mlib
        • Server
        • Kit
          • Vl-model
            • Vl-model-opts-p
              • Parse-vl-model-opts
                • Parse-vl-model-opts-long
                  • Parse-vl-model-opts-aux
                  • Parse-vl-model-opts-bundle
                  • Parse-vl-model-opts-short->long-list
                  • Parse-vl-model-opts-short->long
                • Vl-model-opts
                • Make-vl-model-opts
                • Honsed-vl-model-opts
                • Change-vl-model-opts
                • *vl-model-opts-usage*
                • Make-honsed-vl-model-opts
                • Vl-model-opts->verilog-file
                • Vl-model-opts->unroll-limit
                • Vl-model-opts->strict
                • Vl-model-opts->start-files
                • Vl-model-opts->search-path
                • Vl-model-opts->search-exts
                • Vl-model-opts->readme
                • Vl-model-opts->outdir
                • Vl-model-opts->mustget
                • Vl-model-opts->mustfail
                • Vl-model-opts->model-file
                • Vl-model-opts->mem
                • Vl-model-opts->include-dirs
                • Vl-model-opts->help
                • Vl-model-opts->esims-file
                • Vl-model-opts->edition
                • Vl-model-opts->dropmods
                • Vl-model-opts->defines
            • Vl-json
            • Vl-gather
            • Vl-server
            • Vl-pp
            • Vl-lint
            • Vl-main
            • Vl-toolkit-other-command
            • Vl-help
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Parse-vl-model-opts

    Parse-vl-model-opts-long

    Signature
    (parse-vl-model-opts-long getopt::longname getopt::explicit-val 
                              args getopt::acc getopt::seen) 
     
      → 
    (mv getopt::errmsg getopt::acc rest)
    Arguments
    getopt::longname — Longname we've just found, e.g., "foo" if we've just seen --foo=bar.
        Guard (stringp getopt::longname).
    getopt::explicit-val — Any explicit value passed to this option, e.g., "bar" if we've just seen --foo=bar, or NIL if we've just seen --foo.
        Guard (or (not getopt::explicit-val) (stringp getopt::explicit-val)).
    args — Remaining arguments past longname.
        Guard (string-listp args).
    getopt::acc — Structure we're updating.
        Guard (vl-model-opts-p getopt::acc).
    getopt::seen — List of longnames that we've seen so far.
        Guard (string-listp getopt::seen).
    Returns
    getopt::errmsg — NIL on success or an error message.
    getopt::acc — Updated structure.
        Type (vl-model-opts-p getopt::acc), given (force (vl-model-opts-p getopt::acc)).
    rest — Rest after this one.
        Type (string-listp rest), given (force (string-listp args)).

    Definitions and Theorems

    Function: parse-vl-model-opts-long

    (defun parse-vl-model-opts-long
           (getopt::longname getopt::explicit-val
                             args getopt::acc getopt::seen)
     (declare (xargs :guard (and (stringp getopt::longname)
                                 (or (not getopt::explicit-val)
                                     (stringp getopt::explicit-val))
                                 (string-listp args)
                                 (vl-model-opts-p getopt::acc)
                                 (string-listp getopt::seen))))
     (let ((__function__ 'parse-vl-model-opts-long))
      (declare (ignorable __function__))
      (cond
        ((equal getopt::longname "help")
         (b* (((when (member-equal getopt::longname getopt::seen))
               (mv (msg "Option --~s0 given multiple times"
                        getopt::longname)
                   getopt::acc args))
              ((mv getopt::err value rest)
               (getopt::parse-plain (cat "--" getopt::longname)
                                    getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :help value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "readme")
         (b* (((when (member-equal getopt::longname getopt::seen))
               (mv (msg "Option --~s0 given multiple times"
                        getopt::longname)
                   getopt::acc args))
              ((mv getopt::err value rest)
               (getopt::parse-plain (cat "--" getopt::longname)
                                    getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :readme value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "outdir")
         (b* (((when (member-equal getopt::longname getopt::seen))
               (mv (msg "Option --~s0 given multiple times"
                        getopt::longname)
                   getopt::acc args))
              ((mv getopt::err value rest)
               (getopt::parse-string (cat "--" getopt::longname)
                                     getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :outdir value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "model-file")
         (b* (((when (member-equal getopt::longname getopt::seen))
               (mv (msg "Option --~s0 given multiple times"
                        getopt::longname)
                   getopt::acc args))
              ((mv getopt::err value rest)
               (getopt::parse-string (cat "--" getopt::longname)
                                     getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :model-file value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "esims-file")
         (b* (((when (member-equal getopt::longname getopt::seen))
               (mv (msg "Option --~s0 given multiple times"
                        getopt::longname)
                   getopt::acc args))
              ((mv getopt::err value rest)
               (getopt::parse-string (cat "--" getopt::longname)
                                     getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :esims-file value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "verilog-file")
         (b* (((when (member-equal getopt::longname getopt::seen))
               (mv (msg "Option --~s0 given multiple times"
                        getopt::longname)
                   getopt::acc args))
              ((mv getopt::err value rest)
               (getopt::parse-string (cat "--" getopt::longname)
                                     getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :verilog-file value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "search")
         (b*
           (((mv getopt::err value rest)
             (getopt::parse-string (cat "--" getopt::longname)
                                   getopt::explicit-val args))
            ((when getopt::err)
             (mv getopt::err getopt::acc args))
            (getopt::old-value (vl-model-opts->search-path getopt::acc))
            (value (acl2::rcons value getopt::old-value))
            (getopt::acc (change-vl-model-opts getopt::acc
                                               :search-path value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "incdir")
         (b*
          (((mv getopt::err value rest)
            (getopt::parse-string (cat "--" getopt::longname)
                                  getopt::explicit-val args))
           ((when getopt::err)
            (mv getopt::err getopt::acc args))
           (getopt::old-value (vl-model-opts->include-dirs getopt::acc))
           (value (acl2::rcons value getopt::old-value))
           (getopt::acc (change-vl-model-opts getopt::acc
                                              :include-dirs value)))
          (mv nil getopt::acc rest)))
        ((equal getopt::longname "searchext")
         (b*
           (((mv getopt::err value rest)
             (getopt::parse-string (cat "--" getopt::longname)
                                   getopt::explicit-val args))
            ((when getopt::err)
             (mv getopt::err getopt::acc args))
            (getopt::old-value (vl-model-opts->search-exts getopt::acc))
            (value (acl2::rcons value getopt::old-value))
            (getopt::acc (change-vl-model-opts getopt::acc
                                               :search-exts value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "define")
         (b* (((mv getopt::err value rest)
               (getopt::parse-string (cat "--" getopt::longname)
                                     getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::old-value (vl-model-opts->defines getopt::acc))
              (value (cons value getopt::old-value))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :defines value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "unroll")
         (b* (((when (member-equal getopt::longname getopt::seen))
               (mv (msg "Option --~s0 given multiple times"
                        getopt::longname)
                   getopt::acc args))
              ((mv getopt::err value rest)
               (getopt::parse-nat (cat "--" getopt::longname)
                                  getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :unroll-limit value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "drop")
         (b* (((mv getopt::err value rest)
               (getopt::parse-string (cat "--" getopt::longname)
                                     getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::old-value (vl-model-opts->dropmods getopt::acc))
              (value (cons value getopt::old-value))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :dropmods value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "edition")
         (b* (((when (member-equal getopt::longname getopt::seen))
               (mv (msg "Option --~s0 given multiple times"
                        getopt::longname)
                   getopt::acc args))
              ((mv getopt::err value rest)
               (vl-parse-edition (cat "--" getopt::longname)
                                 getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :edition value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "strict")
         (b* (((when (member-equal getopt::longname getopt::seen))
               (mv (msg "Option --~s0 given multiple times"
                        getopt::longname)
                   getopt::acc args))
              ((mv getopt::err value rest)
               (getopt::parse-plain (cat "--" getopt::longname)
                                    getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :strict value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "mem")
         (b* (((when (member-equal getopt::longname getopt::seen))
               (mv (msg "Option --~s0 given multiple times"
                        getopt::longname)
                   getopt::acc args))
              ((mv getopt::err value rest)
               (getopt::parse-pos (cat "--" getopt::longname)
                                  getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :mem value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "mustfail")
         (b* (((mv getopt::err value rest)
               (getopt::parse-string (cat "--" getopt::longname)
                                     getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::old-value (vl-model-opts->mustfail getopt::acc))
              (value (acl2::rcons value getopt::old-value))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :mustfail value)))
           (mv nil getopt::acc rest)))
        ((equal getopt::longname "mustget")
         (b* (((mv getopt::err value rest)
               (getopt::parse-string (cat "--" getopt::longname)
                                     getopt::explicit-val args))
              ((when getopt::err)
               (mv getopt::err getopt::acc args))
              (getopt::old-value (vl-model-opts->mustget getopt::acc))
              (value (acl2::rcons value getopt::old-value))
              (getopt::acc (change-vl-model-opts getopt::acc
                                                 :mustget value)))
           (mv nil getopt::acc rest)))
        (t (mv (msg "Unrecognized option --~s0"
                    getopt::longname)
               getopt::acc args)))))

    Theorem: vl-model-opts-p-of-parse-vl-model-opts-long.acc

    (defthm vl-model-opts-p-of-parse-vl-model-opts-long.acc
     (implies
      (force (vl-model-opts-p getopt::acc))
      (b*
       (((mv getopt::?errmsg
             getopt::?acc common-lisp::?rest)
         (parse-vl-model-opts-long getopt::longname getopt::explicit-val
                                   args getopt::acc getopt::seen)))
       (vl-model-opts-p getopt::acc)))
     :rule-classes :rewrite)

    Theorem: string-listp-of-parse-vl-model-opts-long.rest

    (defthm string-listp-of-parse-vl-model-opts-long.rest
     (implies
      (force (string-listp args))
      (b*
       (((mv getopt::?errmsg
             getopt::?acc common-lisp::?rest)
         (parse-vl-model-opts-long getopt::longname getopt::explicit-val
                                   args getopt::acc getopt::seen)))
       (string-listp rest)))
     :rule-classes :rewrite)

    Theorem: parse-vl-model-opts-long-makes-progress

    (defthm parse-vl-model-opts-long-makes-progress
     (<=
      (len
       (mv-nth
         2
         (parse-vl-model-opts-long getopt::longname getopt::explicit-val
                                   args getopt::acc getopt::seen)))
      (len args))
     :rule-classes ((:rewrite) (:linear)))