• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
      • Fgl
      • Vwsim
      • Vl
        • Syntax
        • Loader
        • Warnings
        • Getting-started
        • Utilities
        • Printer
        • Kit
        • Mlib
          • Scopestack
          • Hid-tools
          • Filtering-by-name
          • Vl-interface-mocktype
          • Stripping-functions
          • Genblob
          • Expr-tools
            • Vl-expr-typedecide
            • Vl-exprlist-resolved->vals
            • Vl-make-idexpr-list
            • Vl-idexprlist->names
            • Vl-expr-selfsize
            • Vl-expr-update-subexprs
            • Vl-exprlist-to-plainarglist
            • Vl-call-namedargs-update-subexprs
            • Vl-valuerangelist-update-subexprs
            • Vl-streamexprlist-update-subexprs
            • Vl-op-p
            • Vl-maybe-exprlist-update-subexprs
            • Vl-evatomlist-update-subexprs
            • Vl-expr-values
            • Vl-keyvallist-update-subexprs
            • Vl-assignpat-update-subexprs
            • Vl-valuerange-update-subexprs
            • Vl-scopeexpr-update-subexprs
            • Vl-partselect-update-subexprs
            • Vl-hidexpr-update-subexprs
            • Vl-expr-add-atts
            • Vl-arrayrange-update-subexprs
            • Vl-streamexpr-update-subexprs
            • Vl-slicesize-update-subexprs
            • Vl-plusminus-update-subexprs
            • Vl-patternkey-update-subexprs
            • Vl-expr-ops
            • Vl-make-integer
            • Vl-range-update-subexprs
            • Vl-idexpr
            • Vl-make-index
            • Vl-expr->subexprs
            • Vl-bitlist-from-nat
            • Vl-pps-expr
            • Vl-maybe-exprlist->subexprs
            • Vl-hidexpr->subexprs
            • Vl-evatomlist->subexprs
            • Vl-call-namedargs->subexprs
            • Vl-valuerangelist->subexprs
            • Vl-streamexprlist->subexprs
            • Vl-keyvallist->subexprs
            • Vl-exprlist-has-ops
            • Vl-expr-resolved-p
            • Vl-valuerange->subexprs
            • Vl-streamexpr->subexprs
            • Vl-slicesize->subexprs
            • Vl-scopeexpr->subexprs
            • Vl-patternkey->subexprs
            • Vl-partselect->subexprs
            • Vl-assignpat->subexprs
            • Vl-arrayrange->subexprs
            • Vl-pps-origexpr
            • Vl-plusminus->subexprs
            • Vl-idscope
            • Vl-idexpr->name
            • Vl-expr-has-ops
            • Vl-resolved->val
            • Vl-range->subexprs
            • Vl-idexpr-p
            • Vl-idexprlist-p
            • Vl-exprlist-resolved-p
            • Vl-idscope->name
            • Vl-idscope-p
            • Vl-zbitlist-p
            • Vl-zatom-p
            • Vl-op-fix
            • Vl-oplist
              • Vl-oplist-fix
                • Vl-oplist-equiv
                • Vl-oplist-p
              • Vl-expr-varnames
              • Vl-one-bit-constants
            • Extract-vl-types
            • Hierarchy
            • Range-tools
            • Finding-by-name
            • Stmt-tools
            • Modnamespace
            • Flat-warnings
            • Reordering-by-name
            • Datatype-tools
            • Syscalls
            • Allexprs
            • Lvalues
            • Port-tools
          • Transforms
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Vl-oplist

    Vl-oplist-fix

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

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

    In the logic, we apply vl-op-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: vl-oplist-fix$inline

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

    Theorem: vl-oplist-p-of-vl-oplist-fix

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

    Theorem: vl-oplist-fix-when-vl-oplist-p

    (defthm vl-oplist-fix-when-vl-oplist-p
      (implies (vl-oplist-p x)
               (equal (vl-oplist-fix x) x)))

    Function: vl-oplist-equiv$inline

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

    Theorem: vl-oplist-equiv-is-an-equivalence

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

    Theorem: vl-oplist-equiv-implies-equal-vl-oplist-fix-1

    (defthm vl-oplist-equiv-implies-equal-vl-oplist-fix-1
      (implies (vl-oplist-equiv acl2::x x-equiv)
               (equal (vl-oplist-fix acl2::x)
                      (vl-oplist-fix x-equiv)))
      :rule-classes (:congruence))

    Theorem: vl-oplist-fix-under-vl-oplist-equiv

    (defthm vl-oplist-fix-under-vl-oplist-equiv
      (vl-oplist-equiv (vl-oplist-fix acl2::x)
                       acl2::x)
      :rule-classes (:rewrite :rewrite-quoted-constant))

    Theorem: equal-of-vl-oplist-fix-1-forward-to-vl-oplist-equiv

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

    Theorem: equal-of-vl-oplist-fix-2-forward-to-vl-oplist-equiv

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

    Theorem: vl-oplist-equiv-of-vl-oplist-fix-1-forward

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

    Theorem: vl-oplist-equiv-of-vl-oplist-fix-2-forward

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

    Theorem: car-of-vl-oplist-fix-x-under-vl-op-equiv

    (defthm car-of-vl-oplist-fix-x-under-vl-op-equiv
      (vl-op-equiv (car (vl-oplist-fix acl2::x))
                   (car acl2::x)))

    Theorem: car-vl-oplist-equiv-congruence-on-x-under-vl-op-equiv

    (defthm car-vl-oplist-equiv-congruence-on-x-under-vl-op-equiv
      (implies (vl-oplist-equiv acl2::x x-equiv)
               (vl-op-equiv (car acl2::x)
                            (car x-equiv)))
      :rule-classes :congruence)

    Theorem: cdr-of-vl-oplist-fix-x-under-vl-oplist-equiv

    (defthm cdr-of-vl-oplist-fix-x-under-vl-oplist-equiv
      (vl-oplist-equiv (cdr (vl-oplist-fix acl2::x))
                       (cdr acl2::x)))

    Theorem: cdr-vl-oplist-equiv-congruence-on-x-under-vl-oplist-equiv

    (defthm cdr-vl-oplist-equiv-congruence-on-x-under-vl-oplist-equiv
      (implies (vl-oplist-equiv acl2::x x-equiv)
               (vl-oplist-equiv (cdr acl2::x)
                                (cdr x-equiv)))
      :rule-classes :congruence)

    Theorem: cons-of-vl-op-fix-x-under-vl-oplist-equiv

    (defthm cons-of-vl-op-fix-x-under-vl-oplist-equiv
      (vl-oplist-equiv (cons (vl-op-fix acl2::x) acl2::y)
                       (cons acl2::x acl2::y)))

    Theorem: cons-vl-op-equiv-congruence-on-x-under-vl-oplist-equiv

    (defthm cons-vl-op-equiv-congruence-on-x-under-vl-oplist-equiv
      (implies (vl-op-equiv acl2::x x-equiv)
               (vl-oplist-equiv (cons acl2::x acl2::y)
                                (cons x-equiv acl2::y)))
      :rule-classes :congruence)

    Theorem: cons-of-vl-oplist-fix-y-under-vl-oplist-equiv

    (defthm cons-of-vl-oplist-fix-y-under-vl-oplist-equiv
      (vl-oplist-equiv (cons acl2::x (vl-oplist-fix acl2::y))
                       (cons acl2::x acl2::y)))

    Theorem: cons-vl-oplist-equiv-congruence-on-y-under-vl-oplist-equiv

    (defthm cons-vl-oplist-equiv-congruence-on-y-under-vl-oplist-equiv
      (implies (vl-oplist-equiv acl2::y y-equiv)
               (vl-oplist-equiv (cons acl2::x acl2::y)
                                (cons acl2::x y-equiv)))
      :rule-classes :congruence)

    Theorem: consp-of-vl-oplist-fix

    (defthm consp-of-vl-oplist-fix
      (equal (consp (vl-oplist-fix acl2::x))
             (consp acl2::x)))

    Theorem: vl-oplist-fix-of-cons

    (defthm vl-oplist-fix-of-cons
      (equal (vl-oplist-fix (cons a x))
             (cons (vl-op-fix a) (vl-oplist-fix x))))

    Theorem: len-of-vl-oplist-fix

    (defthm len-of-vl-oplist-fix
      (equal (len (vl-oplist-fix acl2::x))
             (len acl2::x)))

    Theorem: vl-oplist-fix-of-append

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

    Theorem: vl-oplist-fix-of-repeat

    (defthm vl-oplist-fix-of-repeat
      (equal (vl-oplist-fix (repeat acl2::n acl2::x))
             (repeat acl2::n (vl-op-fix acl2::x))))

    Theorem: nth-of-vl-oplist-fix

    (defthm nth-of-vl-oplist-fix
      (equal (nth acl2::n (vl-oplist-fix acl2::x))
             (if (< (nfix acl2::n) (len acl2::x))
                 (vl-op-fix (nth acl2::n acl2::x))
               nil)))

    Theorem: vl-oplist-equiv-implies-vl-oplist-equiv-append-1

    (defthm vl-oplist-equiv-implies-vl-oplist-equiv-append-1
      (implies (vl-oplist-equiv acl2::x fty::x-equiv)
               (vl-oplist-equiv (append acl2::x acl2::y)
                                (append fty::x-equiv acl2::y)))
      :rule-classes (:congruence))

    Theorem: vl-oplist-equiv-implies-vl-oplist-equiv-append-2

    (defthm vl-oplist-equiv-implies-vl-oplist-equiv-append-2
      (implies (vl-oplist-equiv acl2::y fty::y-equiv)
               (vl-oplist-equiv (append acl2::x acl2::y)
                                (append acl2::x fty::y-equiv)))
      :rule-classes (:congruence))

    Theorem: vl-oplist-equiv-implies-vl-oplist-equiv-nthcdr-2

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

    Theorem: vl-oplist-equiv-implies-vl-oplist-equiv-take-2

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