(string-sfix x) is a usual fty set fixing function.
(string-sfix x) → *
In the logic, we apply str-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.
Function:
(defun string-sfix (x) (declare (xargs :guard (string-setp x))) (mbe :logic (if (string-setp x) x nil) :exec x))
Theorem:
(defthm string-setp-of-string-sfix (string-setp (string-sfix x)))
Theorem:
(defthm string-sfix-when-string-setp (implies (string-setp x) (equal (string-sfix x) x)))
Theorem:
(defthm emptyp-string-sfix (implies (or (set::emptyp x) (not (string-setp x))) (set::emptyp (string-sfix x))))
Theorem:
(defthm emptyp-of-string-sfix (equal (set::emptyp (string-sfix x)) (or (not (string-setp x)) (set::emptyp x))))
Function:
(defun string-sequiv$inline (x y) (declare (xargs :guard (and (string-setp x) (string-setp y)))) (equal (string-sfix x) (string-sfix y)))
Theorem:
(defthm string-sequiv-is-an-equivalence (and (booleanp (string-sequiv x y)) (string-sequiv x x) (implies (string-sequiv x y) (string-sequiv y x)) (implies (and (string-sequiv x y) (string-sequiv y z)) (string-sequiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm string-sequiv-implies-equal-string-sfix-1 (implies (string-sequiv x x-equiv) (equal (string-sfix x) (string-sfix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm string-sfix-under-string-sequiv (string-sequiv (string-sfix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-string-sfix-1-forward-to-string-sequiv (implies (equal (string-sfix x) y) (string-sequiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-string-sfix-2-forward-to-string-sequiv (implies (equal x (string-sfix y)) (string-sequiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm string-sequiv-of-string-sfix-1-forward (implies (string-sequiv (string-sfix x) y) (string-sequiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm string-sequiv-of-string-sfix-2-forward (implies (string-sequiv x (string-sfix y)) (string-sequiv x y)) :rule-classes :forward-chaining)