Filtering...

getpid-logic

books/oslib/getpid-logic
other
(in-package "OSLIB")
other
(include-book "read-acl2-oracle")
other
(include-book "std/util/define" :dir :system)
other
(local (set-default-parents oslib))
other
(local (in-theory (disable w)))
other
(define getpid
  (&optional (state 'state))
  :returns (mv (pid "The Process ID for this ACL2 session on success, or
                     @('nil') on failure."
      (or (natp pid) (not pid))
      :rule-classes :type-prescription)
    (new-state state-p1
      :hyp (force (state-p1 state))))
  :short "Get the current process identification (PID) number."
  :long "<p>This will just fail if called on an unsupported Lisp.</p>"
  (b* ((- (raise "Raw Lisp definition not installed?")) ((mv err val state) (read-acl2-oracle state))
      ((when err) (mv nil state)))
    (mv (nfix val) state))
  ///
  (defret w-state-of-<fn>
    (equal (w new-state) (w state))))