def test_GRSpec(): f = GRSpec(env_vars={'a'}, sys_vars={'b'}, env_init=['!a'], sys_init=['!b'], env_safety=['a -> X !a', '!a -> X a'], sys_prog=['a && b']) M = lily.synthesize(f) assert M is not None
#!/usr/bin/env python from __future__ import print_function from tulip.spec.form import LTL from tulip.interfaces import lily f = LTL('([]<>(!a)) -> ([](a -> <> b) && [](a -> !X b))', input_variables={'a': 'boolean'}, output_variables={'b': 'boolean'}) # Try appending # # && [](!b -> !X b) # # to the above LTL formula. The result will not be realizable. M = lily.synthesize(f) if M is not None: print(M) else: print('Not realizable.')
def check_realizable(f, expected): M = lily.synthesize(f) if expected: assert M is not None else: assert M is None
def test_nonbool(): f = LTL('[](a -> <>b)', input_variables={'a': (0,1)}, output_variables={'b': 'boolean'}) M = lily.synthesize(f)
def test_nonbool(): f = LTL('[](a -> <>b)', input_variables={'a': (0, 1)}, output_variables={'b': 'boolean'}) M = lily.synthesize(f)