Parser for plain, argument-free options that are off by default and
must be explicitly enabled, e.g.,
(parse-plain name explicit-value args) → (mv err value rest-args)
We just return true, because by typing the name of the option the user is saying they want to turn it on. This is useful for options that the user has to explicitly ask for because they are unsafe or just unusual.
Function:
(defun parse-plain (name explicit-value args) (declare (xargs :guard (and (stringp name) (or (not explicit-value) (stringp explicit-value)) (string-listp args)))) (let ((__function__ 'parse-plain)) (declare (ignorable __function__)) (if explicit-value (mv (msg "Option ~s0 can't take an argument" name) nil args) (mv nil t args))))
Theorem:
(defthm booleanp-of-parse-plain.value (b* (((mv ?err acl2::?value ?rest-args) (parse-plain name explicit-value args))) (booleanp value)) :rule-classes :type-prescription)
Theorem:
(defthm string-listp-of-parse-plain.rest-args (implies (force (string-listp args)) (b* (((mv ?err acl2::?value ?rest-args) (parse-plain name explicit-value args))) (string-listp rest-args))) :rule-classes :rewrite)
Theorem:
(defthm parse-plain-makes-progress (<= (len (mv-nth 2 (parse-plain name explicit-value args))) (len args)) :rule-classes ((:rewrite) (:linear)))