yapf + pylint + add style checks to tests
This commit is contained in:
parent
d52fffe826
commit
a1ca4c6579
18 changed files with 130 additions and 299 deletions
|
|
@ -1,23 +1,23 @@
|
|||
from hypothesis_cfg import ContextFreeGrammarStrategy
|
||||
|
||||
import hypothesis.strategies as st
|
||||
from hypothesis.searchstrategy.strategies import SearchStrategy
|
||||
from hypothesis_cfg import ContextFreeGrammarStrategy
|
||||
|
||||
import stl
|
||||
|
||||
|
||||
GRAMMAR = {
|
||||
'phi': (('Unary', '(', 'phi', ')'),
|
||||
('(', 'phi', ')', 'Binary', '(', 'phi', ')'),
|
||||
('AP',)),
|
||||
'Unary': (('~',), ('G',), ('F',), ('X',)),
|
||||
'Binary': ((' | ',), (' & ',), (' U ',)),
|
||||
'AP': (('AP1',), ('AP2',), ('AP3',), ('AP4',), ('AP5',)),
|
||||
'phi': (('Unary', '(', 'phi', ')'), ('(', 'phi', ')', 'Binary', '(', 'phi',
|
||||
')'), ('AP', )),
|
||||
'Unary': (('~', ), ('G', ), ('F', ), ('X', )),
|
||||
'Binary': ((' | ', ), (' & ', ), (' U ', )),
|
||||
'AP': (('AP1', ), ('AP2', ), ('AP3', ), ('AP4', ), ('AP5', )),
|
||||
}
|
||||
|
||||
|
||||
def to_stl(term):
|
||||
return stl.parse(''.join(term))
|
||||
|
||||
SignalTemporalLogicStrategy = st.builds(
|
||||
to_stl, ContextFreeGrammarStrategy(
|
||||
GRAMMAR, max_length=25, start='phi'))
|
||||
|
||||
SignalTemporalLogicStrategy = st.builds(to_stl,
|
||||
ContextFreeGrammarStrategy(
|
||||
GRAMMAR,
|
||||
max_length=25,
|
||||
start='phi'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue