(satlink-handle-line line pstate env$) → (mv error-p new-pstate env$)
Function:
(defun satlink-handle-line (line pstate env$) (declare (xargs :stobjs (env$))) (declare (xargs :guard (and (stringp line) (satlink-parser-state-p pstate)))) (let ((__function__ 'satlink-handle-line)) (declare (ignorable __function__)) (b* ((len (length line)) ((when (< len 2)) (mv nil (satlink-parser-state-fix pstate) env$)) (char (char line 0)) ((unless (and (or (eql char #\s) (eql char #\v)) (eql (char line 1) #\Space))) (mv nil (satlink-parser-state-fix pstate) env$)) ((when (eql char #\s)) (cond ((str::strprefixp "s SATISFIABLE" line) (mv nil (change-satlink-parser-state pstate :saw-sat-p t) env$)) ((str::strprefixp "s UNSATISFIABLE" line) (mv nil (change-satlink-parser-state pstate :saw-unsat-p t) env$)) ((str::strprefixp "s UNKNOWN" line) (mv nil (change-satlink-parser-state pstate :saw-unknown-p t) env$)) (t (prog2$ (cw "SATLINK: Unrecognized result line: ~s0~%" line) (mv nil (satlink-parser-state-fix pstate) env$))))) ((when (satlink-parser-state->saw-zero-p pstate)) (cw "SATLINK: Variable lines after already saw zero: ~s0~%" line) (mv t (satlink-parser-state-fix pstate) env$)) ((mv error saw-zero-p env$) (satlink-parse-variable-line line 1 len nil env$))) (mv error (change-satlink-parser-state pstate :saw-zero-p (and saw-zero-p t)) env$))))
Theorem:
(defthm satlink-parser-state-p-of-satlink-handle-line.new-pstate (b* (((mv ?error-p ?new-pstate ?env$) (satlink-handle-line line pstate env$))) (satlink-parser-state-p new-pstate)) :rule-classes :rewrite)