• 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
              • 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
              • 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-cdr

      Concrete implementation of strin-cdr.

      Signature
      (sin$c-cdr sin$c) → sin$c
      Arguments
      sin$c — Guard (sin$c-okp sin$c).

      This is not very efficient. It's better to use sin$c-nthcdr than to use this in a loop.

      Definitions and Theorems

      Function: sin$c-cdr

      (defun sin$c-cdr (sin$c)
        (declare (xargs :stobjs (sin$c)))
        (declare (xargs :guard (sin$c-okp sin$c)))
        (let ((__function__ 'sin$c-cdr))
          (declare (ignorable __function__))
          (b* (((the string str) (sin$c-str sin$c))
               ((the (unsigned-byte 60) pos)
                (sin$c-pos sin$c))
               ((the (unsigned-byte 60) len)
                (length str))
               ((when (eql pos len)) sin$c)
               ((the character char1) (char str pos))
               ((the (unsigned-byte 60) pos)
                (+ 1 pos)))
            (if (eql char1 #\Newline)
                (b* (((the (unsigned-byte 60) line)
                      (sin$c-line sin$c))
                     ((the (unsigned-byte 60) line)
                      (+ 1 line))
                     (sin$c (update-sin$c-col 0 sin$c))
                     (sin$c (update-sin$c-line line sin$c)))
                  (update-sin$c-pos pos sin$c))
              (b* (((the (unsigned-byte 60) col)
                    (sin$c-col sin$c))
                   ((the (unsigned-byte 60) col) (+ 1 col))
                   (sin$c (update-sin$c-col col sin$c)))
                (update-sin$c-pos pos sin$c))))))

      Theorem: sin-cdr{correspondence}

      (defthm sin-cdr{correspondence}
        (implies (and (sin$corr sin$c sin) (strin-p sin))
                 (sin$corr (sin$c-cdr sin$c)
                           (strin-cdr sin))))