From 395c87cbe62046c61dd2d53c5ae41cba2ab3f583 Mon Sep 17 00:00:00 2001 From: Marcell Vazquez-Chanlatte Date: Thu, 12 Jan 2017 15:28:00 -0800 Subject: [PATCH] add time index to atomic predicates --- stl/ast.py | 4 ++-- stl/parser.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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])