propogate api changes + repr regression
This commit is contained in:
parent
7438b1712b
commit
70d8ae7e9a
1 changed files with 7 additions and 4 deletions
11
stl.py
11
stl.py
|
|
@ -17,9 +17,12 @@ t_sym = Symbol('t', positive=True)
|
||||||
|
|
||||||
class LinEq(namedtuple("LinEquality", ["terms", "op", "const"])):
|
class LinEq(namedtuple("LinEquality", ["terms", "op", "const"])):
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
rep = "{lhs} {op} {c}"
|
n = len(self.terms)
|
||||||
lhs = sum(t.id for t in self.terms)
|
rep = "{}"
|
||||||
return rep.format(lhs=lhs, op=self.op, c=self.const)
|
if n > 1:
|
||||||
|
rep += " + {}"*(n - 1)
|
||||||
|
rep += " {op} {c}"
|
||||||
|
return rep.format(*self.terms, op=self.op, c=self.const)
|
||||||
|
|
||||||
def children(self):
|
def children(self):
|
||||||
return []
|
return []
|
||||||
|
|
@ -105,7 +108,7 @@ def time_lens(phi:"STL") -> lens:
|
||||||
|
|
||||||
def _time_lens(phi):
|
def _time_lens(phi):
|
||||||
if isinstance(phi, LinEq):
|
if isinstance(phi, LinEq):
|
||||||
return lens().terms.each_().var.time
|
return lens().terms.each_().time
|
||||||
|
|
||||||
if isinstance(phi, NaryOpSTL):
|
if isinstance(phi, NaryOpSTL):
|
||||||
child_lens = [lens()[i].add_lens(_time_lens(c)) for i, c
|
child_lens = [lens()[i].add_lens(_time_lens(c)) for i, c
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue