(las-to-pas n lin-addr r-w-x x86) → (mv flg p-addrs x86)
Function:
(defun las-to-pas (n lin-addr r-w-x x86) (declare (xargs :stobjs (x86))) (declare (type (member :r :w :x) r-w-x)) (declare (xargs :guard (and (natp n) (integerp lin-addr)))) (declare (xargs :guard (not (app-view x86)))) (let ((__function__ 'las-to-pas)) (declare (ignorable __function__)) (if (zp n) (mv nil nil x86) (b* (((unless (canonical-address-p lin-addr)) (mv t nil x86)) ((mv flg p-addr x86) (ia32e-la-to-pa lin-addr r-w-x x86)) ((when flg) (mv flg nil x86)) ((mv flg p-addrs x86) (las-to-pas (1- n) (1+ lin-addr) r-w-x x86))) (mv flg (if flg nil (cons p-addr p-addrs)) x86)))))
Theorem:
(defthm true-listp-of-las-to-pas.p-addrs (b* (((mv ?flg ?p-addrs ?x86) (las-to-pas n lin-addr r-w-x x86))) (true-listp p-addrs)) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm x86p-of-las-to-pas.x86 (implies (x86p x86) (b* (((mv ?flg ?p-addrs ?x86) (las-to-pas n lin-addr r-w-x x86))) (x86p x86))) :rule-classes :rewrite)
Theorem:
(defthm consp-mv-nth-1-las-to-pas (implies (and (not (mv-nth 0 (las-to-pas n lin-addr r-w-x x86))) (not (zp n))) (consp (mv-nth 1 (las-to-pas n lin-addr r-w-x x86)))) :rule-classes (:rewrite :type-prescription))
Theorem:
(defthm car-mv-nth-1-las-to-pas (implies (and (not (mv-nth 0 (las-to-pas n lin-addr r-w-x x86))) (not (zp n))) (equal (car (mv-nth 1 (las-to-pas n lin-addr r-w-x x86))) (mv-nth 1 (ia32e-la-to-pa lin-addr r-w-x x86)))))
Theorem:
(defthm physical-address-listp-mv-nth-1-las-to-pas (physical-address-listp (mv-nth 1 (las-to-pas n lin-addr r-w-x x86))))
Theorem:
(defthm las-to-pas-n=0 (and (equal (mv-nth 0 (las-to-pas 0 lin-addr r-w-x x86)) nil) (equal (mv-nth 1 (las-to-pas 0 lin-addr r-w-x x86)) nil) (equal (mv-nth 2 (las-to-pas 0 lin-addr r-w-x x86)) x86)))
Theorem:
(defthm xr-las-to-pas (implies (and (not (equal fld :tlb)) (not (equal fld :mem)) (not (equal fld :fault))) (equal (xr fld index (mv-nth 2 (las-to-pas n lin-addr r-w-x x86))) (xr fld index x86))))
Theorem:
(defthm xr-rflags-las-to-pas (implies (not (mv-nth 0 (las-to-pas n lin-addr r-w-x (double-rewrite x86)))) (equal (xr :rflags nil (mv-nth 2 (las-to-pas n lin-addr r-w-x x86))) (xr :rflags nil (double-rewrite x86)))))
Theorem:
(defthm xr-fault-las-to-pas (implies (not (mv-nth 0 (las-to-pas n lin-addr r-w-x (double-rewrite x86)))) (equal (xr :fault nil (mv-nth 2 (las-to-pas n lin-addr r-w-x x86))) (xr :fault nil (double-rewrite x86)))))
Theorem:
(defthm las-to-pas-xw-values (implies (and (not (equal fld :mem)) (not (equal fld :rflags)) (not (equal fld :fault)) (not (equal fld :ctr)) (not (equal fld :msr)) (not (equal fld :app-view)) (not (equal fld :marking-view)) (not (equal fld :seg-visible)) (not (equal fld :tlb)) (not (equal fld :implicit-supervisor-access))) (and (equal (mv-nth 0 (las-to-pas n lin-addr r-w-x (xw fld index val x86))) (mv-nth 0 (las-to-pas n lin-addr r-w-x x86))) (equal (mv-nth 1 (las-to-pas n lin-addr r-w-x (xw fld index val x86))) (mv-nth 1 (las-to-pas n lin-addr r-w-x x86))))))
Theorem:
(defthm 64-bit-modep-of-las-to-pas (equal (64-bit-modep (mv-nth 2 (las-to-pas n lin-addr r-w-x x86))) (64-bit-modep x86)))
Theorem:
(defthm x86-operation-mode-of-las-to-pas (equal (x86-operation-mode (mv-nth 2 (las-to-pas n lin-addr r-w-x x86))) (x86-operation-mode x86)))
Theorem:
(defthm las-to-pas-xw-state (implies (and (not (equal fld :mem)) (not (equal fld :rflags)) (not (equal fld :fault)) (not (equal fld :ctr)) (not (equal fld :msr)) (not (equal fld :app-view)) (not (equal fld :marking-view)) (not (equal fld :seg-visible)) (not (equal fld :tlb)) (not (equal fld :implicit-supervisor-access))) (equal (mv-nth 2 (las-to-pas n lin-addr r-w-x (xw fld index val x86))) (xw fld index val (mv-nth 2 (las-to-pas n lin-addr r-w-x x86))))))
Theorem:
(defthm las-to-pas-xw-rflags-not-ac (implies (equal (rflagsbits->ac value) (rflagsbits->ac (rflags (double-rewrite x86)))) (and (equal (mv-nth 0 (las-to-pas n lin-addr r-w-x (xw :rflags nil value x86))) (mv-nth 0 (las-to-pas n lin-addr r-w-x (double-rewrite x86)))) (equal (mv-nth 1 (las-to-pas n lin-addr r-w-x (xw :rflags nil value x86))) (mv-nth 1 (las-to-pas n lin-addr r-w-x (double-rewrite x86)))))))
Theorem:
(defthm las-to-pas-xw-rflags-state-not-ac (implies (equal (rflagsbits->ac value) (rflagsbits->ac (rflags x86))) (equal (mv-nth 2 (las-to-pas n lin-addr r-w-x (xw :rflags nil value x86))) (xw :rflags nil value (mv-nth 2 (las-to-pas n lin-addr r-w-x x86))))))
Theorem:
(defthm len-of-mv-nth-1-las-to-pas (implies (not (mv-nth 0 (las-to-pas n lin-addr r-w-x x86))) (equal (len (mv-nth 1 (las-to-pas n lin-addr r-w-x x86))) (nfix n))))