product: raise an exception if the dict are different

Fixes #132.

* python/spot.py (translate): Allow changing the dictionary.
* tests/python/prodexpt.py: New file.
* tests/Makefile.am: Add it.
* spot/twa/twaproduct.cc, spot/twaalgos/product.cc: Add them.
* NEWS: Mention the change.
This commit is contained in:
Alexandre Duret-Lutz 2016-01-23 21:24:53 +01:00
parent 78fd7beaaf
commit c4e9083f4e
6 changed files with 55 additions and 6 deletions

View file

@ -574,7 +574,7 @@ def _postproc_translate_options(obj, default_type, *args):
obj.set_level(optm_)
def translate(formula, *args):
def translate(formula, *args, dict=_bdd_dict):
"""Translate a formula into an automaton.
Keep in mind that 'Deterministic' expresses just a preference that
@ -592,7 +592,7 @@ def translate(formula, *args):
The default corresponds to 'tgba', 'small' and 'high'.
"""
a = translator(_bdd_dict)
a = translator(dict)
_postproc_translate_options(a, postprocessor.TGBA, *args)
if type(formula) == str:
formula = parse_formula(formula)