Virtual Miter

Header: fiction/verification/virtual_miter.hpp

template<typename NtkDest, typename NtkSrc1, typename NtkSrc2>
std::optional<NtkDest> fiction::verification::virtual_miter(const NtkSrc1 &ntk1_in, const NtkSrc2 &ntk2_in) noexcept

Combines two networks into a combinational miter, similar to mockturtle::miter. Either input network may include virtual primary inputs (PIs). Virtual PIs are removed during miter construction, and all edges connected to them are remapped to their corresponding original PIs, ensuring consistent PI counts when the networks are equivalent.

The resulting miter connects two networks with the same number of inputs and produces a single primary output. This output represents the OR of the XORs of all primary output pairs. Thus, the miter outputs 1 for any input assignment where the primary outputs of the two networks differ.

The input networks may have different types. If the two input networks have mismatched numbers of primary inputs or outputs, the method returns std::nullopt.

Template Parameters:
  • NtkDest – The type of the resulting network.

  • NtkSource1 – The type of the first input network.

  • NtkSource2 – The type of the second input network.

Parameters:
  • ntk1_in – The first input network.

  • ntk2_in – The second input network.

Returns:

An optional containing the virtual miter network if successful, or std::nullopt if the networks are incompatible.