Represent a position as a message.
This is used in user-oriented error messages.
Function:
(defun position-to-msg (pos) (declare (xargs :guard (positionp pos))) (msg "(line ~x0, column ~x1)" (position->line pos) (position->column pos)))
Theorem:
(defthm msgp-of-position-to-msg (b* ((msg (position-to-msg pos))) (msgp msg)) :rule-classes :rewrite)
Theorem:
(defthm position-to-msg-of-position-fix-pos (equal (position-to-msg (position-fix pos)) (position-to-msg pos)))
Theorem:
(defthm position-to-msg-position-equiv-congruence-on-pos (implies (position-equiv pos pos-equiv) (equal (position-to-msg pos) (position-to-msg pos-equiv))) :rule-classes :congruence)