Error messages about “live” stobjs during proofs
It is possible to see an error like the following. (This error is probably very rare, and perhaps can only occur during a proof.)
*********************************************** ************ ABORTING from raw Lisp *********** ********** (see :DOC raw-lisp-error) ********** Error: A live stobj (for stobj ST) was unexpectedly encountered when evaluating a call of the function, ST-INIT. See :DOC live-stobj-in-proof. ***********************************************
The solution is generally to disable the executable-counterpart of the offending function, as suggested by the example below (essentially provided by Sol Swords). As of this writing (in July, 2025), the only way to get an unexpected “live” stobj is by the use of swap-stobjs, as illustrated below.
First introduce a pair of congruent stobjs.
(defstobj st (fld)) (defstobj st1 (fld1) :congruent-to st)
Now define a function that “initializes” the stobj
(defun st-init (st) (declare (xargs :stobjs (st))) (with-local-stobj st1 (mv-let (st1 st) (swap-stobjs st1 st) st)))
The following proof attempt causes the error message displayed above.
(thm (not (equal (st-init '(1)) '(nil))))
In fact, that formula is not a theorem! Through Version 8.6, ACL2
mistakenly proved this theorem by evaluating the indicated call of
The error is avoided if we disable the executable-counterpart
of the offending function mentioned in the error message,
(thm (equal (st-init '(1)) '(nil)) :hints(("Goal" :in-theory (disable (:e st-init)))))