Condition
Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.
Condition
class ConditionA deferred relation or logical combination consumed by Transformers, matching, and solve.
Methods
| Name | Description |
|---|---|
__and__ |
Create a condition that is the logical and operation between two conditions (i.e., both should hold). |
__bool__ |
Return known truth; raise TypeError when truth is undecidable. |
__invert__ |
Create a condition that takes the logical ‘not’ of the current condition. |
__or__ |
Create a condition that is the logical ‘or’ operation between two conditions (i.e., at least one of the two should hold). |
__repr__ |
|
__str__ |
|
_repr_html_ |
|
eval |
Evaluate, returning None for undecidable truth |
to_req |
Convert the condition to a pattern restriction. |
__and__
Condition.__and__(other: Condition) -> ConditionCreate a condition that is the logical and operation between two conditions (i.e., both should hold).
Parameters
other(Condition) The other operand to combine or compare with.
__bool__
Condition.__bool__() -> boolReturn known truth; raise TypeError when truth is undecidable.
__invert__
Condition.__invert__() -> ConditionCreate a condition that takes the logical ‘not’ of the current condition.
__or__
Condition.__or__(other: Condition) -> ConditionCreate a condition that is the logical ‘or’ operation between two conditions (i.e., at least one of the two should hold).
Parameters
other(Condition) The other operand to combine or compare with.
__repr__
Condition.__repr__() -> str__str__
Condition.__str__() -> str_repr_html_
Condition._repr_html_() -> streval
Condition.eval() -> bool | NoneEvaluate, returning None for undecidable truth. Unbound Transformers need an execution input.
to_req
Condition.to_req() -> PatternRestrictionConvert the condition to a pattern restriction.