Lines Matching refs:rhs
110 rhs: Union[int, float, Expression]):
113 self.rhs = _Constify(rhs)
118 rhs: bool = False) -> str:
142 if rhs and _PRECEDENCE.get(self.operator, -1) == _PRECEDENCE.get(
157 rhs = self.rhs.Simplify()
158 if isinstance(lhs, Constant) and isinstance(rhs, Constant):
159 return Constant(ast.literal_eval(lhs + self.operator + rhs))
163 return rhs
168 not isinstance(rhs, Event) or 'slots' not in rhs.name.lower()):
172 return rhs
174 if isinstance(rhs, Constant):
175 if self.operator in ('+', '|') and rhs.value == '0':
178 if self.operator == '*' and rhs.value == '0':
181 if self.operator == '*' and self.rhs.value == '1':
184 return Operator(self.operator, lhs, rhs)
189 other.lhs) and self.rhs.Equals(other.rhs)
196 rhs = None
197 if self.rhs:
198 rhs = self.rhs.Substitute(name, expression)
199 return Operator(self.operator, lhs, rhs)
255 rhs: Optional[Union[int, float, Expression]] = None):
258 self.rhs = _Constify(rhs)
261 if self.rhs:
266 if self.rhs:
272 rhs = self.rhs.Simplify() if self.rhs else None
273 if isinstance(lhs, Constant) and isinstance(rhs, Constant):
275 if rhs.value == '0':
280 return Function(self.fn, lhs, rhs)
285 if self.rhs:
286 result = result and self.rhs.Equals(other.rhs)
294 rhs = None
295 if self.rhs:
296 rhs = self.rhs.Substitute(name, expression)
297 return Function(self.fn, lhs, rhs)
378 def min(lhs: Union[int, float, Expression], rhs: Union[int, float,
382 return Function('min', lhs, rhs)
385 def max(lhs: Union[int, float, Expression], rhs: Union[int, float,
389 return Function('max', lhs, rhs)
393 rhs: Union[int, float, Expression]) -> Function:
396 return Function('d_ratio', lhs, rhs)