• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
      • Io
      • Defttag
      • Sys-call
      • Save-exec
      • Quicklisp
      • Std/io
      • Oslib
      • Bridge
      • Clex
        • Example-lexer
        • Sin
          • Strin-p
          • Sin$c
            • Line-and-column-tracking
            • Sin$c-okp
            • Sin$c-init
            • Sin$c-nthcdr
            • Sin$c-cdr
            • Sin$c-firstn
            • Sin$c-count-charset
            • Sin$c-nth
            • Sin$c-matches-p
            • Sin$c-imatches-p
            • Sin$c-find
            • Sin$c-len
            • Sin$c-endp
            • Sin$c-car
            • Sin$corr
            • Sin$c-get-line
            • Sin$c-get-file
            • Sin$c-get-col
        • Matching-functions
        • Def-sin-progress
      • Tshell
      • Unsound-eval
      • Hacker
      • ACL2s-interface
      • Startup-banner
      • Command-line
    • Hardware-verification
    • Software-verification
    • Math
    • Testing-utilities
  • Sin

Sin$c

Concrete string input stream ACL2::stobj.

In the implementation, we take care to ensure that all indices satisfy (unsigned-byte-p 60), making them fixnums on Lisps such as CCL and SBCL. For this to work, we also use 0-based line number indices instead of 1-based line numbers, which ensures that both the line and column numbers never exceed the current position.

Function: sin-str-p

(defun sin-str-p (x)
  (declare (xargs :guard t))
  (let ((__function__ 'sin-str-p))
    (declare (ignorable __function__))
    (and (stringp x)
         (< (len (coerce x 'list))
            (expt 2 60)))))

Definition: sin$cp

(defstobj sin$c
  (sin$c-str :type (satisfies sin-str-p)
             :initially "")
  (sin$c-pos :type (unsigned-byte 60)
             :initially 0)
  (sin$c-line :type (unsigned-byte 60)
              :initially 0)
  (sin$c-col :type (unsigned-byte 60)
             :initially 0)
  (sin$c-file :type string :initially "")
  :inline t)

Subtopics

Line-and-column-tracking
Routines for tracking line and column numbers as we iterate through a string.
Sin$c-okp
Basic well-formedness of the concrete sin$c stobj.
Sin$c-init
Concrete implementation of strin-init.
Sin$c-nthcdr
Concrete implementation of strin-nthcdr.
Sin$c-cdr
Concrete implementation of strin-cdr.
Sin$c-firstn
Concrete implementation of strin-firstn.
Sin$c-count-charset
Concrete implementation of strin-count-charset.
Sin$c-nth
Concrete implementation of strin-nth.
Sin$c-matches-p
Concrete implementation of strin-matches-p.
Sin$c-imatches-p
Concrete implementation of strin-imatches-p.
Sin$c-find
Concrete implementation of strin-find.
Sin$c-len
Concrete implementation of strin-len.
Sin$c-endp
Concrete implementation of strin-endp.
Sin$c-car
Concrete implementation of strin-car.
Sin$corr
Correspondence between the concrete sin$c stobj and its abstract strin-p representation.
Sin$c-get-line
Concrete implementation of strin-get-line.
Sin$c-get-file
Concrete implementation of strin-get-file.
Sin$c-get-col
Concrete implementation of strin-get-col.