• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
        • Svex-decomposition-methodology
        • Sv-versus-esim
        • Svex-decomp
        • Svex-compose-dfs
        • Svex-compilation
        • Moddb
        • Svmods
        • Svstmt
          • Svstmt-case
          • Svstmt-while
          • Svstmt-p
          • Svstmt-if
          • Svstmt-equiv
          • Svstmt-xcond
          • Svstmt-scope
          • Svstmt-assign
          • Svstmt-compile
            • Svstmt-compile.lisp
              • Svstate-merge-branches
              • Svex-alist-merge-branches
              • Svstmt-assign->subst
              • Svstack-merge-branches
              • Svstacks-compatible
              • Svjumpstate-merge-svstate-branches
              • Svjumpstate-svstate-compatible
              • Svstmt-lhs-check-masks
              • Svjumpstate
              • Svjumpstates-compatible
              • Svstmtlist-compile-top
              • Svjumpstate-sequence-svstates
              • Constraintlist-merge-branches
              • Svjumpstate-merge-branches
              • Svex-replace-range
              • Svex-svstmt-ite
              • Svstmt-process-write
              • Svjumpstate-sequence
              • Svstmt-process-writelist
              • Svstack-assign
              • Svstmt-writelist-var-sizes
              • Svstates-compatible
              • 4vec-replace-range
              • Svstmt-write-var-sizes
              • Make-empty-svjumpstate
              • Constraintlist-add-pathcond
              • Svjumpstate-pop-scope
              • Constraintlist-compose-svstack
              • Svstack-to-svex-alist
              • Svstack-filter-global-lhs-vars
              • Svjumpstate-vars
              • Svex-svstmt-or
              • Svex-svstmt-andc1
              • Svstate-push-scope
              • Svstate-pop-scope
              • Svstate-vars
              • Svstack-lookup
              • Svar-subtract-delay
              • Svstmt-initialize-locals
              • Svstack-fork
              • Svstack-clean
                • Svstack-nonempty-fix
                • Svstate-fork
                • Svstate-clean
                • Svstack-globalp
                • Svjumpstate-fork
                • Svar-delayed-member
                • Svjumpstate-levels
                • Svjumpstate-free
                • Svstate-free
                • Svstack-free
                • Svstack
                • Svar-size-alist
              • Svstate
            • Svstmt-constraints
            • Svstmt-jump
            • Svstmtlist
            • Svstmt-kind
            • Svstmt.lisp
            • Svstmt-fix
            • Svstmt-count
          • Sv-tutorial
          • Expressions
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Svstmt-compile.lisp

    Svstack-clean

    Signature
    (svstack-clean x) → new-x
    Arguments
    x — Guard (svstack-p x).
    Returns
    new-x — Type (svstack-p new-x).

    Definitions and Theorems

    Function: svstack-clean

    (defun svstack-clean (x)
      (declare (xargs :guard (svstack-p x)))
      (let ((__function__ 'svstack-clean))
        (declare (ignorable __function__))
        (if (atom x)
            nil
          (cons (fast-alist-clean (svex-alist-fix (car x)))
                (svstack-clean (cdr x))))))

    Theorem: svstack-p-of-svstack-clean

    (defthm svstack-p-of-svstack-clean
      (b* ((new-x (svstack-clean x)))
        (svstack-p new-x))
      :rule-classes :rewrite)

    Theorem: member-vars-of-svstack-clean

    (defthm member-vars-of-svstack-clean
     (implies
      (not (member v
                   (svex-alist-vars (svstack-to-svex-alist x))))
      (not
       (member
         v
         (svex-alist-vars (svstack-to-svex-alist (svstack-clean x)))))))

    Theorem: svex-lookup-of-svstack-clean

    (defthm svex-lookup-of-svstack-clean
      (iff (svex-lookup v
                        (svstack-to-svex-alist (svstack-clean x)))
           (svex-lookup v (svstack-to-svex-alist x))))

    Theorem: consp-of-svstack-clean

    (defthm consp-of-svstack-clean
      (b* ((?new-x (svstack-clean x)))
        (equal (consp new-x) (consp x))))

    Theorem: svstack-clean-of-svstack-fix-x

    (defthm svstack-clean-of-svstack-fix-x
      (equal (svstack-clean (svstack-fix x))
             (svstack-clean x)))

    Theorem: svstack-clean-svstack-equiv-congruence-on-x

    (defthm svstack-clean-svstack-equiv-congruence-on-x
      (implies (svstack-equiv x x-equiv)
               (equal (svstack-clean x)
                      (svstack-clean x-equiv)))
      :rule-classes :congruence)