(parse-vl-json-opts-aux args getopt::acc getopt::seen getopt::skipped) → (mv getopt::errmsg getopt::result getopt::skipped)
Function:
(defun parse-vl-json-opts-aux (args getopt::acc getopt::seen getopt::skipped) (declare (xargs :guard (and (string-listp args) (vl-json-opts-p getopt::acc) (string-listp getopt::seen) (string-listp getopt::skipped)))) (let ((__function__ 'parse-vl-json-opts-aux)) (declare (ignorable __function__)) (b* (((when (or (atom args) (equal (car args) "--"))) (mv nil getopt::acc (revappend getopt::skipped args))) ((unless (str::strprefixp "-" (car args))) (parse-vl-json-opts-aux (cdr args) getopt::acc getopt::seen (cons (car args) getopt::skipped))) ((when (str::strprefixp "--" (car args))) (b* (((mv getopt::longname getopt::explicit-value) (getopt::split-equals (subseq (car args) 2 nil))) ((mv getopt::err getopt::acc rest) (parse-vl-json-opts-long getopt::longname getopt::explicit-value (cdr args) getopt::acc getopt::seen)) ((when getopt::err) (mv getopt::err getopt::acc rest)) (getopt::seen (cons getopt::longname getopt::seen))) (parse-vl-json-opts-aux rest getopt::acc getopt::seen getopt::skipped))) ((mv getopt::shortnames getopt::explicit-value) (getopt::split-equals (subseq (car args) 1 nil))) (getopt::aliases (explode getopt::shortnames)) ((when (atom getopt::aliases)) (parse-vl-json-opts-aux (cdr args) getopt::acc getopt::seen (cons (car args) getopt::skipped))) ((when (atom (cdr getopt::aliases))) (b* ((getopt::alias (car getopt::aliases)) ((mv getopt::err getopt::longname) (parse-vl-json-opts-short->long getopt::alias)) ((when getopt::err) (mv getopt::err getopt::acc args)) ((mv getopt::err getopt::acc rest) (parse-vl-json-opts-long getopt::longname getopt::explicit-value (cdr args) getopt::acc getopt::seen)) ((when getopt::err) (mv getopt::err getopt::acc rest)) (getopt::seen (cons getopt::longname getopt::seen))) (parse-vl-json-opts-aux rest getopt::acc getopt::seen getopt::skipped))) ((mv getopt::err getopt::longnames) (parse-vl-json-opts-short->long-list getopt::aliases)) ((when getopt::err) (mv getopt::err getopt::acc args)) ((when getopt::explicit-value) (mv (msg "Option bundle ~s0 is not allowed (bundles can't have ~ arguments)." (car args)) getopt::acc args)) (getopt::illegal-to-bundle (set-difference-equal getopt::longnames '("help" "readme" "separate" "strict" "debug"))) ((when getopt::illegal-to-bundle) (mv (msg "Option bundle ~s0 is not allowed (--~s1 needs an argument)" (car args) (car getopt::illegal-to-bundle)) getopt::acc args)) ((mv getopt::err getopt::acc getopt::seen rest) (parse-vl-json-opts-bundle getopt::longnames (cdr args) getopt::acc getopt::seen)) ((when getopt::err) (mv getopt::err getopt::acc rest))) (parse-vl-json-opts-aux rest getopt::acc getopt::seen getopt::skipped))))
Theorem:
(defthm vl-json-opts-p-of-parse-vl-json-opts-aux.result (implies (force (vl-json-opts-p getopt::acc)) (b* (((mv getopt::?errmsg getopt::?result getopt::?skipped) (parse-vl-json-opts-aux args getopt::acc getopt::seen getopt::skipped))) (vl-json-opts-p getopt::result))) :rule-classes :rewrite)
Theorem:
(defthm string-listp-of-parse-vl-json-opts-aux.skipped (implies (and (force (string-listp getopt::skipped)) (force (string-listp args))) (b* (((mv getopt::?errmsg getopt::?result getopt::?skipped) (parse-vl-json-opts-aux args getopt::acc getopt::seen getopt::skipped))) (string-listp getopt::skipped))) :rule-classes :rewrite)