An environment field that includes a simple model of the file system and an oracle
The environment allows reasoning about non-deterministic
events and computations in the ISA, like the
Function:
(defun rip-ret-alistp (lst) (declare (xargs :guard t)) (let ((__function__ 'rip-ret-alistp)) (declare (ignorable __function__)) (if (atom lst) (equal lst nil) (and (consp (car lst)) (i48p (caar lst)) (true-listp (cdar lst)) (rip-ret-alistp (cdr lst))))))
Theorem:
(defthm rip-ret-alistp-fwd-chaining-alistp (implies (rip-ret-alistp x) (alistp x)) :rule-classes :forward-chaining)
Function:
(defun env-alistp (env) (declare (xargs :guard t)) (let ((__function__ 'env-alistp)) (declare (ignorable __function__)) (or (equal env nil) (and (alistp env) (equal (len env) 3) (consp (assoc :file-descriptors env)) (alistp (cdr (assoc :file-descriptors env))) (consp (assoc :file-contents env)) (alistp (cdr (assoc :file-contents env))) (consp (assoc :oracle env)) (rip-ret-alistp (cdr (assoc :oracle env)))))))
Function:
(defun env-alist-fix (x) (declare (xargs :guard (env-alistp x))) (mbe :logic (if (env-alistp x) x nil) :exec x))
Theorem:
(defthm env-alistp-fwd-chaining-alistp (implies (env-alistp x) (alistp x)) :rule-classes :forward-chaining)
Theorem:
(defthm env-alistp-implies-rip-ret-alistp (implies (env-alistp x) (rip-ret-alistp (cdr (assoc-equal :oracle x)))) :rule-classes (:rewrite :forward-chaining))
Theorem:
(defthm env-alistp-implies-alistp-file-descriptors (implies (env-alistp x) (alistp (cdr (assoc-equal :file-descriptors x)))) :rule-classes (:rewrite :forward-chaining))
Theorem:
(defthm env-alistp-implies-alistp-file-contents (implies (env-alistp x) (alistp (cdr (assoc-equal :file-contents x)))) :rule-classes (:rewrite :forward-chaining))