• 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
                • Svstack-fix
                • Svstack-p
                  • Svstack-p-basics
                  • Svstack-equiv
                • 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
    • Svstack-p

    Svstack-p-basics

    Basic theorems about svstack-p, generated by std::deflist.

    Definitions and Theorems

    Theorem: svstack-p-of-cons

    (defthm svstack-p-of-cons
      (equal (svstack-p (cons acl2::a x))
             (and (svex-alist-p acl2::a)
                  (svstack-p x)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-cdr-when-svstack-p

    (defthm svstack-p-of-cdr-when-svstack-p
      (implies (svstack-p (double-rewrite x))
               (svstack-p (cdr x)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-when-not-consp

    (defthm svstack-p-when-not-consp
      (implies (not (consp x)) (svstack-p x))
      :rule-classes ((:rewrite)))

    Theorem: svex-alist-p-of-car-when-svstack-p

    (defthm svex-alist-p-of-car-when-svstack-p
      (implies (svstack-p x)
               (iff (svex-alist-p (car x))
                    (or (consp x) (svex-alist-p nil))))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-append

    (defthm svstack-p-of-append
      (equal (svstack-p (append acl2::a acl2::b))
             (and (svstack-p acl2::a)
                  (svstack-p acl2::b)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-list-fix

    (defthm svstack-p-of-list-fix
      (equal (svstack-p (list-fix x))
             (svstack-p x))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-sfix

    (defthm svstack-p-of-sfix
      (iff (svstack-p (sfix x))
           (or (svstack-p x) (not (setp x))))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-insert

    (defthm svstack-p-of-insert
      (iff (svstack-p (insert acl2::a x))
           (and (svstack-p (sfix x))
                (svex-alist-p acl2::a)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-delete

    (defthm svstack-p-of-delete
      (implies (svstack-p x)
               (svstack-p (delete acl2::k x)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-mergesort

    (defthm svstack-p-of-mergesort
      (iff (svstack-p (mergesort x))
           (svstack-p (list-fix x)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-union

    (defthm svstack-p-of-union
      (iff (svstack-p (union x y))
           (and (svstack-p (sfix x))
                (svstack-p (sfix y))))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-intersect-1

    (defthm svstack-p-of-intersect-1
      (implies (svstack-p x)
               (svstack-p (intersect x y)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-intersect-2

    (defthm svstack-p-of-intersect-2
      (implies (svstack-p y)
               (svstack-p (intersect x y)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-difference

    (defthm svstack-p-of-difference
      (implies (svstack-p x)
               (svstack-p (difference x y)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-duplicated-members

    (defthm svstack-p-of-duplicated-members
      (implies (svstack-p x)
               (svstack-p (duplicated-members x)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-rev

    (defthm svstack-p-of-rev
      (equal (svstack-p (rev x))
             (svstack-p (list-fix x)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-rcons

    (defthm svstack-p-of-rcons
      (iff (svstack-p (acl2::rcons acl2::a x))
           (and (svex-alist-p acl2::a)
                (svstack-p (list-fix x))))
      :rule-classes ((:rewrite)))

    Theorem: svex-alist-p-when-member-equal-of-svstack-p

    (defthm svex-alist-p-when-member-equal-of-svstack-p
      (and (implies (and (member-equal acl2::a x)
                         (svstack-p x))
                    (svex-alist-p acl2::a))
           (implies (and (svstack-p x)
                         (member-equal acl2::a x))
                    (svex-alist-p acl2::a)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-when-subsetp-equal

    (defthm svstack-p-when-subsetp-equal
      (and (implies (and (subsetp-equal x y) (svstack-p y))
                    (svstack-p x))
           (implies (and (svstack-p y) (subsetp-equal x y))
                    (svstack-p x)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-set-equiv-congruence

    (defthm svstack-p-set-equiv-congruence
      (implies (set-equiv x y)
               (equal (svstack-p x) (svstack-p y)))
      :rule-classes :congruence)

    Theorem: svstack-p-of-set-difference-equal

    (defthm svstack-p-of-set-difference-equal
      (implies (svstack-p x)
               (svstack-p (set-difference-equal x y)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-intersection-equal-1

    (defthm svstack-p-of-intersection-equal-1
      (implies (svstack-p (double-rewrite x))
               (svstack-p (intersection-equal x y)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-intersection-equal-2

    (defthm svstack-p-of-intersection-equal-2
      (implies (svstack-p (double-rewrite y))
               (svstack-p (intersection-equal x y)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-union-equal

    (defthm svstack-p-of-union-equal
      (equal (svstack-p (union-equal x y))
             (and (svstack-p (list-fix x))
                  (svstack-p (double-rewrite y))))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-take

    (defthm svstack-p-of-take
      (implies (svstack-p (double-rewrite x))
               (iff (svstack-p (take acl2::n x))
                    (or (svex-alist-p nil)
                        (<= (nfix acl2::n) (len x)))))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-repeat

    (defthm svstack-p-of-repeat
      (iff (svstack-p (repeat acl2::n x))
           (or (svex-alist-p x) (zp acl2::n)))
      :rule-classes ((:rewrite)))

    Theorem: svex-alist-p-of-nth-when-svstack-p

    (defthm svex-alist-p-of-nth-when-svstack-p
      (implies (and (svstack-p x)
                    (< (nfix acl2::n) (len x)))
               (svex-alist-p (nth acl2::n x)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-update-nth

    (defthm svstack-p-of-update-nth
      (implies (svstack-p (double-rewrite x))
               (iff (svstack-p (update-nth acl2::n y x))
                    (and (svex-alist-p y)
                         (or (<= (nfix acl2::n) (len x))
                             (svex-alist-p nil)))))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-butlast

    (defthm svstack-p-of-butlast
      (implies (svstack-p (double-rewrite x))
               (svstack-p (butlast x acl2::n)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-nthcdr

    (defthm svstack-p-of-nthcdr
      (implies (svstack-p (double-rewrite x))
               (svstack-p (nthcdr acl2::n x)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-last

    (defthm svstack-p-of-last
      (implies (svstack-p (double-rewrite x))
               (svstack-p (last x)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-remove

    (defthm svstack-p-of-remove
      (implies (svstack-p x)
               (svstack-p (remove acl2::a x)))
      :rule-classes ((:rewrite)))

    Theorem: svstack-p-of-revappend

    (defthm svstack-p-of-revappend
      (equal (svstack-p (revappend x y))
             (and (svstack-p (list-fix x))
                  (svstack-p y)))
      :rule-classes ((:rewrite)))