• Top
    • Documentation
    • Books
    • Boolean-reasoning
    • Projects
    • Debugging
    • Std
    • Proof-automation
    • Macro-libraries
    • ACL2
    • Interfacing-tools
    • Hardware-verification
      • Gl
      • Esim
      • Vl2014
      • Sv
        • Svex-stvs
          • Svtv-data
          • Defsvtv$
          • Svtv-run
          • Defsvtv-phasewise
          • Svtv
          • Svtv-spec
          • Defsvtv
          • Process.lisp
            • Svtv-compile
            • Defsvtv-events
            • Svtv-compile-lazy
            • Svtv-compile-phase
            • Svtv-compile-phases-lazy
            • Svtv-allphases-inputs
            • Svtv-phase-inputs
            • Svtv-inalist-resolve-unassigned
            • Svtv-simplify-outs/states
            • Svtv-collect-inmap
            • Svar-boolmasks-limit-to-bound-vars
            • Svtv-overrides->assigns
            • Svtv-non-override-test-input-vars
            • Svtv-outputs->outalist
            • Svtv-run-squash-dontcares
            • Svtv-inputs->assigns
            • Svtv-phase-var-assigns
            • Defsvtv-fn
            • Svtv-entries->overrideconds
            • Svtv-entries->vars
            • Svtv-easy-bindings-main
            • Svtv-collect-masks
            • Svtv-baseentry-svex
            • Svtv-init-states
            • Lhs->mask
              • Svtv-easy-bindings-svtv-vars
              • Svtv-autoins-aux
              • Svtv-autohyps-aux
              • Svtv-autobinds-aux
              • Svtv-autoins
              • Svtv-autohyps
              • Svtv-autobinds
              • Fast-alist-free-list
              • Defsvtv-default-names
            • Svtv-doc
            • Svtv-chase$
            • Svtv-versus-stv
            • Svtv-debug-fsm
            • Structure.lisp
            • Svtv-debug
            • Def-pipeline-thm
            • Expand.lisp
            • Def-cycle-thm
            • Svtv-utilities
            • Svtv-debug$
            • Defsvtv$-phasewise
          • Svex-decomposition-methodology
          • Sv-versus-esim
          • Svex-decomp
          • Svex-compose-dfs
          • Svex-compilation
          • Moddb
          • Svmods
          • Svstmt
          • Sv-tutorial
          • Expressions
          • Symbolic-test-vector
          • Vl-to-svex
        • Fgl
        • Vwsim
        • Vl
        • X86isa
        • Svl
        • Rtl
      • Software-verification
      • Math
      • Testing-utilities
    • Process.lisp

    Lhs->mask

    Signature
    (lhs->mask x) → mask
    Arguments
    x — Guard (lhs-p x).
    Returns
    mask — Type (natp mask).

    Definitions and Theorems

    Function: lhs->mask

    (defun lhs->mask (x)
      (declare (xargs :guard (lhs-p x)))
      (let ((__function__ 'lhs->mask))
        (declare (ignorable __function__))
        (b* (((when (atom x)) 0)
             ((lhrange xf) (car x))
             (rest (ash (lhs->mask (cdr x)) xf.w))
             ((when (eq (lhatom-kind xf.atom) :z))
              rest))
          (logior (lognot (ash -1 xf.w)) rest))))

    Theorem: natp-of-lhs->mask

    (defthm natp-of-lhs->mask
      (b* ((mask (lhs->mask x))) (natp mask))
      :rule-classes :type-prescription)

    Theorem: lhs->mask-of-lhs-fix-x

    (defthm lhs->mask-of-lhs-fix-x
      (equal (lhs->mask (lhs-fix x))
             (lhs->mask x)))

    Theorem: lhs->mask-lhs-equiv-congruence-on-x

    (defthm lhs->mask-lhs-equiv-congruence-on-x
      (implies (lhs-equiv x x-equiv)
               (equal (lhs->mask x)
                      (lhs->mask x-equiv)))
      :rule-classes :congruence)