• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
      • Io
      • Defttag
      • Sys-call
      • Save-exec
      • Quicklisp
      • Std/io
      • Oslib
      • Bridge
      • Clex
      • Tshell
      • Unsound-eval
      • Hacker
      • ACL2s-interface
      • Startup-banner
      • Command-line
        • Save-exec
        • Argv
        • Getopt
          • Demo-p
            • Parse-demo
              • Parse-demo-long
              • Parse-demo-aux
              • Parse-demo-bundle
              • Parse-demo-short->long-list
              • Parse-demo-short->long
            • Demo
            • Make-demo
            • Change-demo
            • Honsed-demo
            • Make-honsed-demo
            • *demo-usage*
            • Demo->version
            • Demo->verbose
            • Demo->username
            • Demo->port
            • Demo->help
            • Demo->extra-stuff2
            • Demo->extra-stuff
            • Demo->dirs
          • Defoptions
          • Demo2
          • Parsers
          • Sanity-check-formals
          • Formal->parser
          • Formal->argname
          • Formal->longname
          • Formal->alias
          • Formal->usage
          • Formal->merge
          • Formal->hiddenp
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Demo-p

Parse-demo

Parse arguments from the command line into a demo-p aggregate.

Signature
(parse-demo args &key (getopt::init '*default-demo*)) 
  → 
(mv getopt::errmsg getopt::result getopt::extra)
Arguments
args — The command line arguments to parse, which is typically derived from argv.
    Guard (string-listp args).
getopt::init — An initial demo-p to start from, which gives the default values for each field.
    Guard (demo-p getopt::init).
Returns
getopt::errmsg — NIL on success, or an error message produced by msg, suitable for printing the fmt directive ~@.
getopt::result — An updated version of init where the command-line arguments have been applied. On any error, this may be only partially updated.
    Type (demo-p getopt::result), given (force (demo-p getopt::init)).
getopt::extra — Any other arguments in args that were not recognized as options. Typically this might include the "main" arguments to a program, e.g., file names, etc., that aren't associated with --options.
    Type (string-listp getopt::extra), given (force (string-listp args)).

This is an ordinary command line parser, automatically produced by getopt.

Definitions and Theorems

Function: parse-demo-fn

(defun parse-demo-fn (args getopt::init)
  (declare (xargs :guard (and (string-listp args)
                              (demo-p getopt::init))))
  (let ((acl2::__function__ 'parse-demo))
    (declare (ignorable acl2::__function__))
    (parse-demo-aux args getopt::init nil nil)))

Theorem: demo-p-of-parse-demo.result

(defthm demo-p-of-parse-demo.result
  (implies (force (demo-p getopt::init))
           (b* (((mv getopt::?errmsg
                     getopt::?result getopt::?extra)
                 (parse-demo-fn args getopt::init)))
             (demo-p getopt::result)))
  :rule-classes :rewrite)

Theorem: string-listp-of-parse-demo.extra

(defthm string-listp-of-parse-demo.extra
  (implies (force (string-listp args))
           (b* (((mv getopt::?errmsg
                     getopt::?result getopt::?extra)
                 (parse-demo-fn args getopt::init)))
             (string-listp getopt::extra)))
  :rule-classes :rewrite)

Subtopics

Parse-demo-long
Parse-demo-aux
Parse-demo-bundle
Parse-demo-short->long-list
Parse-demo-short->long