3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-24 05:08:55 +00:00

add anf and aig simplifier modules, cut-set enumeration, aig_finder, hoist out xor_finder from ba_solver

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-01-04 13:28:15 -08:00
parent 12e727e49a
commit d27a949ae9
15 changed files with 545 additions and 142 deletions

52
src/sat/sat_aig_finder.h Normal file
View file

@ -0,0 +1,52 @@
/*++
Copyright (c) 2020 Microsoft Corporation
Module Name:
sat_aig_finder.h
Abstract:
extract AIG definitions from clauses.
An example AIG clause is:
head \/ l1 \/ l2
such that
~l1 /\ ~l2 => head
head => ~l1, head => ~l2
Author:
Nikolaj Bjorner 2020-01-02
Notes:
AIG finder
--*/
#pragma once;
#include "util/params.h"
#include "util/statistics.h"
#include "sat/sat_clause.h"
#include "sat/sat_types.h"
#include "sat/sat_solver.h"
#include "sat/sat_big.h"
namespace sat {
class aig_finder {
solver& s;
big m_big;
literal_vector m_ands;
std::function<void (literal head, literal_vector const& ands, clause& orig)> m_aig_def;
bool implies(literal a, literal b);
bool find_aig(clause& c);
bool find_if(clause& c);
public:
aig_finder(solver& s) : s(s), m_big(s.rand()) {}
~aig_finder() {}
void set(std::function<void (literal head, literal_vector const& ands, clause& orig)>& f) { m_aig_def = f; }
void operator()(clause_vector const& clauses);
};
}