• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Community
    • 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
        • Sv-tutorial
        • Expressions
          • Rewriting
          • Svex
          • Bit-blasting
            • Svex-focused-equivalence-checking
              • Svexlist-evals-equal-with-transforms
              • Svexlist-eval-integer-listp-with-transforms
              • Svexlist-evals-equal-and-integerp-with-transforms
              • Eval-collection-of-a4vecs-and-aigs
              • Svexlist->a4vecs-for-varlist-with-subexprs
              • Svex-mask-env-common-constants
                • Svex-envs-common-constants-aux
                • 4veclist-separate-upper-lower-rec-log
                • Svex-envs-common-constants
                • A4veclist-separate-upper-lower-aux
                • 4veclist-separate-upper-lower
                • Svexlists->a4vec-top
                • A4veclist-separate-upper-lower
                • A4veclist->upper-a4vecs
                • 4veclist->upper-4vecs
                • Hons-aig-accumulate-nodes
                • A4veclist-accumulate-upper-nodes
                • Fgl::fgl-list-object-bfrcounts
                • Hons-aiglist-accumulate-nodes
                • Svexlist-evals-equal
                • A4veclist->upper-a4vecs-acc
                • My-replace-assoc
                • Svexlist-mask-alist/toposort-memo
                • My-binary-append
                • A4veclist-upper-subnodes
                • A4veclist-subnodes
                • A4veclist-accumulate-nodes
                • A4vec-accumulate-nodes
              • A4vec-operations
              • Svexlist-eval-gl
              • Aig-symbolic-arithmetic
              • Svex-varmasks/env->aig-env-rec
              • Svex-varmasks->a4env-rec
              • Svexlist/env-list-eval-gl
              • 4vmask-to-a4vec-rec-env
              • 4vmask-to-a4vec-rec
              • Svexlist->a4vecs-for-varlist
              • Svex-varmasks/env->aig-env-stats-rec
              • Svexlist->a4vec-nrev
              • A4veclist/svex-env-list-eval
              • A4vec
              • Svexlist-x-out-unused-vars
              • Svex->a4vec-memotable-correctp
              • A4vec/svex-env-eval
              • Svex-varmasks->a4env
              • Svex-varmasks/env->aig-env-rec-log
              • 4vmask-to-a4vec-env
              • 4veclist-from-bitlist-log-rec
              • Svex-apply-aig
              • Svexlist-vars-for-symbolic-eval
              • Nat-bool-a4env-upper-boundp
              • 4vmask-to-a4vec
              • Svexlist/env-list-vars-for-symbolic-eval
              • Svex-maskbits-for-vars
              • Svexlist->a4vec-aig-env-for-varlist
              • 4vec-from-bitlist
              • Svexlist-full-masks-p
              • Svex-varmasks/env->aig-env-stats
              • Svex-varmasks/env->aig-env
              • Svexlistlist->a4vec
              • Svex-const-concat-args
              • Svex-mask-alist-extract-vars
              • Svexlist->a4vec-top
              • Nat-bool-a4vec-upper-boundp
              • Nat-bool-a4env-lower-boundp
              • Maybe-a3vec-fix
              • Svex-maskbits-ok
              • Svex-envlist-check-boolmasks
              • Svex-env-check-boolmasks
              • Nat-bool-list-upper-boundp
              • Nat-bool-a4vec-lower-boundp
              • Maybe-svexlist-rewrite-fixpoint
              • 4vmask-to-a4vec-varcount
              • A4vec-eval
              • Svexlist-nth
              • A4veclist-nth
              • Nat-bool-list-lower-boundp
              • 4veclist-from-bitlist
              • V2i-first-n
              • A4veclist-eval-gl
              • Svex-envlist-keyset
              • Svex-a4vec-env-eval
              • A4veclist/env-list-eval
              • Svexlist-variable-mask-alist
              • Sparseint-nfix
              • A4veclist-length
              • A4veclist-eval
              • 4vec-boolmaskp
              • Nat-bool-list-nats
              • Nat-bool-a4env-p
              • Nat-bool-listp
              • A4veclist->aiglist
              • Svexlist-rewrite-fixpoint-memo
              • Nat-bool-a4vec-p
              • A4vec->aiglist
              • Svex-is-const-concat
              • Nat-bool-a4env-vars
              • Svexlist-mask-alist-memo
              • Nat-bool-a4vec-vars
              • Svexlist-vars-memo
              • A4vec-constantp
              • Svex-aig-memotable
              • Svex-a4vec-env
              • A4veclistlist
              • A4veclist
              • Symbolic-params-x-out-cond
            • Functions
            • 4vmask
            • Why-infinite-width
            • Svex-vars
            • Evaluation
            • Values
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Svex-focused-equivalence-checking

    Svex-mask-env-common-constants

    FGL binder to find common constants (under a set of masks) in two symbolic SVEX environments.

    Signature
    (svex-mask-env-common-constants ans masks env1 env2) 
      → 
    const-env
    Arguments
    ans — Guard (svex-env-p ans).
    masks — Guard (svex-mask-alist-p masks).
    env1 — Guard (svex-env-p env1).
    env2 — Guard (svex-env-p env2).

    Definitions and Theorems

    Function: svex-mask-env-common-constants

    (defun svex-mask-env-common-constants (ans masks env1 env2)
     (declare (xargs :guard (and (svex-env-p ans)
                                 (svex-mask-alist-p masks)
                                 (svex-env-p env1)
                                 (svex-env-p env2))))
     (let ((__function__ 'svex-mask-env-common-constants))
      (declare (ignorable __function__))
      (let ((ans (svex-env-fix ans)))
        (if
         (and (ec-call (svex-envs-agree-on-masks masks (append ans env1)
                                                 env1))
              (ec-call (svex-envs-agree-on-masks masks (append ans env2)
                                                 env2)))
         ans
         nil))))

    Theorem: svex-env-common-constants-correct

    (defthm svex-env-common-constants-correct
      (b* ((?const-env
                (svex-mask-env-common-constants ans masks env1 env2)))
        (and (svex-envs-agree-on-masks masks (append const-env env1)
                                       env1)
             (svex-envs-agree-on-masks masks (append const-env env2)
                                       env2))))

    Theorem: svexlist-eval-of-svex-mask-env-common-constants

    (defthm svexlist-eval-of-svex-mask-env-common-constants
      (b* ((masks (svexlist-mask-alist x))
           (?const-env
                (svex-mask-env-common-constants ans masks env1 env2)))
        (and (equal (svexlist-eval x (append const-env env1))
                    (svexlist-eval x env1))
             (equal (svexlist-eval x (append const-env env2))
                    (svexlist-eval x env2)))))

    Theorem: svex-mask-env-common-constants-of-svex-env-fix-ans

    (defthm svex-mask-env-common-constants-of-svex-env-fix-ans
      (equal (svex-mask-env-common-constants (svex-env-fix ans)
                                             masks env1 env2)
             (svex-mask-env-common-constants ans masks env1 env2)))

    Theorem: svex-mask-env-common-constants-svex-env-equiv-congruence-on-ans

    (defthm
        svex-mask-env-common-constants-svex-env-equiv-congruence-on-ans
     (implies
       (svex-env-equiv ans ans-equiv)
       (equal
            (svex-mask-env-common-constants ans masks env1 env2)
            (svex-mask-env-common-constants ans-equiv masks env1 env2)))
     :rule-classes :congruence)

    Theorem: svex-mask-env-common-constants-of-svex-env-fix-env1

    (defthm svex-mask-env-common-constants-of-svex-env-fix-env1
      (equal
           (svex-mask-env-common-constants ans masks (svex-env-fix env1)
                                           env2)
           (svex-mask-env-common-constants ans masks env1 env2)))

    Theorem: svex-mask-env-common-constants-svex-env-equiv-congruence-on-env1

    (defthm
       svex-mask-env-common-constants-svex-env-equiv-congruence-on-env1
     (implies
       (svex-env-equiv env1 env1-equiv)
       (equal
            (svex-mask-env-common-constants ans masks env1 env2)
            (svex-mask-env-common-constants ans masks env1-equiv env2)))
     :rule-classes :congruence)

    Theorem: svex-mask-env-common-constants-of-svex-env-fix-env2

    (defthm svex-mask-env-common-constants-of-svex-env-fix-env2
      (equal (svex-mask-env-common-constants
                  ans masks env1 (svex-env-fix env2))
             (svex-mask-env-common-constants ans masks env1 env2)))

    Theorem: svex-mask-env-common-constants-svex-env-equiv-congruence-on-env2

    (defthm
       svex-mask-env-common-constants-svex-env-equiv-congruence-on-env2
     (implies
       (svex-env-equiv env2 env2-equiv)
       (equal
            (svex-mask-env-common-constants ans masks env1 env2)
            (svex-mask-env-common-constants ans masks env1 env2-equiv)))
     :rule-classes :congruence)