Parse a string into s-expressions, by using Common Lisp's
(read-string str pkg &key (state 'state)) → (mv errmsg objects state)
In the logic we just read the oracle to decide if parsing will
succeed or fail. So you can never prove any relationship between the input
In the execution, we turn the string into a Common Lisp input stream and try
to parse it using
Jared thinks this may be sound. (Matt K. has since added the
Function:
(defun read-string-fn (str pkg state) (declare (xargs :stobjs (state))) (declare (xargs :guard (and (stringp str) (or (null pkg) (stringp pkg))))) (declare (ignore pkg)) (declare (ignorable str)) (let ((__function__ 'read-string)) (declare (ignorable __function__)) (b* ((- (raise "Raw lisp definition not installed?")) ((mv err1 errmsg? state) (read-acl2-oracle state)) ((mv err2 objects state) (read-acl2-oracle state)) ((when (or err1 err2)) (mv (msg "Reading oracle failed.") nil state)) ((when errmsg?) (mv errmsg? nil state))) (mv nil objects state))))
Theorem:
(defthm state-p1-of-read-string.state (implies (state-p1 state) (b* (((mv ?errmsg ?objects ?state) (read-string-fn str pkg state))) (state-p1 state))) :rule-classes :rewrite)