• Top
    • Documentation
    • Books
    • Boolean-reasoning
      • Ipasir
      • Aignet
      • Aig
      • Satlink
      • Truth
      • Ubdds
      • Bdd
      • Faig
      • Bed
      • 4v
        • 4v-sexprs
        • 4v-monotonicity
        • 4v-operations
        • Why-4v-logic
        • 4v-<=
        • 4vp
        • 4vcases
        • 4v-fix
        • 4v-lookup
      • Projects
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Math
      • Testing-utilities
    • 4v

    4v-lookup

    Alist lookup that automatically 4v-fixes its result.

    BOZO this is a convenient operation for ...

    Definitions and Theorems

    Function: 4v-lookup

    (defun 4v-lookup (k env)
      (declare (xargs :guard t))
      (mbe :logic
           (let ((look (hons-get k env)))
             (if look (4v-fix (cdr look)) (4vx)))
           :exec
           (let ((look (hons-get k env)))
             (prog2$ (and (not look) (4v-lookup-not-found k))
                     (4v-fix (cdr look))))))

    Theorem: 4vp-of-4v-lookup

    (defthm 4vp-of-4v-lookup
      (4vp (4v-lookup k env)))

    Theorem: 4v-fix-4v-lookup

    (defthm 4v-fix-4v-lookup
      (equal (4v-fix (4v-lookup k env))
             (4v-lookup k env)))