• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Community
    • Proof-automation
    • ACL2
    • Macro-libraries
    • 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-constraints
          • Svstmt-jump
          • Svstmtlist
          • Svstmt-kind
          • Svstmt.lisp
            • Svstmt-write
            • Svstmt-writelist-vars
            • Svstmt-write-vars
            • Svstmt-writelist
              • Svstmt-writelist-fix
                • Svstmt-writelist-equiv
                • Svstmt-writelist-p
              • Svjump-p
            • 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-writelist

    Svstmt-writelist-fix

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

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

    In the logic, we apply svstmt-write-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: svstmt-writelist-fix$inline

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

    Theorem: svstmt-writelist-p-of-svstmt-writelist-fix

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

    Theorem: svstmt-writelist-fix-when-svstmt-writelist-p

    (defthm svstmt-writelist-fix-when-svstmt-writelist-p
      (implies (svstmt-writelist-p x)
               (equal (svstmt-writelist-fix x) x)))

    Function: svstmt-writelist-equiv$inline

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

    Theorem: svstmt-writelist-equiv-is-an-equivalence

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

    Theorem: svstmt-writelist-equiv-implies-equal-svstmt-writelist-fix-1

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

    Theorem: svstmt-writelist-fix-under-svstmt-writelist-equiv

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

    Theorem: equal-of-svstmt-writelist-fix-1-forward-to-svstmt-writelist-equiv

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

    Theorem: equal-of-svstmt-writelist-fix-2-forward-to-svstmt-writelist-equiv

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

    Theorem: svstmt-writelist-equiv-of-svstmt-writelist-fix-1-forward

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

    Theorem: svstmt-writelist-equiv-of-svstmt-writelist-fix-2-forward

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

    Theorem: car-of-svstmt-writelist-fix-x-under-svstmt-write-equiv

    (defthm car-of-svstmt-writelist-fix-x-under-svstmt-write-equiv
      (svstmt-write-equiv (car (svstmt-writelist-fix x))
                          (car x)))

    Theorem: car-svstmt-writelist-equiv-congruence-on-x-under-svstmt-write-equiv

    (defthm
     car-svstmt-writelist-equiv-congruence-on-x-under-svstmt-write-equiv
     (implies (svstmt-writelist-equiv x x-equiv)
              (svstmt-write-equiv (car x)
                                  (car x-equiv)))
     :rule-classes :congruence)

    Theorem: cdr-of-svstmt-writelist-fix-x-under-svstmt-writelist-equiv

    (defthm cdr-of-svstmt-writelist-fix-x-under-svstmt-writelist-equiv
      (svstmt-writelist-equiv (cdr (svstmt-writelist-fix x))
                              (cdr x)))

    Theorem: cdr-svstmt-writelist-equiv-congruence-on-x-under-svstmt-writelist-equiv

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

    Theorem: cons-of-svstmt-write-fix-x-under-svstmt-writelist-equiv

    (defthm cons-of-svstmt-write-fix-x-under-svstmt-writelist-equiv
      (svstmt-writelist-equiv (cons (svstmt-write-fix x) y)
                              (cons x y)))

    Theorem: cons-svstmt-write-equiv-congruence-on-x-under-svstmt-writelist-equiv

    (defthm
     cons-svstmt-write-equiv-congruence-on-x-under-svstmt-writelist-equiv
     (implies (svstmt-write-equiv x x-equiv)
              (svstmt-writelist-equiv (cons x y)
                                      (cons x-equiv y)))
     :rule-classes :congruence)

    Theorem: cons-of-svstmt-writelist-fix-y-under-svstmt-writelist-equiv

    (defthm cons-of-svstmt-writelist-fix-y-under-svstmt-writelist-equiv
      (svstmt-writelist-equiv (cons x (svstmt-writelist-fix y))
                              (cons x y)))

    Theorem: cons-svstmt-writelist-equiv-congruence-on-y-under-svstmt-writelist-equiv

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

    Theorem: consp-of-svstmt-writelist-fix

    (defthm consp-of-svstmt-writelist-fix
      (equal (consp (svstmt-writelist-fix x))
             (consp x)))

    Theorem: svstmt-writelist-fix-of-cons

    (defthm svstmt-writelist-fix-of-cons
      (equal (svstmt-writelist-fix (cons a x))
             (cons (svstmt-write-fix a)
                   (svstmt-writelist-fix x))))

    Theorem: len-of-svstmt-writelist-fix

    (defthm len-of-svstmt-writelist-fix
      (equal (len (svstmt-writelist-fix x))
             (len x)))

    Theorem: svstmt-writelist-fix-of-append

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

    Theorem: svstmt-writelist-fix-of-repeat

    (defthm svstmt-writelist-fix-of-repeat
      (equal (svstmt-writelist-fix (repeat acl2::n x))
             (repeat acl2::n (svstmt-write-fix x))))

    Theorem: nth-of-svstmt-writelist-fix

    (defthm nth-of-svstmt-writelist-fix
      (equal (nth acl2::n (svstmt-writelist-fix x))
             (if (< (nfix acl2::n) (len x))
                 (svstmt-write-fix (nth acl2::n x))
               nil)))

    Theorem: svstmt-writelist-equiv-implies-svstmt-writelist-equiv-append-1

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

    Theorem: svstmt-writelist-equiv-implies-svstmt-writelist-equiv-append-2

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

    Theorem: svstmt-writelist-equiv-implies-svstmt-writelist-equiv-nthcdr-2

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

    Theorem: svstmt-writelist-equiv-implies-svstmt-writelist-equiv-take-2

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