• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
      • Ipasir
      • Aignet
      • Aig
      • Satlink
      • Truth
      • Ubdds
        • Equal-by-eval-bdds
        • Ubdd-constructors
        • Eval-bdd
        • Ubddp
        • Ubdd-fix
        • Q-sat
          • Bdd-sat-dfs
          • Eval-bdd-list
          • Qcdr
          • Qcar
          • Q-sat-any
          • Canonicalize-to-q-ite
          • Ubdd-listp
          • Qcons
        • Bdd
        • Faig
        • Bed
        • 4v
      • Projects
      • Debugging
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Ubdds

    Q-sat

    (q-sat x) finds a satisfying assignment for the UBDD x, if one exists.

    Assuming x is a well-formed UBDD, the only time there isn't a satisfying assignment is when x represents the constant false function, i.e., when x is nil. In any other case it's easy to construct some list of values for which eval-bdd returns true.

    BOZO naming. This shouldn't start with q- since it's constructing a list of values instead of a UBDD.

    Definitions and Theorems

    Function: q-sat

    (defun q-sat (x)
           (declare (xargs :guard t))
           (if (atom x)
               nil
               (if (eq (cdr x) nil)
                   (cons t (q-sat (car x)))
                   (cons nil (q-sat (cdr x))))))

    Theorem: q-sat-correct

    (defthm q-sat-correct
            (implies (and (ubddp x) x)
                     (eval-bdd x (q-sat x))))