Propositional Logic (plog) system is an abstract data type defining logical relationships between variables in a combinatorial optimization manner.
:class:`puan.logic.plog.AtLeast` :
AtLeastis a compound proposition which takes propositions and represents a lower bound on the result of those propositions. For example, select at least one of x, y and z would be defined asAtLeast(propositions=["x","y","z"], value=1)and represented by the linear inequality x+y+z \ge 1.:class:`puan.logic.plog.AtMost` :
AtMostis a compound proposition which takes propositions and represents an upper bound on the result of those propositions. For example, select at most two of x, y and z would be defined asAtMost(propositions=["x","y","z"], value=2)and represented by the linear inequality -x-y-z \ge -2.:class:`puan.logic.plog.Equal` :
Equalis a compound proposition which takes propositions and represents an exact bound on the result of those propositions. For example, select propositions equal to two of x, y and z would be defined asEqual(propositions=["x","y","z"], value=2)and represented by the linear inequality x+y+z = -2.:class:`puan.logic.plog.All` :
Allis a compound proposition representing a conjunction of all given propositions.Allis represented by anAtLeastproposition with value set to the number of given propositions. For example,All("x","y","z")is equivalent toAtLeast(propositions=["x","y","z"], value=3).:class:`puan.logic.plog.Any` :
Anyis a compound proposition representing a disjunction of all given propositions.Anyis represented by anAtLeastproposition with value set to 1. For example,Any("x","y","z")is equivalent toAtLeast(propositions=["x","y","z"], value=1).:class:`puan.logic.plog.Imply` :
Implyis the implication logic operand and has two main inputs: condition and consequence. For example, if x is selected then y and z must be selected could be defined with theImplyclass asImply("x", All("y","z")).:class:`puan.logic.plog.Xor` :
Xoris restricting all propositions within to be selected exactly once. For example,Xor("x","y","z")means that one and exactly one of x, y and z must be selected.:class:`puan.logic.plog.XNor` :
XNoris a negatedXor. In the special case of two propositions, this is equivalent to the biconditional logical connective (<->).:class:`puan.logic.plog.Not` :
Notis negating a proposition. For example,Not(All("x","y","z"))means that x, y and z can never be selected all together and is equivalent toAtMost(propositions=["x","y","z"], value=2).
.. currentmodule:: puan.logic.plog
.. autoclass:: AtLeast :members: :undoc-members: :show-inheritance:
.. autoclass:: AtMost :members: :undoc-members: :show-inheritance:
.. autoclass:: Equal :members: :undoc-members: :show-inheritance:
.. autoclass:: All :members: :undoc-members: :show-inheritance:
.. autoclass:: Any :members: :undoc-members: :show-inheritance:
.. autoclass:: Imply :members: :undoc-members: :show-inheritance:
.. autoclass:: Xor :members: :undoc-members: :show-inheritance:
.. autoclass:: XNor :members: :undoc-members: :show-inheritance:
.. autoclass:: Not :members: :undoc-members: :show-inheritance:
.. autoclass:: PropositionValidationError :members: :undoc-members: :show-inheritance: