(ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats) → (mv status new-sat-lits new-ipasir new-fraig-stats)
Function:
(defun ipasir-check-aignet-equivalence (lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats) (declare (xargs :stobjs (aignet aignet-refcounts sat-lits ipasir fraig-stats))) (declare (xargs :guard (and (litp lit1) (litp lit2) (fraig-config-p config)))) (declare (xargs :guard (and (fanin-litp lit1 aignet) (fanin-litp lit2 aignet) (sat-lits-wfp sat-lits aignet) (< (lit-id lit1) (u32-length aignet-refcounts)) (< (lit-id lit2) (u32-length aignet-refcounts)) (non-exec (and (not (eq (ipasir$a->status ipasir) :undef)) (not (ipasir$a->new-clause ipasir)) (not (ipasir$a->assumption ipasir))))))) (let ((__function__ 'ipasir-check-aignet-equivalence)) (declare (ignorable __function__)) (b* ((lit1 (lit-fix lit1)) (lit2 (lit-fix lit2)) ((mv sat-lits ipasir fraig-stats) (ipasir-maybe-recycle config sat-lits ipasir fraig-stats)) ((mv sat-lits ipasir) (aignet-lit->ipasir lit1 t aignet-refcounts sat-lits aignet ipasir)) ((mv sat-lits ipasir) (aignet-lit->ipasir lit2 t aignet-refcounts sat-lits aignet ipasir)) (sat-lit1 (aignet-lit->sat-lit lit1 sat-lits)) (sat-lit2 (aignet-lit->sat-lit lit2 sat-lits)) ((mv status ipasir) (ipasir-check-equivalence ipasir sat-lit1 sat-lit2)) (fraig-stats (fraig-stats-count-sat-call status fraig-stats))) (mv status sat-lits ipasir fraig-stats))))
Theorem:
(defthm return-type-of-ipasir-check-aignet-equivalence.status (b* (((mv ?status ?new-sat-lits ?new-ipasir ?new-fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats))) (or (equal status :failed) (equal status :unsat) (equal status :sat))) :rule-classes ((:forward-chaining :trigger-terms ((mv-nth 0 (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats))))))
Theorem:
(defthm ipasir-check-aignet-equivalence-ipasir-status (b* (((mv ?status ?new-sat-lits ?new-ipasir ?new-fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats))) (equal (ipasir$a->status new-ipasir) (case status (:sat :sat) (:unsat :unsat) (otherwise :input)))))
Theorem:
(defthm ipasir-check-aignet-equivalence-new-clause (b* (((mv ?status ?new-sat-lits ?new-ipasir ?new-fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats))) (equal (ipasir$a->new-clause new-ipasir) nil)))
Theorem:
(defthm ipasir-check-aignet-equivalence-assumption (b* (((mv ?status ?new-sat-lits ?new-ipasir ?new-fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats))) (equal (ipasir$a->assumption new-ipasir) nil)))
Theorem:
(defthm sat-lits-wfp-of-ipasir-check-aignet-equivalence (b* (((mv ?status ?new-sat-lits ?new-ipasir ?new-fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats))) (implies (and (sat-lits-wfp sat-lits aignet)) (sat-lits-wfp new-sat-lits aignet))))
Theorem:
(defthm ipasir-formula-wfp-of-ipasir-check-aignet-equivalence (b* (((mv ?status ?new-sat-lits ?new-ipasir ?new-fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats))) (implies (and (sat-lits-wfp sat-lits aignet) (aignet-litp lit1 aignet) (aignet-litp lit2 aignet) (sat-lit-list-listp (ipasir$a->formula ipasir) sat-lits)) (sat-lit-list-listp (ipasir$a->formula new-ipasir) new-sat-lits))))
Theorem:
(defthm cnf-for-aignet-of-ipasir-check-aignet-equivalence (b* (((mv ?status ?new-sat-lits ?new-ipasir ?new-fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats))) (implies (and (cnf-for-aignet aignet (ipasir$a->formula ipasir) sat-lits) (sat-lits-wfp sat-lits aignet) (aignet-litp lit1 aignet) (aignet-litp lit2 aignet) (sat-lit-list-listp (ipasir$a->formula ipasir) sat-lits)) (cnf-for-aignet aignet (ipasir$a->formula new-ipasir) new-sat-lits))))
Theorem:
(defthm ipasir-check-aignet-equivalence-unsat (b* (((mv ?status ?new-sat-lits ?new-ipasir ?new-fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats))) (implies (and (cnf-for-aignet aignet (ipasir$a->formula ipasir) sat-lits) (sat-lits-wfp sat-lits aignet) (aignet-litp lit1 aignet) (aignet-litp lit2 aignet) (sat-lit-list-listp (ipasir$a->formula ipasir) sat-lits)) (equal (equal status :unsat) (and (hide (equal status :unsat)) (aignet-lits-comb-equivalent lit1 aignet lit2 aignet))))))
Theorem:
(defthm ipasir-check-aignet-equivalence-lit1-has-sat-vars (b* (((mv ?status ?new-sat-lits ?new-ipasir ?new-fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats))) (implies (and (sat-lits-wfp sat-lits aignet) (equal id (lit-id lit1)) (aignet-litp lit1 aignet)) (aignet-id-has-sat-var id new-sat-lits))))
Theorem:
(defthm ipasir-check-aignet-equivalence-lit2-has-sat-vars (b* (((mv ?status ?new-sat-lits ?new-ipasir ?new-fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats))) (implies (and (sat-lits-wfp sat-lits aignet) (equal id (lit-id lit2)) (aignet-litp lit2 aignet)) (aignet-id-has-sat-var id new-sat-lits))))
Theorem:
(defthm ipasir-check-aignet-equivalence-of-lit-fix-lit1 (equal (ipasir-check-aignet-equivalence (lit-fix lit1) lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats)))
Theorem:
(defthm ipasir-check-aignet-equivalence-lit-equiv-congruence-on-lit1 (implies (lit-equiv lit1 lit1-equiv) (equal (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats) (ipasir-check-aignet-equivalence lit1-equiv lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats))) :rule-classes :congruence)
Theorem:
(defthm ipasir-check-aignet-equivalence-of-lit-fix-lit2 (equal (ipasir-check-aignet-equivalence lit1 (lit-fix lit2) config aignet aignet-refcounts sat-lits ipasir fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats)))
Theorem:
(defthm ipasir-check-aignet-equivalence-lit-equiv-congruence-on-lit2 (implies (lit-equiv lit2 lit2-equiv) (equal (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2-equiv config aignet aignet-refcounts sat-lits ipasir fraig-stats))) :rule-classes :congruence)
Theorem:
(defthm ipasir-check-aignet-equivalence-of-fraig-config-fix-config (equal (ipasir-check-aignet-equivalence lit1 lit2 (fraig-config-fix config) aignet aignet-refcounts sat-lits ipasir fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats)))
Theorem:
(defthm ipasir-check-aignet-equivalence-fraig-config-equiv-congruence-on-config (implies (fraig-config-equiv config config-equiv) (equal (ipasir-check-aignet-equivalence lit1 lit2 config aignet aignet-refcounts sat-lits ipasir fraig-stats) (ipasir-check-aignet-equivalence lit1 lit2 config-equiv aignet aignet-refcounts sat-lits ipasir fraig-stats))) :rule-classes :congruence)