continue refactoring to optimize for mtl

This commit is contained in:
Marcell Vazquez-Chanlatte 2018-09-06 11:09:01 -07:00
parent 5fd66cfd2c
commit 98824c9ba1
21 changed files with 393 additions and 467 deletions

22
mtl/test_parser.py Normal file
View file

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
from hypothesis import event, given
import mtl
from mtl.hypothesis import MetricTemporalLogicStrategy
@given(MetricTemporalLogicStrategy)
def test_invertable_repr(phi):
event(str(phi))
assert str(phi) == str(mtl.parse(str(phi)))
@given(MetricTemporalLogicStrategy)
def test_hash_inheritance(phi):
assert hash(repr(phi)) == hash(phi)
def test_sugar_smoke():
mtl.parse('(x <-> x)')
mtl.parse('(x -> x)')
mtl.parse('(x ^ x)')