parity: add spot::parity_product_or()

parity_product_or constructs the sum of two parity automata and it keeps
the parity.

* spot/twaalgos/parity.cc, spot/twaalgos/parity.hh: Here.
* tests/core/parity.cc: Add tests here.
This commit is contained in:
Laurent XU 2016-07-04 19:22:47 +02:00
parent 192fb6c1e7
commit 7a11842613
3 changed files with 81 additions and 22 deletions

View file

@ -147,5 +147,22 @@ namespace spot
SPOT_API twa_graph_ptr
parity_product(const const_twa_graph_ptr& left,
const const_twa_graph_ptr& right);
/// \brief Construct a product performing the union of two automata
/// with parity acceptance and keeping their parity acceptance
///
/// This is based on an algorithm introduced by Olivier Carton (Theoretical
/// Computer Science 161, 1-2 (1996)). The output is a parity max even
/// automaton. The inputs must be automata with a parity acceptance, otherwise
/// an invalid_argument exception is thrown.
///
/// \param left the first automaton
///
/// \param right the second automaton
///
/// \result the sum which is a parity automaton
SPOT_API twa_graph_ptr
parity_product_or(const const_twa_graph_ptr& left,
const const_twa_graph_ptr& right);
/// @}
}