Transform an ordinary
This is like vl-echarlist-from-chars, but we process an ACL2 string instead of a character list.
We go to some lengths to be able to more efficiently construct an echarlist from a string. The simplest approach to this would be:
The above is our logical definition, and hence we leave this function enabled and reason about vl-echarlist-from-chars instead. But for better efficiency, we avoid the coerce and process the string directly.
Function:
(defun vl-echarlist-from-str-fn (x filename line col) (declare (xargs :guard (and (stringp x) (stringp filename) (posp line) (natp col)))) (let ((__function__ 'vl-echarlist-from-str)) (declare (ignorable __function__)) (mbe :logic (vl-echarlist-from-chars-fn (explode x) filename line col) :exec (vl-echarlist-from-str-nice x 0 (length (the string x)) filename line col))))
Theorem:
(defthm vl-echarlist-from-str-fn-of-str-fix-x (equal (vl-echarlist-from-str-fn (str-fix x) filename line col) (vl-echarlist-from-str-fn x filename line col)))
Theorem:
(defthm vl-echarlist-from-str-fn-streqv-congruence-on-x (implies (streqv x x-equiv) (equal (vl-echarlist-from-str-fn x filename line col) (vl-echarlist-from-str-fn x-equiv filename line col))) :rule-classes :congruence)
Theorem:
(defthm vl-echarlist-from-str-fn-of-str-fix-filename (equal (vl-echarlist-from-str-fn x (str-fix filename) line col) (vl-echarlist-from-str-fn x filename line col)))
Theorem:
(defthm vl-echarlist-from-str-fn-streqv-congruence-on-filename (implies (streqv filename filename-equiv) (equal (vl-echarlist-from-str-fn x filename line col) (vl-echarlist-from-str-fn x filename-equiv line col))) :rule-classes :congruence)
Theorem:
(defthm vl-echarlist-from-str-fn-of-pos-fix-line (equal (vl-echarlist-from-str-fn x filename (pos-fix line) col) (vl-echarlist-from-str-fn x filename line col)))
Theorem:
(defthm vl-echarlist-from-str-fn-pos-equiv-congruence-on-line (implies (acl2::pos-equiv line line-equiv) (equal (vl-echarlist-from-str-fn x filename line col) (vl-echarlist-from-str-fn x filename line-equiv col))) :rule-classes :congruence)
Theorem:
(defthm vl-echarlist-from-str-fn-of-nfix-col (equal (vl-echarlist-from-str-fn x filename line (nfix col)) (vl-echarlist-from-str-fn x filename line col)))
Theorem:
(defthm vl-echarlist-from-str-fn-nat-equiv-congruence-on-col (implies (acl2::nat-equiv col col-equiv) (equal (vl-echarlist-from-str-fn x filename line col) (vl-echarlist-from-str-fn x filename line col-equiv))) :rule-classes :congruence)