diff --git a/stl/ast.py b/stl/ast.py index 66d50fc..08ce551 100644 --- a/stl/ast.py +++ b/stl/ast.py @@ -30,9 +30,9 @@ class AST(object): -class AtomicPred(namedtuple("AP", ["id"]), AST): +class AtomicPred(namedtuple("AP", ["id", "time"]), AST): def __repr__(self): - return "{}".format(self.id) + return f"{self.id}[{self.time}]" def children(self): return [] diff --git a/stl/parser.py b/stl/parser.py index 37370ba..03490b5 100644 --- a/stl/parser.py +++ b/stl/parser.py @@ -157,7 +157,7 @@ class STLVisitor(NodeVisitor): return Number(1) if node.text == "+" else Number(-1) def visit_AP(self, node, _): - return ast.AtomicPred(node.text) + return ast.AtomicPred(node.text, ast.t_sym) def visit_neg(self, _, children): return ast.Neg(children[1])