• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
          • Svtv-data
          • Defsvtv$
          • Svtv-run
          • Defsvtv-phasewise
          • Svtv
          • Svtv-spec
          • Defsvtv
          • Process.lisp
          • Svtv-doc
            • Svtv-to-xml
            • Stv-entry-to-xml
            • Stv-line-to-xml
            • Stv-entries-to-xml
            • Stv-lines-to-xml
            • 4vec-to-bitwise-chars
            • Stv-repeat-last-entry
            • Stv-repeat-last-entries
            • 4vec-to-hex-chars
            • 4vec-to-hex-char
            • Stv-name-to-xml
            • Stv-labels-to-xml
            • 4vec-to-xml-chars
            • Svtv-chase$
            • Svtv-versus-stv
            • Svtv-debug-fsm
            • Structure.lisp
            • Svtv-debug
            • Def-pipeline-thm
            • Expand.lisp
            • Def-cycle-thm
            • Svtv-utilities
            • Svtv-debug$
            • Defsvtv$-phasewise
          • Svex-decomposition-methodology
          • Sv-versus-esim
          • Svex-decomp
          • Svex-compose-dfs
          • Svex-compilation
          • Moddb
          • Svmods
          • Svstmt
          • Sv-tutorial
          • Expressions
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Svtv-doc

    4vec-to-xml-chars

    Signature
    (4vec-to-xml-chars x) → chars
    Arguments
    x — Guard (4vec-p x).
    Returns
    chars — Type (character-listp chars).

    Definitions and Theorems

    Function: 4vec-to-xml-chars

    (defun 4vec-to-xml-chars (x)
      (declare (xargs :guard (4vec-p x)))
      (let ((__function__ '4vec-to-xml-chars))
        (declare (ignorable __function__))
        (if (2vec-p x)
            (b* ((val (2vec->val x))
                 (val (loghead (integer-length val) val)))
              (if (< val 10)
                  (str::nat-to-dec-chars val)
                (list* #\0 #\x (str::nat-to-hex-chars val))))
          (b* (((4vec x) x)
               (len (max (integer-length x.upper)
                         (integer-length x.lower)))
               ((when (and (<= len 6)
                           (<= (integer-length x.lower) 6)))
                (list* #\0 #\b
                       (4vec-to-bitwise-chars x.upper x.lower len))))
            (list* #\0 #\x
                   (4vec-to-hex-chars x.upper x.lower len))))))

    Theorem: character-listp-of-4vec-to-xml-chars

    (defthm character-listp-of-4vec-to-xml-chars
      (b* ((chars (4vec-to-xml-chars x)))
        (character-listp chars))
      :rule-classes :rewrite)