• 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-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

    Svstack-fix

    (svstack-fix x) is a usual fty list fixing function.

    Signature
    (svstack-fix x) → fty::newx
    Arguments
    x — Guard (svstack-p x).
    Returns
    fty::newx — Type (svstack-p fty::newx).

    In the logic, we apply svex-alist-fix to each member of the x. In the execution, none of that is actually necessary and this is just an inlined identity function.

    Definitions and Theorems

    Function: svstack-fix$inline

    (defun svstack-fix$inline (x)
      (declare (xargs :guard (svstack-p x)))
      (let ((__function__ 'svstack-fix))
        (declare (ignorable __function__))
        (mbe :logic
             (if (atom x)
                 x
               (cons (svex-alist-fix (car x))
                     (svstack-fix (cdr x))))
             :exec x)))

    Theorem: svstack-p-of-svstack-fix

    (defthm svstack-p-of-svstack-fix
      (b* ((fty::newx (svstack-fix$inline x)))
        (svstack-p fty::newx))
      :rule-classes :rewrite)

    Theorem: svstack-fix-when-svstack-p

    (defthm svstack-fix-when-svstack-p
      (implies (svstack-p x)
               (equal (svstack-fix x) x)))

    Function: svstack-equiv$inline

    (defun svstack-equiv$inline (x y)
      (declare (xargs :guard (and (svstack-p x) (svstack-p y))))
      (equal (svstack-fix x) (svstack-fix y)))

    Theorem: svstack-equiv-is-an-equivalence

    (defthm svstack-equiv-is-an-equivalence
      (and (booleanp (svstack-equiv x y))
           (svstack-equiv x x)
           (implies (svstack-equiv x y)
                    (svstack-equiv y x))
           (implies (and (svstack-equiv x y)
                         (svstack-equiv y z))
                    (svstack-equiv x z)))
      :rule-classes (:equivalence))

    Theorem: svstack-equiv-implies-equal-svstack-fix-1

    (defthm svstack-equiv-implies-equal-svstack-fix-1
      (implies (svstack-equiv x x-equiv)
               (equal (svstack-fix x)
                      (svstack-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: svstack-fix-under-svstack-equiv

    (defthm svstack-fix-under-svstack-equiv
      (svstack-equiv (svstack-fix x) x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-svstack-fix-1-forward-to-svstack-equiv

    (defthm equal-of-svstack-fix-1-forward-to-svstack-equiv
      (implies (equal (svstack-fix x) y)
               (svstack-equiv x y))
      :rule-classes :forward-chaining)

    Theorem: equal-of-svstack-fix-2-forward-to-svstack-equiv

    (defthm equal-of-svstack-fix-2-forward-to-svstack-equiv
      (implies (equal x (svstack-fix y))
               (svstack-equiv x y))
      :rule-classes :forward-chaining)

    Theorem: svstack-equiv-of-svstack-fix-1-forward

    (defthm svstack-equiv-of-svstack-fix-1-forward
      (implies (svstack-equiv (svstack-fix x) y)
               (svstack-equiv x y))
      :rule-classes :forward-chaining)

    Theorem: svstack-equiv-of-svstack-fix-2-forward

    (defthm svstack-equiv-of-svstack-fix-2-forward
      (implies (svstack-equiv x (svstack-fix y))
               (svstack-equiv x y))
      :rule-classes :forward-chaining)

    Theorem: car-of-svstack-fix-x-under-svex-alist-equiv

    (defthm car-of-svstack-fix-x-under-svex-alist-equiv
      (svex-alist-equiv (car (svstack-fix x))
                        (car x)))

    Theorem: car-svstack-equiv-congruence-on-x-under-svex-alist-equiv

    (defthm car-svstack-equiv-congruence-on-x-under-svex-alist-equiv
      (implies (svstack-equiv x x-equiv)
               (svex-alist-equiv (car x)
                                 (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-svstack-fix-x-under-svstack-equiv

    (defthm cdr-of-svstack-fix-x-under-svstack-equiv
      (svstack-equiv (cdr (svstack-fix x))
                     (cdr x)))

    Theorem: cdr-svstack-equiv-congruence-on-x-under-svstack-equiv

    (defthm cdr-svstack-equiv-congruence-on-x-under-svstack-equiv
      (implies (svstack-equiv x x-equiv)
               (svstack-equiv (cdr x) (cdr x-equiv)))
      :rule-classes :congruence)

    Theorem: cons-of-svex-alist-fix-x-under-svstack-equiv

    (defthm cons-of-svex-alist-fix-x-under-svstack-equiv
      (svstack-equiv (cons (svex-alist-fix x) y)
                     (cons x y)))

    Theorem: cons-svex-alist-equiv-congruence-on-x-under-svstack-equiv

    (defthm cons-svex-alist-equiv-congruence-on-x-under-svstack-equiv
      (implies (svex-alist-equiv x x-equiv)
               (svstack-equiv (cons x y)
                              (cons x-equiv y)))
      :rule-classes :congruence)

    Theorem: cons-of-svstack-fix-y-under-svstack-equiv

    (defthm cons-of-svstack-fix-y-under-svstack-equiv
      (svstack-equiv (cons x (svstack-fix y))
                     (cons x y)))

    Theorem: cons-svstack-equiv-congruence-on-y-under-svstack-equiv

    (defthm cons-svstack-equiv-congruence-on-y-under-svstack-equiv
      (implies (svstack-equiv y y-equiv)
               (svstack-equiv (cons x y)
                              (cons x y-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-svstack-fix

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

    Theorem: svstack-fix-of-cons

    (defthm svstack-fix-of-cons
      (equal (svstack-fix (cons a x))
             (cons (svex-alist-fix a)
                   (svstack-fix x))))

    Theorem: len-of-svstack-fix

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

    Theorem: svstack-fix-of-append

    (defthm svstack-fix-of-append
      (equal (svstack-fix (append std::a std::b))
             (append (svstack-fix std::a)
                     (svstack-fix std::b))))

    Theorem: svstack-fix-of-repeat

    (defthm svstack-fix-of-repeat
      (equal (svstack-fix (repeat acl2::n x))
             (repeat acl2::n (svex-alist-fix x))))

    Theorem: nth-of-svstack-fix

    (defthm nth-of-svstack-fix
      (equal (nth acl2::n (svstack-fix x))
             (if (< (nfix acl2::n) (len x))
                 (svex-alist-fix (nth acl2::n x))
               nil)))

    Theorem: svstack-equiv-implies-svstack-equiv-append-1

    (defthm svstack-equiv-implies-svstack-equiv-append-1
      (implies (svstack-equiv x fty::x-equiv)
               (svstack-equiv (append x y)
                              (append fty::x-equiv y)))
      :rule-classes (:congruence))

    Theorem: svstack-equiv-implies-svstack-equiv-append-2

    (defthm svstack-equiv-implies-svstack-equiv-append-2
      (implies (svstack-equiv y fty::y-equiv)
               (svstack-equiv (append x y)
                              (append x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: svstack-equiv-implies-svstack-equiv-nthcdr-2

    (defthm svstack-equiv-implies-svstack-equiv-nthcdr-2
      (implies (svstack-equiv acl2::l l-equiv)
               (svstack-equiv (nthcdr acl2::n acl2::l)
                              (nthcdr acl2::n l-equiv)))
      :rule-classes (:congruence))

    Theorem: svstack-equiv-implies-svstack-equiv-take-2

    (defthm svstack-equiv-implies-svstack-equiv-take-2
      (implies (svstack-equiv acl2::l l-equiv)
               (svstack-equiv (take acl2::n acl2::l)
                              (take acl2::n l-equiv)))
      :rule-classes (:congruence))