A somewhat robust evaluator.
(unsound-eval sexpr &key (state 'state)) → (mv errmsg values state)
In the logic, this is implemented as oracle reads, so you can't
prove anything about what it returns. Even so, it is generally unsound
since it lets you to modify
In the execution, we basically call ACL2's trans-eval function
(technically:
Function:
(defun unsound-eval-fn (sexpr state) (declare (xargs :stobjs (state))) (declare (ignorable sexpr)) (declare (xargs :guard t)) (let ((__function__ 'unsound-eval)) (declare (ignorable __function__)) (b* ((- (raise "Raw lisp definition not installed?")) ((mv err1 errmsg? state) (read-acl2-oracle state)) ((mv err2 values state) (read-acl2-oracle state)) ((when (or err1 err2)) (mv (msg "Reading oracle failed.") nil state)) ((when errmsg?) (mv errmsg? nil state))) (mv nil values state))))
Theorem:
(defthm state-p1-of-unsound-eval.state (implies (state-p1 state) (b* (((mv ?errmsg common-lisp::?values ?state) (unsound-eval-fn sexpr state))) (state-p1 state))) :rule-classes :rewrite)