Check satisfiability of a literal, and minimize the satisfying assignment if satisfiable.
(aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state) → (mv status sat-invals sat-regvals sat-inmasks sat-regmasks new-state)
Function:
(defun aignet-lits-ipasir-sat-minimize (x invals regvals inmasks regmasks aignet state) (declare (xargs :stobjs (invals regvals inmasks regmasks aignet state))) (declare (xargs :guard (lit-listp x))) (declare (xargs :guard (aignet-lit-listp x aignet))) (let ((__function__ 'aignet-lits-ipasir-sat-minimize)) (declare (ignorable __function__)) (b* (((local-stobjs vals mark) (mv vals mark status invals regvals inmasks regmasks state)) ((mv status invals regvals vals state) (aignet-lits-ipasir-sat-check x invals regvals vals aignet state)) (inmasks (resize-bits 0 inmasks)) (inmasks (resize-bits (num-ins aignet) inmasks)) (regmasks (resize-bits 0 regmasks)) (regmasks (resize-bits (num-regs aignet) regmasks)) ((unless (eql status :sat)) (mv vals mark status invals regvals inmasks regmasks state)) (mark (resize-bits (+ 1 (lits-max-id-val x)) mark)) ((mv inmasks regmasks mark state) (aignet-vals-sat-care-masks-lits x inmasks regmasks invals regvals vals mark aignet state))) (mv vals mark :sat invals regvals inmasks regmasks state))))
Theorem:
(defthm return-type-of-aignet-lits-ipasir-sat-minimize.status (b* (((mv ?status ?sat-invals ?sat-regvals ?sat-inmasks ?sat-regmasks ?new-state) (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state))) (or (equal status :failed) (equal status :unsat) (equal status :sat))) :rule-classes ((:forward-chaining :trigger-terms ((mv-nth 0 (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state))))))
Theorem:
(defthm return-type-of-aignet-lits-ipasir-sat-minimize.sat-invals (b* (((mv ?status ?sat-invals ?sat-regvals ?sat-inmasks ?sat-regmasks ?new-state) (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state))) (equal (len sat-invals) (num-ins aignet))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-aignet-lits-ipasir-sat-minimize.sat-regvals (b* (((mv ?status ?sat-invals ?sat-regvals ?sat-inmasks ?sat-regmasks ?new-state) (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state))) (equal (len sat-regvals) (num-regs aignet))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-aignet-lits-ipasir-sat-minimize.sat-inmasks (b* (((mv ?status ?sat-invals ?sat-regvals ?sat-inmasks ?sat-regmasks ?new-state) (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state))) (equal (len sat-inmasks) (num-ins aignet))) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-aignet-lits-ipasir-sat-minimize.sat-regmasks (b* (((mv ?status ?sat-invals ?sat-regvals ?sat-inmasks ?sat-regmasks ?new-state) (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state))) (equal (len sat-regmasks) (num-regs aignet))) :rule-classes :rewrite)
Theorem:
(defthm satisfying-assign-of-aignet-lits-ipasir-sat-minimize (b* (((mv ?status ?sat-invals ?sat-regvals ?sat-inmasks ?sat-regmasks ?new-state) (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state))) (implies (and (equal status :sat) (aignet-lit-listp x aignet) (vals-equiv-under-masks sat-inmasks sat-invals invals1) (vals-equiv-under-masks sat-regmasks sat-regvals regvals1)) (equal (aignet-eval-conjunction x invals1 regvals1 aignet) 1))))
Theorem:
(defthm satisfying-assign-of-aignet-lits-ipasir-sat-minimize-basic (b* (((mv ?status ?sat-invals ?sat-regvals ?sat-inmasks ?sat-regmasks ?new-state) (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state))) (implies (and (equal status :sat) (aignet-lit-listp x aignet)) (equal (aignet-eval-conjunction x sat-invals sat-regvals aignet) 1))))
Theorem:
(defthm aignet-lits-ipasir-sat-minimize-not-unsat-when-sat (b* (((mv ?status ?sat-invals ?sat-regvals ?sat-inmasks ?sat-regmasks ?new-state) (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state))) (implies (and (equal (aignet-eval-conjunction x some-invals some-regvals aignet) 1) (aignet-lit-listp x aignet)) (not (equal status :unsat)))))
Theorem:
(defthm w-state-of-aignet-lits-ipasir-sat-minimize (b* (((mv ?status ?sat-invals ?sat-regvals ?sat-inmasks ?sat-regmasks ?new-state) (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state))) (equal (w new-state) (w state))))
Theorem:
(defthm aignet-lits-ipasir-sat-minimize-of-lit-list-fix-x (equal (aignet-lits-ipasir-sat-minimize (lit-list-fix x) invals regvals inmasks regmasks aignet state) (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state)))
Theorem:
(defthm aignet-lits-ipasir-sat-minimize-lit-list-equiv-congruence-on-x (implies (satlink::lit-list-equiv x x-equiv) (equal (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state) (aignet-lits-ipasir-sat-minimize x-equiv invals regvals inmasks regmasks aignet state))) :rule-classes :congruence)
Theorem:
(defthm aignet-lits-ipasir-sat-minimize-of-node-list-fix-aignet (equal (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks (node-list-fix aignet) state) (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state)))
Theorem:
(defthm aignet-lits-ipasir-sat-minimize-node-list-equiv-congruence-on-aignet (implies (node-list-equiv aignet aignet-equiv) (equal (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet state) (aignet-lits-ipasir-sat-minimize x invals regvals inmasks regmasks aignet-equiv state))) :rule-classes :congruence)