• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
          • Name-database
          • Vl-gc
          • Make-lookup-alist
          • Symbol-list-names
          • Html-encoding
            • Vl-html-encode-chars-aux
            • Vl-html-encode-push
              • Vl-html-encode-next-col
              • Vl-html-encode-string
              • Vl-distance-to-tab
              • Vl-html-encode-string-aux
              • Repeated-revappend
              • *vl-html-newline*
              • *vl-html-&quot*
              • *vl-html-&nbsp*
              • *vl-html-&lt*
              • *vl-html-&gt*
              • *vl-html-&amp*
            • Nats-from
            • Redundant-mergesort
            • Longest-common-prefix
            • Vl-edition-p
            • Nat-listp
            • Vl-plural-p
            • Vl-remove-keys
            • Sum-nats
            • Vl-maybe-nat-listp
            • Url-encoding
            • Fast-memberp
            • Vl-string-keys-p
            • Max-nats
            • Longest-common-prefix-list
            • Character-list-listp
            • Vl-string-list-values-p
            • Vl-character-list-list-values-p
            • Remove-from-alist
            • Prefix-of-eachp
            • Vl-maybe-string-listp
            • Pos-listp
            • Vl-string-values-p
            • String-list-listp
            • True-list-listp
            • Symbol-list-listp
            • Explode-list
            • All-have-len
            • Min-nats
            • Debuggable-and
            • Vl-starname
            • Remove-equal-without-guard
            • String-fix
            • Longer-than-p
            • Clean-alist
            • Anyp
            • Or*
            • Fast-alist-free-each-alist-val
            • And*
            • Not*
            • Free-list-of-fast-alists
            • *nls*
          • Loader
          • Transforms
          • Lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Html-encoding

    Vl-html-encode-push

    Print the HTML encoding of a character.

    Signature
    (vl-html-encode-push char1 col tabsize acc) → new-acc
    Arguments
    char1 — Character to be printed.
        Guard (characterp char1).
    col — Current column number before printing char1 (for tab computations).
        Guard (natp col).
    tabsize — Guard (posp tabsize).
    acc — Reverse order characters we're building.
    Returns
    new-acc — Type (character-listp new-acc), given (character-listp acc).

    Definitions and Theorems

    Function: vl-html-encode-push

    (defun vl-html-encode-push (char1 col tabsize acc)
     (declare (xargs :guard (and (characterp char1)
                                 (natp col)
                                 (posp tabsize))))
     (let ((__function__ 'vl-html-encode-push))
      (declare (ignorable __function__))
      (b* ((char1 (mbe :logic (char-fix char1)
                       :exec char1))
           (col (lnfix col)))
       (case char1
             (#\Space (if (or (atom acc)
                              (eql (car acc) #\Space)
                              (eql (car acc) #\Newline))
                          (revappend *vl-html-&nbsp* acc)
                        (cons #\Space acc)))
             (#\Newline (revappend *vl-html-newline* acc))
             (#\< (revappend *vl-html-&lt* acc))
             (#\> (revappend *vl-html-&gt* acc))
             (#\& (revappend *vl-html-&amp* acc))
             (#\" (revappend *vl-html-&quot* acc))
             (#\Tab (repeated-revappend (vl-distance-to-tab col tabsize)
                                        *vl-html-&nbsp* acc))
             (otherwise (cons char1 acc))))))

    Theorem: character-listp-of-vl-html-encode-push

    (defthm character-listp-of-vl-html-encode-push
      (implies
           (character-listp acc)
           (b* ((new-acc (vl-html-encode-push char1 col tabsize acc)))
             (character-listp new-acc)))
      :rule-classes :rewrite)

    Theorem: vl-html-encode-push-of-char-fix-char1

    (defthm vl-html-encode-push-of-char-fix-char1
      (equal (vl-html-encode-push (char-fix char1)
                                  col tabsize acc)
             (vl-html-encode-push char1 col tabsize acc)))

    Theorem: vl-html-encode-push-chareqv-congruence-on-char1

    (defthm vl-html-encode-push-chareqv-congruence-on-char1
     (implies (chareqv char1 char1-equiv)
              (equal (vl-html-encode-push char1 col tabsize acc)
                     (vl-html-encode-push char1-equiv col tabsize acc)))
     :rule-classes :congruence)

    Theorem: vl-html-encode-push-of-nfix-col

    (defthm vl-html-encode-push-of-nfix-col
      (equal (vl-html-encode-push char1 (nfix col)
                                  tabsize acc)
             (vl-html-encode-push char1 col tabsize acc)))

    Theorem: vl-html-encode-push-nat-equiv-congruence-on-col

    (defthm vl-html-encode-push-nat-equiv-congruence-on-col
     (implies (acl2::nat-equiv col col-equiv)
              (equal (vl-html-encode-push char1 col tabsize acc)
                     (vl-html-encode-push char1 col-equiv tabsize acc)))
     :rule-classes :congruence)

    Theorem: vl-html-encode-push-of-pos-fix-tabsize

    (defthm vl-html-encode-push-of-pos-fix-tabsize
      (equal (vl-html-encode-push char1 col (pos-fix tabsize)
                                  acc)
             (vl-html-encode-push char1 col tabsize acc)))

    Theorem: vl-html-encode-push-pos-equiv-congruence-on-tabsize

    (defthm vl-html-encode-push-pos-equiv-congruence-on-tabsize
     (implies (acl2::pos-equiv tabsize tabsize-equiv)
              (equal (vl-html-encode-push char1 col tabsize acc)
                     (vl-html-encode-push char1 col tabsize-equiv acc)))
     :rule-classes :congruence)