• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
    • Debugging
    • Projects
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
      • Io
      • Defttag
      • Sys-call
      • Save-exec
      • Quicklisp
      • Oslib
      • Std/io
      • Bridge
      • Clex
        • Example-lexer
        • Sin
        • Matching-functions
          • Sin-match-until-lit
          • Sin-match-lit
          • Sin-match-charset*
          • Sin-match-some-lit
          • Sin-match-through-lit
          • Sin-match-everything
            • Def-match-thms
          • Def-sin-progress
        • Tshell
        • Unsound-eval
        • Hacker
        • Startup-banner
        • Command-line
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Matching-functions

    Sin-match-everything

    Match everything that remains, no matter what it is.

    Signature
    (sin-match-everything sin) → (mv match sin)
    Arguments
    sin — The sin stobj.
    Returns
    match — The entire remaining contents of the input stream, as a string, or nil if we're already at the end of the input stream.
        Type (or (stringp match) (not match)).
    sin — The remainder of the input stream, which will now be empty. (The only reason you might care about it is to get the final line/column numbers.).

    Examples:

    (sin-match-everything [apple])
       -->
    ("apple" [])
    
    (sin-match-everything [])
      -->
    (nil [])

    Definitions and Theorems

    Function: sin-match-everything

    (defun sin-match-everything (sin)
           (declare (xargs :stobjs (sin)))
           (declare (xargs :guard t))
           (let ((__function__ 'sin-match-everything))
                (declare (ignorable __function__))
                (b* ((len (sin-len sin))
                     ((when (zp len)) (mv nil sin))
                     (match (sin-firstn len sin))
                     (sin (sin-nthcdr len sin)))
                    (mv match sin))))

    Theorem: return-type-of-sin-match-everything.match

    (defthm return-type-of-sin-match-everything.match
            (b* (((mv ?match ?sin)
                  (sin-match-everything sin)))
                (or (stringp match) (not match)))
            :rule-classes :type-prescription)

    Theorem: str-match-everything.match-under-iff

    (defthm str-match-everything.match-under-iff
            (b* (((mv ?match ?new-sin)
                  (sin-match-everything sin)))
                (iff match (consp (strin-left sin)))))

    Theorem: stringp-of-sin-match-everything.match

    (defthm stringp-of-sin-match-everything.match
            (b* (((mv ?match ?new-sin)
                  (sin-match-everything sin)))
                (equal (stringp match)
                       (consp (strin-left sin)))))

    Theorem: non-empty-of-sin-match-everything.match

    (defthm non-empty-of-sin-match-everything.match
            (b* (((mv ?match ?new-sin)
                  (sin-match-everything sin)))
                (iff (consp (explode match))
                     (consp (strin-left sin)))))

    Theorem: sin-match-everything-progress

    (defthm sin-match-everything-progress
            (b* (((mv ?match new-sin)
                  (sin-match-everything sin)))
                (equal (len (strin-left new-sin)) 0)))

    Theorem: sin-match-everything-reconstruction

    (defthm sin-match-everything-reconstruction
            (b* (((mv match new-sin)
                  (sin-match-everything sin)))
                (equal (append (explode match)
                               (strin-left new-sin))
                       (strin-left sin))))