python: allow spot.formula(spot.formula(...))
* python/spot/__init__.py: Recognize if the input is already a formula. * tests/python/formulas.ipynb: Test this.
This commit is contained in:
parent
3b4335d243
commit
31ccab026b
2 changed files with 71 additions and 38 deletions
|
|
@ -166,7 +166,10 @@ class twa:
|
|||
class formula:
|
||||
def __init__(self, str):
|
||||
"""Parse the given string to create a formula."""
|
||||
self.this = parse_formula(str)
|
||||
if type(str) == formula:
|
||||
self.this = str
|
||||
else:
|
||||
self.this = parse_formula(str)
|
||||
|
||||
def show_ast(self):
|
||||
"""Display the syntax tree of the formula."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue