=========== PN-matrices =========== Given a propositional signature :math:`\Sigma`, a PN-matrix over :math:`\Sigma` is a structure :math:`\mathbb{M} = \langle \mathbf{M}, \{D_i\}_{i \in I} \rangle`, where :math:`\mathbf{M}` is a multi-algebra over :math:`\Sigma` and :math:`D_i \subseteq M` is called a *distinguished set*, for each :math:`i \in I`. In *ct4l*, we represent finite PN-matrices using the class :cpp:class:`ct4l::PNMatrix`, which holds a pointer to a :cpp:class:`ct4l::MultiAlgebra` object and a vector of subsets of the carrier of the multi-algebra. We also store internally the translation of such subsets to the domain values. When building a PN-matrix, you may specify whether you want the constructor to compute the complements of each distinguished set and store it as a distinguished set too. For example, if the carrier of the algebra is :math:`\{0,1\}` and you opt for this, then passing a vector having only the set :math:`\{1\}` will produce a PN-matrix with :math:`D_1 = \{1\}` and :math:`D_2 = \{0\}`. If the carrier of the algebra is :math:`\{0, 1, 2, 3\}` and you give to the constructor a vector with sets :math:`\{0, 1\}` and :math:`\{0\}`, then, internally, this vector will have four sets, in this sequence: :math:`\{0, 1\}, \{2, 3\}, \{0\}, \{1, 2, 3\}`. This is intended to help when we work with some notions of entailment associated to a PN-matrix. Check :cpp:func:`ct4l::PNMatrix::PNMatrix()` to see how to disable this option. .. note:: Notice that the notion of PN-matrix we are using is a generalization of the usual one, which accepts only a single designated set. By taking a family, as we implemented, we can work more easily with many different notions of entailment, including two-dimensional (and :math:`n`-dimensional) notions. Example: Classical Logic matrix --------------------------------------- Take the boolean algebra built in :ref:`boolean algebra example` and assume we have a pointer to it stored in the variable `algebra`. The code below creates a PN-matrix based on such algebra: .. code-block:: ct4l::PNMatrix matrix {algebra, {{"T"}}}; API --- .. doxygenclass:: ct4l::PNMatrix :members: