Helper class for propositional logic.
For simplicity, the logic is not general, but operates directly on lists of features
(see \FeaturePhp\Model\Feature and \FeaturePhp\Model\ConstraintSolver).
A formula is expressed by nested calls to the connectives, e.g.
Logic::equiv(Logic::is(...), Logic::is(...))
.
Every formula (a feature constraint) is a closure expecting a variable assignment
(a list of features).
This way a complex formula can be built, stored and later evaluated for a given
variable assignment.
package | Default |
---|
_and() : callable
Formulas can be supplied variadically.
callable
_or() : callable
Formulas can be supplied variadically.
callable
equiv(callable $constraintA, callable $constraintB) : callable
callable
callable
callable
implies(callable $constraintA, callable $constraintB) : callable
callable
callable
callable
is(\FeaturePhp\Helper\Feature $feature) : callable
\FeaturePhp\Helper\Feature
callable
not(callable $constraint) : callable
callable
callable