Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d09b1ec
AllowModify in cnf_view
lee30sonia Mar 25, 2020
2e81966
default constructors in bill
lee30sonia Mar 25, 2020
fd27853
restructure classes
lee30sonia Mar 25, 2020
51bfeba
constructor with existing network; adding unit clause for constant node
lee30sonia Mar 25, 2020
cc9d3e5
updates according to comments
lee30sonia Mar 25, 2020
120e3a0
add test cases
lee30sonia Mar 26, 2020
a65799e
Merge remote-tracking branch 'upstream/master'
lee30sonia Mar 27, 2020
3a55467
get lit for node and add_var with AllowModify
lee30sonia Mar 27, 2020
6ce8e70
Merge remote-tracking branch 'upstream/master'
lee30sonia Apr 6, 2020
cff6805
Merge remote-tracking branch 'upstream/master'
lee30sonia Apr 7, 2020
23a39b0
Merge remote-tracking branch 'upstream/master'
lee30sonia Apr 8, 2020
4d83133
fix merge error
lee30sonia Apr 8, 2020
c0abcbc
Merge remote-tracking branch 'upstream/master'
lee30sonia Apr 13, 2020
065c40e
Merge remote-tracking branch 'upstream/master'
lee30sonia Apr 22, 2020
ba4e473
validator - basic version
lee30sonia May 10, 2020
f41e1dc
Merge remote-tracking branch 'upstream/master'
lee30sonia May 10, 2020
b96c77d
Merge branch 'master' into validator
lee30sonia May 10, 2020
c9f9e63
avoid using lazy object initialization syntax
lee30sonia May 10, 2020
2301d6f
set random
lee30sonia May 11, 2020
b5ff832
clean code, support XOR
lee30sonia May 11, 2020
38067c0
bsat interface
lee30sonia May 11, 2020
73dd3af
validating const, considering ODC
lee30sonia May 18, 2020
a4ceb8a
consider timeout
lee30sonia May 18, 2020
fd06f3a
update restart()
lee30sonia May 18, 2020
95a9db8
bsat bookmark fix
lee30sonia May 20, 2020
87b58b9
use iterator
lee30sonia May 21, 2020
0843af8
supports MIG; compile without Z3 or bsat dependency
lee30sonia May 24, 2020
a6ebde8
fix error in assertion
lee30sonia May 24, 2020
b53b64a
port bill v0.1
lee30sonia Jun 2, 2020
e670eda
update function names of push/pop
lee30sonia Jun 2, 2020
911ea73
cleanup
lee30sonia Jun 2, 2020
f057e6f
validate interface with signal; remove !windows dependency of bsat2
lee30sonia Jun 2, 2020
7733be7
doc
lee30sonia Jun 3, 2020
bbacace
update doc
lee30sonia Jun 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 76 additions & 0 deletions docs/algorithms/circuit_validator.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
Functional equivalence of circuit nodes
---------------------------------------

**Header:** ``mockturtle/algorithms/circuit_validator.hpp``

**Example**

The following code shows how to check functional equivalence of a root node to signals existing in the network, or created with nodes within the network. If not, get the counter example.

.. code-block:: c++

/* derive some AIG (can be AIG, XAG, MIG, or XMG) */
aig_network aig;
auto const a = aig.create_pi();
auto const b = aig.create_pi();
auto const f1 = aig.create_and( !a, b );
auto const f2 = aig.create_and( a, !b );
auto const f3 = aig.create_or( f1, f2 );

circuit_validator v( aig );

auto result = v.validate( f1, f2 );
/* result is an optional, which is nullopt if SAT conflict limit was exceeded */
if ( result )
{
if ( *result )
{
std::cout << "f1 and f2 are functionally equivalent\n";
}
else
{
std::cout << "f1 and f2 have different values under PI assignment: " << v.cex[0] << v.cex[1] << "\n";
}
}

circuit_validator<aig_network>::gate::fanin fi1;
fi1.idx = 0; fi1.inv = true;
circuit_validator<aig_network>::gate::fanin fi2;
fi2.idx = 1; fi2.inv = true;
circuit_validator<aig_network>::gate g;
g.fanins = {fi1, fi2};
g.type = circuit_validator::gate_type::AND;

result = v.validate( f3, {aig.get_node( f1 ), aig.get_node( f2 )}, {g}, true );
if ( result && *result )
{
std::cout << "f3 is equivalent to NOT(NOT f1 AND NOT f2)\n";
}

**Parameters**

.. doxygenstruct:: mockturtle::validator_params
:members:

**Validate with existing signals**

.. doxygenfunction:: mockturtle::circuit_validator::validate( signal const&, signal const& )
.. doxygenfunction:: mockturtle::circuit_validator::validate( node const&, signal const& )
.. doxygenfunction:: mockturtle::circuit_validator::validate( signal const&, bool )
.. doxygenfunction:: mockturtle::circuit_validator::validate( node const&, bool )

**Validate with non-existing circuit**

.. doxygenstruct:: mockturtle::circuit_validator::gate
:members: fanins, type
.. doxygenstruct:: mockturtle::circuit_validator::gate::fanin
:members: idx, inv

.. doxygenfunction:: mockturtle::circuit_validator::validate( signal const&, std::vector<node> const&, std::vector<gate> const&, bool )
.. doxygenfunction:: mockturtle::circuit_validator::validate( node const&, std::vector<node> const&, std::vector<gate> const&, bool )
.. doxygenfunction:: mockturtle::circuit_validator::validate( signal const&, iterator_type, iterator_type, std::vector<gate> const&, bool )
.. doxygenfunction:: mockturtle::circuit_validator::validate( node const&, iterator_type, iterator_type, std::vector<gate> const&, bool )

**Updating**
.. doxygenfunction:: mockturtle::circuit_validator::add_node
.. doxygenfunction:: mockturtle::circuit_validator::update
3 changes: 2 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ v0.2 (not yet released)
- Davio decomposition (`positive_davio_decomposition`, `positive_davio_decomposition`) `#308 <https://github.com/lsils/mockturtle/pull/308>`_
- Collapse network into single node per output network `#309 <https://github.com/lsils/mockturtle/pull/309>`_
- Generic balancing algorithm `#340 <https://github.com/lsils/mockturtle/pull/340>`_
- Check functional equivalence (`circuit_validator`) `#346 <https://github.com/lsils/mockturtle/pull/346>`_
* Views:
- Assign names to signals and outputs (`names_view`) `#181 <https://github.com/lsils/mockturtle/pull/181>`_ `#184 <https://github.com/lsils/mockturtle/pull/184>`_
- Creates a CNF while creating a network (`cnf_view`) `#181 <https://github.com/lsils/mockturtle/pull/274>`_ `#184 <https://github.com/lsils/mockturtle/pull/274>`_
- Creates a CNF while creating a network (`cnf_view`) `#274 <https://github.com/lsils/mockturtle/pull/274>`_
* I/O:
- Write networks to DIMACS files for CNF (`write_dimacs`) `#146 <https://github.com/lsils/mockturtle/pull/146>`_
- Read BLIF files using *lorina* (`blif_reader`) `#167 <https://github.com/lsils/mockturtle/pull/167>`_
Expand Down
Loading