• 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

    Ubddp

    Recognizer for well-formed ubdds.

    Note: memoized for efficiency.

    Definitions and Theorems

    Function: ubddp

    (defun
      ubddp (x)
      (declare (xargs :guard t))
      (mbe :logic (if (atom x)
                      (booleanp x)
                      (and (ubddp (car x))
                           (ubddp (cdr x))
                           (if (atom (car x))
                               (not (equal (car x) (cdr x)))
                               t)))
           :exec (cond ((eq x t) t)
                       ((eq x nil) t)
                       ((atom x) nil)
                       (t (let ((a (car x)) (d (cdr x)))
                               (cond ((eq a t)
                                      (cond ((eq d nil) t)
                                            ((eq d t) nil)
                                            (t (ubddp d))))
                                     ((eq a nil)
                                      (cond ((eq d nil) nil)
                                            ((eq d t) t)
                                            (t (ubddp d))))
                                     (t (and (ubddp a) (ubddp d)))))))))

    Function: ubddp-memoize-condition

    (defun ubddp-memoize-condition (x)
           (declare (ignorable x)
                    (xargs :guard 't))
           (consp x))

    Theorem: ubddp-compound-recognizer

    (defthm ubddp-compound-recognizer
            (implies (ubddp x)
                     (or (consp x) (booleanp x)))
            :rule-classes :compound-recognizer)