Ejemplo n.º 1
0
    elif o == '-v':
        output = 5
    else:
        usage(prog)

if len(args) != 1:
    usage(prog)


cout = spot.get_cout()
cerr = spot.get_cerr()

e = spot.default_environment.instance()
p = spot.empty_parse_error_list()

f = spot.parse(args[0], p, e, debug_opt)
if spot.format_parse_errors(cerr, args[0], p):
    exit_code = 1

dict = spot.bdd_dict()

if f:
    if fm_opt:
        a = spot.ltl_to_tgba_fm(f, dict)
        concrete = 0
    else:
        a = concrete = spot.ltl_to_tgba_lacim(f, dict)
    f.destroy()
    del f

    degeneralized = None
Ejemplo n.º 2
0
#
# You should have received a copy of the GNU General Public License
# along with Spot; see the file COPYING.  If not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.

import sys
import spot

e = spot.default_environment.instance()
p = spot.empty_parse_error_list()

l = ['GFa', 'a U (((b)) xor c)', '!(FFx <=> Fx)', 'a \/ a \/ b \/ a \/ a']

for str1 in l:
    f = spot.parse(str1, p, e, 0)
    if spot.format_parse_errors(spot.get_cout(), str1, p):
        sys.exit(1)
    str2 = str(f)
    f.destroy()
    print str2
    # Try to reparse the stringified formula
    f = spot.parse(str2, p, e)
    if spot.format_parse_errors(spot.get_cout(), str2, p):
        sys.exit(1)
    print f
    f.destroy()

assert spot.atomic_prop.instance_count() == 0
assert spot.binop.instance_count() == 0
assert spot.unop.instance_count() == 0
Ejemplo n.º 3
0
    elif o == "-v":
        output = 5
    else:
        usage(prog)

if len(args) != 1:
    usage(prog)


cout = spot.get_cout()
cerr = spot.get_cerr()

e = spot.default_environment.instance()
p = spot.empty_parse_error_list()

f = spot.parse(args[0], p, e, debug_opt)
if spot.format_parse_errors(cerr, args[0], p):
    exit_code = 1

dict = spot.bdd_dict()

if f:
    if fm_opt:
        a = spot.ltl_to_tgba_fm(f, dict)
        concrete = 0
    else:
        a = concrete = spot.ltl_to_tgba_lacim(f, dict)
    f.destroy()
    del f

    degeneralized = None
Ejemplo n.º 4
0
#
# You should have received a copy of the GNU General Public License
# along with Spot; see the file COPYING.  If not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.

import sys
import spot

e = spot.default_environment.instance()
p = spot.empty_parse_error_list()

l = ['GFa', 'a U (((b)) xor c)', '!(FFx <=> Fx)', 'a \/ a \/ b \/ a \/ a'];

for str1 in l:
    f = spot.parse(str1, p, e, 0)
    if spot.format_parse_errors(spot.get_cout(), str1, p):
        sys.exit(1)
    str2 = str(f)
    f.destroy()
    print str2
    # Try to reparse the stringified formula
    f = spot.parse(str2, p, e)
    if spot.format_parse_errors(spot.get_cout(), str2, p):
        sys.exit(1)
    print f
    f.destroy()

assert spot.atomic_prop.instance_count() == 0
assert spot.binop.instance_count() == 0
assert spot.unop.instance_count() == 0
Ejemplo n.º 5
0
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
# License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Spot; see the file COPYING.  If not, write to the Free
# Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.

# Make sure that interdependencies between the spot and buddy wrappers
# are not problematic.
import buddy
import spot
e = spot.default_environment.instance()
p = spot.empty_parse_error_list()
f = spot.parse('GFa', p, e)
dict = spot.bdd_dict()
a = spot.ltl_to_tgba_lacim(f, dict)
s0 = a.get_init_state()
b = s0.as_bdd()
print b
iter = a.succ_iter(s0)
iter.first()
while not iter.done():
    c = iter.current_condition()
    print c
    b &= c # `&=' is defined only in buddy.  So if this statement works
           # it means buddy can grok spot's objects.
    iter.next()
print b