• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
      • Theories
      • Rule-classes
      • Proof-builder
      • Recursion-and-induction
      • Hons-and-memoization
      • Events
      • Parallelism
      • History
      • Programming
      • Operational-semantics
      • Real
      • Start-here
      • Debugging
      • Miscellaneous
      • Output-controls
      • Macros
      • 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
                • Strin-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
    • 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
              • Strin-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$c

Sin$c-init

Concrete implementation of strin-init.

Signature
(sin$c-init contents filename sin$c) → sin$c
Arguments
contents — Guard (stringp contents).
filename — Guard (stringp filename).

Definitions and Theorems

Function: sin$c-init

(defun sin$c-init (contents filename sin$c)
  (declare (xargs :stobjs (sin$c)))
  (declare (xargs :guard (and (stringp contents)
                              (stringp filename))))
  (let ((__function__ 'sin$c-init))
    (declare (ignorable __function__))
    (b* ((sin$c (update-sin$c-pos 0 sin$c))
         (sin$c (update-sin$c-line 0 sin$c))
         (sin$c (update-sin$c-col 0 sin$c))
         (sin$c (update-sin$c-file filename sin$c)))
      (mbe :logic (update-sin$c-str contents sin$c)
           :exec
           (if (< (the (integer 0 *) (length contents))
                  (expt 2 60))
               (update-sin$c-str contents sin$c)
             (ec-call (update-sin$c-str contents sin$c)))))))

Theorem: sin-init{correspondence}

(defthm sin-init{correspondence}
  (implies (and (sin$corr sin$c x)
                (stringp contents)
                (stringp filename)
                (strin-p x))
           (sin$corr (sin$c-init contents filename sin$c)
                     (strin-init contents filename x))))

Subtopics

Strin-init
Reset a strin-p to contain a new string from a new file.