Figure out what directory to use for temporary files.
We think it's conventional for Linux programs to look at the value
of the
Function:
(defun default-tempdir (state) (declare (xargs :stobjs (state))) (declare (xargs :guard t)) (let ((__function__ 'default-tempdir)) (declare (ignorable __function__)) (b* (((mv ?err tempdir state) (getenv$ "TMPDIR" state)) ((mv ?err temp state) (getenv$ "TEMP" state)) (tmpdir (or (and (stringp tempdir) tempdir) (and (stringp temp) (pathname-to-unix temp)) "/tmp"))) (mv tmpdir state))))
Theorem:
(defthm stringp-of-default-tempdir.tempdir (b* (((mv ?tempdir ?new-state) (default-tempdir state))) (stringp tempdir)) :rule-classes :type-prescription)
Theorem:
(defthm state-p1-of-default-tempdir.new-state (implies (force (state-p1 state)) (b* (((mv ?tempdir ?new-state) (default-tempdir state))) (state-p1 new-state))) :rule-classes :rewrite)
Theorem:
(defthm w-state-of-default-tempdir (b* (((mv ?tempdir ?new-state) (default-tempdir state))) (equal (w new-state) (w state))))