Retrieve the matrix of a function introduced via defun-sk, in untranslated form.
(defun-sk-matrix fn wrld) → matrix
If
((lambda (bvar) matrix) (witness arg1 ... argN))
if there is just one bound variable
((lambda (mv argN ... arg1) ((lambda (bvar1 ... bvarM argN ... arg1) matrix) (mv-nth '0 mv) ... (mv-nth 'M-1 mv) argN ... arg1)) (witness arg1 ... argN) arg1 ... argN)
if there are
If instead
Note that here we consider a function to be defined if it has an unnormalized body (via ubody). Certain program-mode functions may be defined without having an unnormalized body; however, defun-sk functions should always be in logic mode.
Use defun-sk-imatrix to retrieve the matrix in untranslated form.
Function:
(defun defun-sk-matrix (fn wrld) (declare (xargs :guard (and (plist-worldp wrld) (defun-sk-namep fn wrld)))) (let ((__function__ 'defun-sk-matrix)) (declare (ignorable __function__)) (b* ((core (if (ubody fn wrld) (b* ((body (ubody fn wrld))) (if (non-executablep fn wrld) (car (last body)) body)) (b* ((def-thm (defun-sk-definition-name fn wrld))) (third (thm-formula def-thm wrld)))))) (if (= 1 (len (defun-sk-bound-vars fn wrld))) (case-match core (((& & matrix) . &) matrix) (& (raise "Internal error: ~ the translated definiens ~x0 ~ of the DEFUN-SK function ~x1 ~ is malformed." core fn))) (case-match core (((& & ((& & matrix) . &)) . &) matrix) (& (raise "Internal error: ~ the translated definiens ~x0 ~ of the DEFUN-SK function ~x1 ~ is malformed." core fn)))))))