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

View file

@ -1,24 +0,0 @@
import hypothesis.strategies as st
from hypothesis_cfg import ContextFreeGrammarStrategy
import stl
GRAMMAR = {
'phi': (
('Unary', 'phi'),
('(', 'phi', 'Binary', 'phi', ')'),
('AP', ), ('0', ), ('1', )
),
'Unary': (('~', ), ('G', 'Interval'), ('F', 'Interval'), ('X', )),
'Interval': (('', ), ('[1, 3]', )),
'Binary': (
(' | ', ), (' & ', ), (' -> ', ), (' <-> ',), (' ^ ',),
(' U ',),
),
'AP': (('ap1', ), ('ap2', ), ('ap3', ), ('ap4', ), ('ap5', )),
}
SignalTemporalLogicStrategy = st.builds(
lambda term: stl.parse(''.join(term)),
ContextFreeGrammarStrategy(GRAMMAR, max_length=14, start='phi')
)