Fixing function for fsm structures.
Function:
(defun fsm-fix$inline (x) (declare (xargs :guard (fsm-p x))) (let ((__function__ 'fsm-fix)) (declare (ignorable __function__)) (mbe :logic (b* ((values (svex-alist-fix (cdr (std::da-nth 0 x)))) (nextstate (svex-alist-fix (cdr (std::da-nth 1 x))))) (list (cons 'values values) (cons 'nextstate nextstate))) :exec x)))
Theorem:
(defthm fsm-p-of-fsm-fix (b* ((new-x (fsm-fix$inline x))) (fsm-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm fsm-fix-when-fsm-p (implies (fsm-p x) (equal (fsm-fix x) x)))
Function:
(defun fsm-equiv$inline (x y) (declare (xargs :guard (and (fsm-p x) (fsm-p y)))) (equal (fsm-fix x) (fsm-fix y)))
Theorem:
(defthm fsm-equiv-is-an-equivalence (and (booleanp (fsm-equiv x y)) (fsm-equiv x x) (implies (fsm-equiv x y) (fsm-equiv y x)) (implies (and (fsm-equiv x y) (fsm-equiv y z)) (fsm-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm fsm-equiv-implies-equal-fsm-fix-1 (implies (fsm-equiv x x-equiv) (equal (fsm-fix x) (fsm-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm fsm-fix-under-fsm-equiv (fsm-equiv (fsm-fix x) x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-fsm-fix-1-forward-to-fsm-equiv (implies (equal (fsm-fix x) y) (fsm-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-fsm-fix-2-forward-to-fsm-equiv (implies (equal x (fsm-fix y)) (fsm-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm fsm-equiv-of-fsm-fix-1-forward (implies (fsm-equiv (fsm-fix x) y) (fsm-equiv x y)) :rule-classes :forward-chaining)
Theorem:
(defthm fsm-equiv-of-fsm-fix-2-forward (implies (fsm-equiv x (fsm-fix y)) (fsm-equiv x y)) :rule-classes :forward-chaining)