• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
      • Ipasir
      • Aignet
      • Aig
      • Satlink
      • Truth
        • Index-permute-shrink
        • Permute-stretch
        • Env-mismatch-aux
        • Permute-shrink
        • Permute-polarity
        • Env-permute-polarity
        • Env-permute-shrink
        • Permute-var-down
        • Swap-vars-aux
        • Env-permute-stretch
        • Swap-vars
        • Permute-var-up
        • Negative-cofactor
        • Truth-perm-rev
        • Index-permute-stretch
        • Env-mismatch
        • Truth-perm
        • Swap-polarity
        • Positive-cofactor
        • Index-perm-rev
        • Env-perm-rev
        • Nth-set-bit-pos
        • Index-swap
        • Env-move-var-down
        • Is-xor-with-var
        • Index-perm
        • Env-swap-vars
        • Var
        • Truth-eval
          • Index-move-down
          • Env-update
          • Env-perm
          • Depends-on-witness
          • Env-swap-polarity
          • Var-repetitions
          • Env-move-var-up
          • Index-move-up
          • Depends-on
          • Truth-norm
          • Index-listp
          • Env-diff-index
          • Env-lookup
          • True
          • False
        • Ubdds
        • Bdd
        • Faig
        • Bed
        • 4v
      • Projects
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Truth

    Truth-eval

    Signature
    (truth-eval truth env numvars) → *
    Arguments
    truth — Guard (integerp truth).
    env — Guard (natp env).
    numvars — Guard (natp numvars).

    Definitions and Theorems

    Function: truth-eval

    (defun
         truth-eval (truth env numvars)
         (declare (xargs :guard (and (integerp truth)
                                     (natp env)
                                     (natp numvars))))
         (declare (xargs :guard (unsigned-byte-p numvars env)))
         (let ((__function__ 'truth-eval))
              (declare (ignorable __function__))
              (b* ((env (mbe :logic (loghead (nfix numvars) (nfix env))
                             :exec env)))
                  (logbitp env truth))))

    Theorem: truth-eval-of-lognot

    (defthm truth-eval-of-lognot
            (equal (truth-eval (lognot truth) env numvars)
                   (not (truth-eval truth env numvars))))

    Theorem: truth-eval-of-logand

    (defthm truth-eval-of-logand
            (equal (truth-eval (logand x y) env numvars)
                   (and (truth-eval x env numvars)
                        (truth-eval y env numvars))))

    Theorem: truth-eval-of-logior

    (defthm truth-eval-of-logior
            (equal (truth-eval (logior x y) env numvars)
                   (or (truth-eval x env numvars)
                       (truth-eval y env numvars))))

    Theorem: truth-eval-of-logxor

    (defthm truth-eval-of-logxor
            (equal (truth-eval (logxor x y) env numvars)
                   (xor (truth-eval x env numvars)
                        (truth-eval y env numvars))))

    Theorem: truth-eval-of-consts

    (defthm truth-eval-of-consts
            (and (equal (truth-eval 0 env numvars) nil)
                 (equal (truth-eval -1 env numvars) t)))

    Theorem: truth-eval-of-ifix-truth

    (defthm truth-eval-of-ifix-truth
            (equal (truth-eval (ifix truth) env numvars)
                   (truth-eval truth env numvars)))

    Theorem: truth-eval-int-equiv-congruence-on-truth

    (defthm truth-eval-int-equiv-congruence-on-truth
            (implies (int-equiv truth truth-equiv)
                     (equal (truth-eval truth env numvars)
                            (truth-eval truth-equiv env numvars)))
            :rule-classes :congruence)

    Theorem: truth-eval-of-nfix-env

    (defthm truth-eval-of-nfix-env
            (equal (truth-eval truth (nfix env) numvars)
                   (truth-eval truth env numvars)))

    Theorem: truth-eval-nat-equiv-congruence-on-env

    (defthm truth-eval-nat-equiv-congruence-on-env
            (implies (nat-equiv env env-equiv)
                     (equal (truth-eval truth env numvars)
                            (truth-eval truth env-equiv numvars)))
            :rule-classes :congruence)

    Theorem: truth-eval-of-nfix-numvars

    (defthm truth-eval-of-nfix-numvars
            (equal (truth-eval truth env (nfix numvars))
                   (truth-eval truth env numvars)))

    Theorem: truth-eval-nat-equiv-congruence-on-numvars

    (defthm truth-eval-nat-equiv-congruence-on-numvars
            (implies (nat-equiv numvars numvars-equiv)
                     (equal (truth-eval truth env numvars)
                            (truth-eval truth env numvars-equiv)))
            :rule-classes :congruence)