• 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
          • Alias-normalization
            • Alias-norm.lisp
              • Lhs-alias-canonicalize-replace-top
              • Aliases-bound-fix
              • Lhs-pairs-set-aliases
              • Setalias
              • Lhs-replace-range
              • Lhatom-bound-fix
              • Constraintlist-subst-from-svexarr
              • Aliases-add-pair
              • Lhs-alias-canonicalize-top
              • Lhs-varbound-fix
                • Aliases-bound-fix-aux
                • Canonicalize-alias-pairs
                • Aliases-finish-canonicalize
                • Assigns-subst
                • Aliases-put-pairs
                • Getalias
                • Lhs-alias-norm
                • Constraintlist-subst-from-svexarr-nrev
                • Assigns-subst-nrev
                • Svex-subst-from-svexarr-memo-ok
                • Collect-aliases
                • Aliases-fix
                • Aliases-empty
            • Svex-design-flatten-and-normalize
            • Svex-design-compile
            • Svex-composition
            • Compile.lisp
            • Assign->segment-drivers
            • Segment-driver-map-resolve
            • Assigns->segment-drivers
          • Moddb
          • Svmods
          • Svstmt
          • Sv-tutorial
          • Expressions
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Alias-norm.lisp

    Lhs-varbound-fix

    Signature
    (lhs-varbound-fix bound offset x) → xx
    Arguments
    bound — Guard (integerp bound).
    offset — Guard (natp offset).
    x — Guard (lhs-p x).
    Returns
    xx — Type (and (lhs-p xx) (lhs-vars-normorderedp bound offset xx)).

    Definitions and Theorems

    Function: lhs-varbound-fix

    (defun lhs-varbound-fix (bound offset x)
     (declare (xargs :guard (and (integerp bound)
                                 (natp offset)
                                 (lhs-p x))))
     (declare (xargs :guard (lhs-vars-normorderedp bound offset x)))
     (let ((__function__ 'lhs-varbound-fix))
      (declare (ignorable __function__))
      (mbe
       :logic
       (if (atom x)
           (lhs-fix x)
         (cons (b* (((lhrange xf) (car x)))
                 (lhrange xf.w
                          (lhatom-bound-fix bound offset xf.atom)))
               (lhs-varbound-fix bound
                                 (+ (lnfix offset) (lhrange->w (car x)))
                                 (cdr x))))
       :exec x)))

    Theorem: return-type-of-lhs-varbound-fix

    (defthm return-type-of-lhs-varbound-fix
      (b* ((xx (lhs-varbound-fix bound offset x)))
        (and (lhs-p xx)
             (lhs-vars-normorderedp bound offset xx)))
      :rule-classes :rewrite)

    Theorem: lhs-varbound-fix-when-lhs-vars-normorderedp

    (defthm lhs-varbound-fix-when-lhs-vars-normorderedp
      (implies (lhs-vars-normorderedp bound offset x)
               (equal (lhs-varbound-fix bound offset x)
                      (lhs-fix x))))

    Theorem: lhs-varbound-fix-of-ifix-bound

    (defthm lhs-varbound-fix-of-ifix-bound
      (equal (lhs-varbound-fix (ifix bound) offset x)
             (lhs-varbound-fix bound offset x)))

    Theorem: lhs-varbound-fix-int-equiv-congruence-on-bound

    (defthm lhs-varbound-fix-int-equiv-congruence-on-bound
      (implies (int-equiv bound bound-equiv)
               (equal (lhs-varbound-fix bound offset x)
                      (lhs-varbound-fix bound-equiv offset x)))
      :rule-classes :congruence)

    Theorem: lhs-varbound-fix-of-nfix-offset

    (defthm lhs-varbound-fix-of-nfix-offset
      (equal (lhs-varbound-fix bound (nfix offset) x)
             (lhs-varbound-fix bound offset x)))

    Theorem: lhs-varbound-fix-nat-equiv-congruence-on-offset

    (defthm lhs-varbound-fix-nat-equiv-congruence-on-offset
      (implies (nat-equiv offset offset-equiv)
               (equal (lhs-varbound-fix bound offset x)
                      (lhs-varbound-fix bound offset-equiv x)))
      :rule-classes :congruence)

    Theorem: lhs-varbound-fix-of-lhs-fix-x

    (defthm lhs-varbound-fix-of-lhs-fix-x
      (equal (lhs-varbound-fix bound offset (lhs-fix x))
             (lhs-varbound-fix bound offset x)))

    Theorem: lhs-varbound-fix-lhs-equiv-congruence-on-x

    (defthm lhs-varbound-fix-lhs-equiv-congruence-on-x
      (implies (lhs-equiv x x-equiv)
               (equal (lhs-varbound-fix bound offset x)
                      (lhs-varbound-fix bound offset x-equiv)))
      :rule-classes :congruence)