High-level accessor: get the location from an vl-echar-p.
(vl-echar->loc x) → loc
Note that this has to construct a vl-location-p object.
Function:
(defun vl-echar->loc (x) (declare (xargs :guard (vl-echar-p x))) (let ((__function__ 'vl-echar->loc)) (declare (ignorable __function__)) (b* (((vl-echar-raw x) x)) (mbe :logic (make-vl-location :filename x.filename :line (vl-echarpack->line x.pack) :col (vl-echarpack->col x.pack)) :exec (cons (vl-echarpack->linecol x.pack) (hons :vl-location x.filename))))))
Theorem:
(defthm vl-location-p-of-vl-echar->loc (b* ((loc (vl-echar->loc x))) (vl-location-p loc)) :rule-classes :rewrite)
Theorem:
(defthm vl-echar->loc-of-vl-echar-fix-x (equal (vl-echar->loc (vl-echar-fix x)) (vl-echar->loc x)))
Theorem:
(defthm vl-echar->loc-vl-echar-raw-equiv-congruence-on-x (implies (vl-echar-raw-equiv x x-equiv) (equal (vl-echar->loc x) (vl-echar->loc x-equiv))) :rule-classes :congruence)
Theorem:
(defthm vl-echar->loc-of-vl-echar (equal (vl-echar->loc (vl-echar char loc)) (vl-location-fix loc)))