• Top
    • Documentation
    • Books
    • Recursion-and-induction
    • Boolean-reasoning
      • Ipasir
      • Aignet
      • Aig
      • Satlink
      • Truth
      • Ubdds
      • Bdd
      • Faig
        • Faig-constructors
        • Faig-onoff-equiv
        • Faig-purebool-p
          • Faig-purebool-check
          • Faig-purebool-list-p
            • Faig-purebool-list-p-basics
            • Faig-purebool-list-check
              • Faig-purebool-list-aig
            • Faig-purebool-aig
          • Faig-alist-equiv
          • Faig-equiv
          • Faig-eval
          • Faig-restrict
          • Faig-fix
          • Faig-partial-eval
          • Faig-compose
          • Faig-compose-alist
          • Patbind-faig
          • Faig-constants
        • Bed
        • 4v
      • Debugging
      • Projects
      • Std
      • Proof-automation
      • Macro-libraries
      • ACL2
      • Interfacing-tools
      • Hardware-verification
      • Software-verification
      • Testing-utilities
      • Math
    • Faig-purebool-list-p

    Faig-purebool-list-check

    An executable version of faig-purebool-list-p using SAT.

    Signature
    (faig-purebool-list-check x &key 
                              (config 'satlink::*default-config*)) 
     
      → 
    (mv fail purebool-list alist)
    Arguments
    x — The FAIG List to check.
    config — Guard (satlink::config-p config).
    Returns
    fail — If true, calling the SAT solver failed and the other answers are meaningless.
        Type (booleanp fail).
    purebool-list — Do these FAIGs always evaluate to purely Boolean?.
        Type (booleanp purebool-list).
    alist — When these FAIGs are not purely Boolean: an example environment for faig-eval-list that drives some FAIG to X or Z.

    Definitions and Theorems

    Function: faig-purebool-list-check-fn

    (defun faig-purebool-list-check-fn (x config)
      (declare (xargs :guard (satlink::config-p config)))
      (let ((__function__ 'faig-purebool-list-check))
        (declare (ignorable __function__))
        (b* ((aig (faig-purebool-list-aig x))
             ((mv status alist)
              (aig-sat (aig-not aig) :config config))
             ((when (eq status :sat))
              (mv nil nil alist))
             ((when (eq status :unsat))
              (mv nil t nil)))
          (mv t nil nil))))

    Theorem: booleanp-of-faig-purebool-list-check.fail

    (defthm booleanp-of-faig-purebool-list-check.fail
      (b* (((mv ?fail ?purebool-list ?alist)
            (faig-purebool-list-check-fn x config)))
        (booleanp fail))
      :rule-classes :type-prescription)

    Theorem: booleanp-of-faig-purebool-list-check.purebool-list

    (defthm booleanp-of-faig-purebool-list-check.purebool-list
      (b* (((mv ?fail ?purebool-list ?alist)
            (faig-purebool-list-check-fn x config)))
        (booleanp purebool-list))
      :rule-classes :type-prescription)

    Theorem: faig-purebool-list-check-correct

    (defthm faig-purebool-list-check-correct
      (b* (((mv fail purebool-list ?alist)
            (faig-purebool-list-check x
                                      :config config)))
        (implies (not fail)
                 (equal purebool-list
                        (faig-purebool-list-p x)))))