• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
        • Warnings
        • Primitives
        • Use-set
        • Syntax
        • Getting-started
        • Utilities
        • Loader
        • Transforms
        • Lint
          • Vl-lintconfig-p
          • Lucid
          • Skip-detection
            • Sd-problem-p
            • Sd-keylist-find-skipped
            • Sd-keylist->indicies
            • Sd-key-p
            • Sd-patalist-compare
            • Sd-analyze-ctxexprs
            • Sd-problemlist-p
            • Sd-patalist-p
            • Sd-keygen
            • Sd-patalist
              • Sd-keylist-p
              • Sd-analyze-modulelist
              • Sd-analyze-module-aux
              • Sd-analyze-module
              • Sd-pp-problem-long
              • Sd-analyze-modulelist-aux
              • Sd-problem-score
              • Sd-pp-problem-header
              • Sd-analyze-design
              • Sd-problem->
              • Sd-pp-problem-brief
              • Sd-pp-problemlist-long
              • Sd-pp-problemlist-brief
              • Sd-natlist-linear-increments-p
              • Sd-keylist-linear-increments-p
            • Vl-lintresult-p
            • Lint-warning-suppression
            • Condcheck
            • Selfassigns
            • Leftright-check
            • Dupeinst-check
            • Oddexpr-check
            • Remove-toohard
            • Qmarksize-check
            • Portcheck
            • Duplicate-detect
            • Vl-print-certain-warnings
            • Duperhs-check
            • *vl-lint-help*
            • Lint-stmt-rewrite
            • Drop-missing-submodules
            • Check-case
            • Drop-user-submodules
            • Check-namespace
            • Vl-lint
          • Mlib
          • Server
          • Kit
          • Printer
          • Esim-vl
          • Well-formedness
        • Sv
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Skip-detection

    Sd-patalist

    (sd-patalist x) separates a sd-keylist-p by their patterns, producing a sd-patalist-p.

    We return a fast alist which has no shadowed pairs.

    Definitions and Theorems

    Function: sd-patalist-aux

    (defun sd-patalist-aux (x acc)
      (declare (xargs :guard (and (sd-keylist-p x)
                                  (sd-patalist-p acc))))
      (if (atom x)
          acc
        (let* ((key (car x))
               (pat (sd-key->pat key))
               (entry (cdr (hons-get pat acc)))
               (acc (hons-acons pat (cons key entry) acc)))
          (sd-patalist-aux (cdr x) acc))))

    Theorem: alistp-of-sd-patalist-aux

    (defthm alistp-of-sd-patalist-aux
      (implies (alistp acc)
               (alistp (sd-patalist-aux x acc))))

    Theorem: sd-patalist-p-of-sd-patalist-aux

    (defthm sd-patalist-p-of-sd-patalist-aux
      (implies (and (force (sd-keylist-p x))
                    (force (sd-patalist-p acc)))
               (sd-patalist-p (sd-patalist-aux x acc))))

    Function: sd-patalist

    (defun sd-patalist (x)
      (declare (xargs :guard (sd-keylist-p x)))
      (b* ((unclean (sd-patalist-aux x nil))
           (clean (hons-shrink-alist unclean nil))
           (- (flush-hons-get-hash-table-link unclean)))
        clean))

    Theorem: sd-patalist-p-of-sd-patalist

    (defthm sd-patalist-p-of-sd-patalist
      (implies (force (sd-keylist-p x))
               (sd-patalist-p (sd-patalist x))))

    Theorem: alistp-of-sd-patalist

    (defthm alistp-of-sd-patalist
      (alistp (sd-patalist x)))