• 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
        • Sv-tutorial
        • Expressions
          • Rewriting
          • Svex
          • Bit-blasting
            • Svex-focused-equivalence-checking
            • 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
    • Bit-blasting

    Svex-apply-aig

    Signature
    (svex-apply-aig fn args terms mask) → res
    Arguments
    fn — Guard (fnsym-p fn).
    args — Guard (a4veclist-p args).
    terms — Guard (svexlist-p terms).
    mask — Guard (4vmask-p mask).
    Returns
    res — Type (a4vec-p res).

    Definitions and Theorems

    Function: svex-apply-aig

    (defun svex-apply-aig (fn args terms mask)
      (declare (xargs :guard (and (fnsym-p fn)
                                  (a4veclist-p args)
                                  (svexlist-p terms)
                                  (4vmask-p mask))))
      (let ((__function__ 'svex-apply-aig))
        (declare (ignorable __function__))
        (b* ((fn (fnsym-fix fn))
             (args (a4veclist-fix args))
             (res (svex-apply-aig-cases fn args terms mask)))
          (a4vec-mask mask res))))

    Theorem: a4vec-p-of-svex-apply-aig

    (defthm a4vec-p-of-svex-apply-aig
      (b* ((res (svex-apply-aig fn args terms mask)))
        (a4vec-p res))
      :rule-classes :rewrite)

    Theorem: svex-apply-aig-correct

    (defthm svex-apply-aig-correct
     (implies
      (and
        (fnsym-p fn)
        (bind-free '((a4env . env)) (a4env))
        (equal
             (a4veclist-eval vals aigenv)
             (4veclist-mask
                  argmasks
                  (svexlist-eval x (svex-a4vec-env-eval a4env aigenv))))
        (svex-argmasks-okp (svex-call fn x)
                           mask argmasks))
      (equal
       (a4vec-eval (svex-apply-aig fn vals x mask)
                   aigenv)
       (4vec-mask
            mask
            (svex-apply
                 fn
                 (svexlist-eval x
                                (svex-a4vec-env-eval a4env aigenv)))))))

    Theorem: svex-apply-aig-of-fnsym-fix-fn

    (defthm svex-apply-aig-of-fnsym-fix-fn
      (equal (svex-apply-aig (fnsym-fix fn)
                             args terms mask)
             (svex-apply-aig fn args terms mask)))

    Theorem: svex-apply-aig-fnsym-equiv-congruence-on-fn

    (defthm svex-apply-aig-fnsym-equiv-congruence-on-fn
      (implies (fnsym-equiv fn fn-equiv)
               (equal (svex-apply-aig fn args terms mask)
                      (svex-apply-aig fn-equiv args terms mask)))
      :rule-classes :congruence)

    Theorem: svex-apply-aig-of-a4veclist-fix-args

    (defthm svex-apply-aig-of-a4veclist-fix-args
      (equal (svex-apply-aig fn (a4veclist-fix args)
                             terms mask)
             (svex-apply-aig fn args terms mask)))

    Theorem: svex-apply-aig-a4veclist-equiv-congruence-on-args

    (defthm svex-apply-aig-a4veclist-equiv-congruence-on-args
      (implies (a4veclist-equiv args args-equiv)
               (equal (svex-apply-aig fn args terms mask)
                      (svex-apply-aig fn args-equiv terms mask)))
      :rule-classes :congruence)

    Theorem: svex-apply-aig-of-svexlist-fix-terms

    (defthm svex-apply-aig-of-svexlist-fix-terms
      (equal (svex-apply-aig fn args (svexlist-fix terms)
                             mask)
             (svex-apply-aig fn args terms mask)))

    Theorem: svex-apply-aig-svexlist-equiv-congruence-on-terms

    (defthm svex-apply-aig-svexlist-equiv-congruence-on-terms
      (implies (svexlist-equiv terms terms-equiv)
               (equal (svex-apply-aig fn args terms mask)
                      (svex-apply-aig fn args terms-equiv mask)))
      :rule-classes :congruence)

    Theorem: svex-apply-aig-of-4vmask-fix-mask

    (defthm svex-apply-aig-of-4vmask-fix-mask
      (equal (svex-apply-aig fn args terms (4vmask-fix mask))
             (svex-apply-aig fn args terms mask)))

    Theorem: svex-apply-aig-4vmask-equiv-congruence-on-mask

    (defthm svex-apply-aig-4vmask-equiv-congruence-on-mask
      (implies (4vmask-equiv mask mask-equiv)
               (equal (svex-apply-aig fn args terms mask)
                      (svex-apply-aig fn args terms mask-equiv)))
      :rule-classes :congruence)