• 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
          • Functions
          • 4vmask
          • Why-infinite-width
          • Svex-vars
          • Evaluation
            • Svex-xeval
            • Svex-mono-eval
              • Svex-alist-mono-eval
              • Svex-mono-eval-monotonicity
                • Svexlist-mono-eval
                • Svex-fn/args-mono-eval
                • Svex-call-mono-eval
              • Svex-eval
              • Svex-apply
              • Svex-env
              • Svex-alist-eval
              • Svar-boolmasks-lookup
              • Svex-s4eval
              • Svexlist-unquote
              • Svex-alist-eval-for-symbolic
              • Svexlist-eval
              • Svexlist-quotesp
              • Svar-boolmasks
              • Svexlist-s4eval
              • Svexlist-eval-for-symbolic
            • Values
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Svex-mono-eval
    • 4vec-monotonicity

    Svex-mono-eval-monotonicity

    (svex-mono-eval x) always approximates (svex-eval x env), for any environment.

    Definitions and Theorems

    Theorem: svex-mono-eval-monotonic

    (defthm svex-mono-eval-monotonic
      (implies (svex-env-<<= env1 env2)
               (4vec-<<= (svex-mono-eval x env1)
                         (svex-mono-eval x env2))))

    Theorem: svex-call-mono-eval-monotonic

    (defthm svex-call-mono-eval-monotonic
      (implies (svex-env-<<= env1 env2)
               (4vec-<<= (svex-call-mono-eval x env1)
                         (svex-call-mono-eval x env2))))

    Theorem: svex-fn/args-mono-eval-monotonic

    (defthm svex-fn/args-mono-eval-monotonic
      (implies (svex-env-<<= env1 env2)
               (4vec-<<= (svex-fn/args-mono-eval fn args env1)
                         (svex-fn/args-mono-eval fn args env2))))

    Theorem: svexlist-mono-eval-monotonic

    (defthm svexlist-mono-eval-monotonic
      (implies (svex-env-<<= env1 env2)
               (4veclist-<<= (svexlist-mono-eval x env1)
                             (svexlist-mono-eval x env2))))

    Theorem: svex-alist-mono-eval-monotonic

    (defthm svex-alist-mono-eval-monotonic
      (implies (svex-env-<<= env1 env2)
               (svex-env-<<= (svex-alist-mono-eval x env1)
                             (svex-alist-mono-eval x env2))))

    Theorem: svex-eval-gte-mono-eval

    (defthm svex-eval-gte-mono-eval
      (4vec-<<= (svex-mono-eval x env)
                (svex-eval x env)))

    Theorem: svexlist-eval-gte-mono-eval

    (defthm svexlist-eval-gte-mono-eval
      (4veclist-<<= (svexlist-mono-eval x env)
                    (svexlist-eval x env)))

    Theorem: svex-alist-eval-gte-mono-eval

    (defthm svex-alist-eval-gte-mono-eval
      (svex-env-<<= (svex-alist-mono-eval x env)
                    (svex-alist-eval x env)))

    Theorem: svex-eval-gte-xeval

    (defthm svex-eval-gte-xeval
      (4vec-<<= (svex-xeval x)
                (svex-eval x env)))

    Theorem: svexlist-eval-gte-xeval

    (defthm svexlist-eval-gte-xeval
      (4veclist-<<= (svexlist-xeval x)
                    (svexlist-eval x env)))

    Theorem: svex-alist-eval-gte-xeval

    (defthm svex-alist-eval-gte-xeval
      (svex-env-<<= (svex-alist-xeval x)
                    (svex-alist-eval x env)))

    Accordingly, we can often use svex-mono-eval in place of svex-eval.

    Theorem: svex-eval-when-2vec-p-of-minval

    (defthm svex-eval-when-2vec-p-of-minval
      (implies (and (syntaxp (not (equal env ''nil)))
                    (2vec-p (svex-mono-eval n env)))
               (equal (svex-eval n env)
                      (svex-mono-eval n env))))

    Theorem: logbitp-when-4vec-<<=-svex-eval-strong

    (defthm logbitp-when-4vec-<<=-svex-eval-strong
     (implies
      (syntaxp (not (equal env ''nil)))
      (and
       (equal
         (logbitp n (4vec->upper (svex-eval b env)))
         (if (bit->bool
                  (b-ior (b-not (logbit n (4vec->upper (svex-xeval b))))
                         (logbit n (4vec->lower (svex-xeval b)))))
             (logbitp n (4vec->upper (svex-xeval b)))
           (bit-n n (4vec->upper (svex-eval b env)))))
       (equal
         (logbitp n (4vec->lower (svex-eval b env)))
         (if (bit->bool
                  (b-ior (b-not (logbit n (4vec->upper (svex-xeval b))))
                         (logbit n (4vec->lower (svex-xeval b)))))
             (logbitp n (4vec->lower (svex-xeval b)))
           (bit-n n (4vec->lower (svex-eval b env))))))))