State stobj.
This could be probably automatically generated from the fty::defprod that defines stat.
The unconstrained
We rename and disable the generated stobj functions.
We introduce a non-executable function to retrieve the whole memory array. This cannot be executable, because it violates stobj usage rules; however, it makes logical sense.
We introduce a function to build a stobj value from the values of its fields. While this makes logical sense, the values it returns are unrelated to the live stobj.
We also introduce some equivalences between recognizers of stobj fields and recognizers of stat field types.
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Definition:
(defstobj stat1 (xregs) (pc) (memory :type (array (unsigned-byte 8) (0)) :initially 0 :resizable t) (error :type (satisfies booleanp)) :renaming ((xregsp stat1-xregs-p) (acl2::pcp stat1-pc-p) (memoryp stat1-memory-p) (errorp stat1-error-p) (xregs stat1->xregs) (pc stat1->pc) (memory-length stat1->memory-size) (memoryi stat1->memory-byte) (error stat1->error) (update-xregs update-stat1->xregs) (acl2::update-pc update-stat1->pc) (resize-memory update-stat1->memory-size) (update-memoryi update-stat1->memory-byte) (update-error update-stat1->error)))
Function:
(defun stat1->memory (stat1) (declare (xargs :stobjs (stat1))) (declare (xargs :guard (stat1p stat1))) (declare (xargs :non-executable t)) (prog2$ (acl2::throw-nonexec-error 'stat1->memory (list stat1)) (let ((__function__ 'stat1->memory)) (declare (ignorable __function__)) (nth 2 stat1))))
Theorem:
(defthm stat1-memory-p-of-stat1->memory (implies (stat1p stat1) (b* ((memory (stat1->memory stat1))) (stat1-memory-p memory))) :rule-classes :rewrite)
Function:
(defun make-stat1 (xregs pc memory error) (declare (xargs :guard (and (stat1-xregs-p xregs) (stat1-pc-p pc) (stat1-memory-p memory) (stat1-error-p error)))) (let ((__function__ 'make-stat1)) (declare (ignorable __function__)) (list xregs pc memory error)))
Theorem:
(defthm stat1p-of-make-stat1 (implies (and (stat1-xregs-p xregs) (stat1-pc-p pc) (stat1-memory-p memory) (stat1-error-p error)) (b* ((stat1 (make-stat1 xregs pc memory error))) (stat1p stat1))) :rule-classes :rewrite)
Theorem:
(defthm stat1-memory-p-to-ubyte8-listp (equal (stat1-memory-p x) (ubyte8-listp x)))
Theorem:
(defthm ubyte8-listp-to-stat1-memory-p (equal (ubyte8-listp x) (stat1-memory-p x)))
Theorem:
(defthm stat1-error-p-to-booleanp (equal (stat1-error-p x) (booleanp x)))
Theorem:
(defthm booleanp-to-stat1-error-p (equal (booleanp x) (stat1-error-p x)))