Fixing function for func structures.
Function:
(defun func-fix$inline (x) (declare (xargs :guard (func-p x))) (let ((acl2::__function__ 'func-fix)) (declare (ignorable acl2::__function__)) (mbe :logic (b* ((name (symbol-fix (cdr (std::da-nth 0 x)))) (formals (decl-list-fix (cdr (std::da-nth 1 x)))) (guard (hint-pair-fix (cdr (std::da-nth 2 x)))) (returns (decl-list-fix (cdr (std::da-nth 3 x)))) (more-returns (hint-pair-list-fix (cdr (std::da-nth 4 x)))) (expansion-depth (nfix (cdr (std::da-nth 5 x)))) (flattened-formals (symbol-list-fix (cdr (std::da-nth 6 x)))) (flattened-returns (symbol-list-fix (cdr (std::da-nth 7 x))))) (list (cons 'name name) (cons 'formals formals) (cons 'guard guard) (cons 'returns returns) (cons 'more-returns more-returns) (cons 'expansion-depth expansion-depth) (cons 'flattened-formals flattened-formals) (cons 'flattened-returns flattened-returns))) :exec x)))
Theorem:
(defthm func-p-of-func-fix (b* ((new-x (func-fix$inline x))) (func-p new-x)) :rule-classes :rewrite)
Theorem:
(defthm func-fix-when-func-p (implies (func-p x) (equal (func-fix x) x)))
Function:
(defun func-equiv$inline (acl2::x acl2::y) (declare (xargs :guard (and (func-p acl2::x) (func-p acl2::y)))) (equal (func-fix acl2::x) (func-fix acl2::y)))
Theorem:
(defthm func-equiv-is-an-equivalence (and (booleanp (func-equiv x y)) (func-equiv x x) (implies (func-equiv x y) (func-equiv y x)) (implies (and (func-equiv x y) (func-equiv y z)) (func-equiv x z))) :rule-classes (:equivalence))
Theorem:
(defthm func-equiv-implies-equal-func-fix-1 (implies (func-equiv acl2::x x-equiv) (equal (func-fix acl2::x) (func-fix x-equiv))) :rule-classes (:congruence))
Theorem:
(defthm func-fix-under-func-equiv (func-equiv (func-fix acl2::x) acl2::x) :rule-classes (:rewrite :rewrite-quoted-constant))
Theorem:
(defthm equal-of-func-fix-1-forward-to-func-equiv (implies (equal (func-fix acl2::x) acl2::y) (func-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm equal-of-func-fix-2-forward-to-func-equiv (implies (equal acl2::x (func-fix acl2::y)) (func-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm func-equiv-of-func-fix-1-forward (implies (func-equiv (func-fix acl2::x) acl2::y) (func-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)
Theorem:
(defthm func-equiv-of-func-fix-2-forward (implies (func-equiv acl2::x (func-fix acl2::y)) (func-equiv acl2::x acl2::y)) :rule-classes :forward-chaining)