Getopt option parser for Verilog editions.
(vl-parse-edition name explicit-value args) → (mv err value rest-args)
Function:
(defun vl-parse-edition (name explicit-value args) (declare (xargs :guard (and (stringp name) (or (not explicit-value) (stringp explicit-value)) (string-listp args)))) (let ((__function__ 'vl-parse-edition)) (declare (ignorable __function__)) (b* (((mv err val args) (getopt::parse-string name explicit-value args)) ((when err) (mv err :system-verilog-2012 args)) ((when (str::istreqv val "Verilog")) (mv nil :verilog-2005 args)) ((when (str::istreqv val "SystemVerilog")) (mv nil :system-verilog-2012 args))) (mv (msg "Option ~s0 must be 'Verilog' or 'SystemVerilog', but got ~x1" name val) :system-verilog-2012 args))))
Theorem:
(defthm vl-edition-p-of-vl-parse-edition.value (b* (((mv ?err acl2::?value ?rest-args) (vl-parse-edition name explicit-value args))) (vl-edition-p value)) :rule-classes :rewrite)
Theorem:
(defthm string-listp-of-vl-parse-edition.rest-args (implies (force (string-listp args)) (b* (((mv ?err acl2::?value ?rest-args) (vl-parse-edition name explicit-value args))) (string-listp rest-args))) :rule-classes :rewrite)
Theorem:
(defthm vl-parse-edition-makes-progress (<= (len (mv-nth 2 (vl-parse-edition getopt::name getopt::explicit-value args))) (len args)) :rule-classes ((:rewrite) (:linear)))